-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement regridding during Dataset.load() #9
Conversation
Hi @geek-yang , this PR is ready for review! You can ignore the failing windows tests for now, it's due to a pytest argument apparently not working (correctly) on Windows 🤪 |
So for windows try:
import xesmf
except ImportError:
pass This will not trigger the dependency check failure for pytest. Later when we need to add some unit tests for @pytest.mark.skipif('xesmf' not in sys.modules,
reason="requires the xesmf library")
def test_xesmf_function():
... |
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.
@BSchilperoort Super! Awesome solution for regridding! I've tested both methods for regridding (I need to get conda/mamba back for it.... 😒) and they all work perfectly. It would be nice to update the notebook as well (since now resolution
and regrid_method
are mandatory). But overall everything looks fantastic! You get a go 😜.
PS: if you plan to update the notebook, please also add equal_nan=True
to the assertion of conversion (last cell), otherwise it might fail.
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Thanks for the review, @geek-yang ! 😄 I fixed the pytest issue with |
Awesome! Yesterday I also did some googling but didn't find anything like this. It is quite nice that you checked |
After a lot of messing around I've settled upon the following implementation:
flox
andxarray
(both available for all systems & on pypi).xesmf
(which requires esmpy/ESMF: only on linux, only on conda).For most cases the two methods give basically the same result, although the custom regridding routine doesn't handle the following too well:
How to review:
.load
method's resolution and regrid_method kwargs.