-
-
Notifications
You must be signed in to change notification settings - Fork 573
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
Added metadata test for GenericMap.resample #883
Conversation
PR Looks very nice! 👍 I'm thinking if we should just change size and coordinates on the header of a resample image, or if we should also add something in the history, so whoever finds a resample file later on knows it has been resampled. |
resampled_map = self.map.resample(new_dimensions, method = sample_method) | ||
assert resampled_map.shape[1] == new_dimensions[0] | ||
assert resampled_map.shape[0] == new_dimensions[1] | ||
|
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.
Isn't it easier to tell which test failed under the old version?
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.
I was thinking the same... but if it fails you get the value tested within the error message, so at least the dimensions will tell you which one was used. I think.
I'm not saying that's easier to tell though. But from a list of 4 is quite easy.
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.
@derdon Can't we use some pytest magic here?
Fixed the spaces around |
You usually don't need a custom message because the output of py.test is quite helpful. Just use |
Can't we use pytest parametrize to make this cleaner? https://pytest.org/latest/example/parametrize.html |
Yes, this is how it should be done. Then, each one will count as a different test, too, which they should. |
Okay fixed, hopefully pytest will report enough info now. |
👍 from me. |
Added metadata test for GenericMap.resample
As addressed in issue #760. I also made the other
resample
test a bit more concise.