Skip to content

Commit

Permalink
improve validation message when bounding boxes don't intersect natcap…
Browse files Browse the repository at this point in the history
  • Loading branch information
emlys committed Aug 21, 2023
1 parent f837685 commit 6956953
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/natcap/invest/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
'NOT_AN_INTEGER': gettext('Value "{value}" does not represent an integer'),
'NOT_BOOLEAN': gettext("Value must be either True or False, not {value}"),
'NO_PROJECTION': gettext('Spatial file {filepath} has no projection'),
'BBOX_NOT_INTERSECT': gettext("Bounding boxes do not intersect: {bboxes}"),
'BBOX_NOT_INTERSECT': gettext('Not all of the spatial layers overlap each '
'other. All bounding boxes must intersect: {bboxes}'),
'NEED_PERMISSION': gettext('You must have {permission} access to this file'),
}

Expand Down
2 changes: 1 addition & 1 deletion tests/test_habitat_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -1934,7 +1934,7 @@ def test_habitat_quality_argspec_spatial_overlap(self):
self.assertTrue(
validate_result,
"expected failed validations instead didn't get any.")
self.assertIn("Bounding boxes do not intersect", validate_result[0][1])
self.assertIn("bounding boxes must intersect", validate_result[0][1])

def test_habitat_quality_argspec_missing_projection(self):
"""Habitat Quality: raise error on missing projection."""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const { ipcRenderer } = window.Workbench.electron;
* @returns {string} - the filtered and formatted part of the message
*/
function filterSpatialOverlapFeedback(message, filepath) {
const newPrefix = i18n.t('Bounding box does not intersect at least one other:');
const newPrefix = i18n.t(
'Not all of the spatial layers overlap each other. Bounding box:');
const bbox = message.split(`${filepath}:`).pop().split('|')[0];
const bboxFormatted = bbox.split(' ').map(
(str) => str.padEnd(22, ' ')
Expand Down

0 comments on commit 6956953

Please sign in to comment.