-
Notifications
You must be signed in to change notification settings - Fork 9
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
Check for non-numeric keys in value_map in reclassify raster function #419 #420
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @claire-simpson , this is very succinct and effective. Would you please add a note in HISTORY about the new TypeError
being raised? And I found one little redundant line in the test.
Thanks @davemfish! I noticed that many of the geoprocessing tests define the |
Interesting, feel free to clean that up for us if you'd like to! It could happen in this PR if you want, or a separate one. |
Went ahead and did it. I suspect target_nodata was redefined explicitly as the function called in between the duplicate assignments did set target_nodata but that should be out of scope and therefore unnecessary to reassign target_nodata in the test script |
Thank you! |
Check that the
value_map
does not contain any non-numeric keys in the raster reclassify function. This function will fail if there are any None/NA keys in thevalue_map
dictionary so instead we're explicitly checking for them upfront to provide the user with a clearer error message. Note that this still allowsnumpy.nan
keys to pass. I've also created a test to confirm this check works as anticipated.Fixes #419