Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate vector geometry types #1430

Merged
merged 6 commits into from
Oct 24, 2023
Merged

Validate vector geometry types #1430

merged 6 commits into from
Oct 24, 2023

Conversation

emlys
Copy link
Member

@emlys emlys commented Oct 18, 2023

Description

Fixes #1374

Checklist

  • Updated HISTORY.rst and link to any relevant issue (if these changes are user-facing)
  • Updated the user's guide (if needed)
  • Tested the Workbench UI (if relevant)

@@ -3507,34 +3507,6 @@ def validate(args, limit_to=None):
invalid_keys = validation.get_invalid_keys(validation_warnings)
sufficient_keys = validation.get_sufficient_keys(args)

if 'shelf_contour_vector_path' not in invalid_keys:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now redundant to validation.validate.

def test_validate_bad_aoi_incorrect_proj_units(self):
"""WaveEnergy: test validating AOI vector with incorrect units."""
from natcap.invest import wave_energy, validation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests aren't specific to wave energy, and the same thing is covered in the validation tests. I removed them because the sample data vectors they use have the wrong geometry type, which now breaks.

@emlys emlys marked this pull request as ready for review October 18, 2023 17:05
@emlys emlys requested a review from dcdenu4 October 18, 2023 17:05
@emlys emlys self-assigned this Oct 18, 2023
Copy link
Member

@dcdenu4 dcdenu4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @emlys, one suggestion and one question. I also see there are some merge conflicts in History.

src/natcap/invest/validation.py Show resolved Hide resolved
HISTORY.rst Show resolved Hide resolved
@emlys emlys requested a review from dcdenu4 October 23, 2023 19:33
Copy link
Member

@dcdenu4 dcdenu4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @emlys !

@dcdenu4 dcdenu4 merged commit ff44360 into natcap:main Oct 24, 2023
24 checks passed
@emlys emlys deleted the task/1374 branch October 3, 2024 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InVEST models don't validate input vector geometry
2 participants