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

Make reproject work even with data not loaded #274

Merged
merged 4 commits into from
Aug 12, 2022

Conversation

adehecq
Copy link
Member

@adehecq adehecq commented May 18, 2022

This is mostly in reply to issue #273.

@adehecq adehecq linked an issue May 18, 2022 that may be closed by this pull request
@adehecq
Copy link
Member Author

adehecq commented May 18, 2022

Sorry @erikmannerfelt, another conflict with your PR...

@erikmannerfelt
Copy link
Contributor

Looking good! There's just a test that needs fixing. Because you change the default reprojection algorithm (why by the way? I agree with the change but you haven't said why bilinear should be default!), some tests fail sporadically because the values are no longer exact. For some reason that I can't explain, only the Windows tests fail!

Here's the line that fails in the Windows CI:

https://github.com/GlacioHack/GeoUtils/blob/c101c3ed1e7424e0492b453b08f34aaa52b0569a/tests/test_georaster.py#L508

If you change this to use np.isclose instead, it should work. It's comparing 13.048369 == 13.0 so a one-decimal tolerance should be sufficient.

@adehecq
Copy link
Member Author

adehecq commented Aug 12, 2022

Looking good! There's just a test that needs fixing. Because you change the default reprojection algorithm (why by the way? I agree with the change but you haven't said why bilinear should be default!), some tests fail sporadically because the values are no longer exact. For some reason that I can't explain, only the Windows tests fail!

You're right, that is the reason for the tests failing. I will revert to the previous behavior and make the change in a separate PR, to be more transparent.
The test also need to be updated to pass only for nearest interpolation.

@adehecq adehecq merged commit 5087bba into GlacioHack:main Aug 12, 2022
@adehecq adehecq deleted the fix_reproject branch August 12, 2022 13:00
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.

Raster.reproject raises unclear error when data is not loaded
2 participants