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

grass.pygrass: Fix parameter range error reporting #2817

Merged
merged 3 commits into from
May 24, 2023

Conversation

wenzeslaus
Copy link
Member

@wenzeslaus wenzeslaus commented Feb 9, 2023

For a parameter value which was out of range from key_desc specified as 0-, grass.pygrass failed to construct the error message and resulting error message for the exception was:

TypeError: must be real number, not NoneType

This handles the cases with only min or max specified separately, fixes the error message and uses f-strings. The new message is:

ValueError: The Parameter <size> must be higher than 1.0, 0 is out of range.

@wenzeslaus wenzeslaus added bug Something isn't working Python Related code is in Python labels Feb 17, 2023
@wenzeslaus wenzeslaus added this to the 8.4.0 milestone Feb 17, 2023
@wenzeslaus wenzeslaus force-pushed the fix-pygrass-parameter-checks branch from d7c4e52 to 0fb693a Compare May 15, 2023 17:06
@wenzeslaus wenzeslaus marked this pull request as ready for review May 18, 2023 13:30
@wenzeslaus
Copy link
Member Author

This passes existing tests and adds new tests, merging.

@wenzeslaus wenzeslaus merged commit 952dd71 into OSGeo:main May 24, 2023
@wenzeslaus wenzeslaus deleted the fix-pygrass-parameter-checks branch May 24, 2023 18:26
neteler pushed a commit to nilason/grass that referenced this pull request Nov 7, 2023
This fixes parameter range error, uses f-strings, and adds tests for positive min and max and message text.
petrasovaa pushed a commit that referenced this pull request Feb 14, 2024
This fixes parameter range error, uses f-strings, and adds tests for positive min and max and message text.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant