-
Notifications
You must be signed in to change notification settings - Fork 270
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
FIX: Ensure backwards compatibility with datatree/new versions of xarray #1681
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.
This looks like a step in the right direction, however if neither xarray-datatree
nor datatree
is a hard dependency to pyart
, then there should probably be an abstract way to specify which flavor users want (e.g. pip install arm-pyart[xarray-datatree]
, pip install arm-pyart[datatree]
). This would preserve downstream from having to specify the exact requirements themselves, though it doesn't address the fact that the default install is broken.
I would recommend having xarray-datatree
as a hard dependency and be done with it, but if that is not possible I would still recommend crafting a custom error message to explain the situation when both import fail
You probably meant packages Currently, |
From my perspective it would be reasonable to:
That's one way to not break users existing code. Users might then decide which version to use. The old xarray-datatree and the new datatree from xarray differ in quite some places and would need users to adapt their code (depending on what they've imported from there). I'm not that familiar with pyart's usage of xradar, but good chance that correct pinning will already do the trick. |
Here's also the offical migration guide for reference https://github.com/pydata/xarray/blob/main/DATATREE_MIGRATION_GUIDE.md |
xarray-datatree has been merged to xarray>=2024.10.0. Since xarray version is not pinned, this will cause ImportErrors unless addressed. This is PR is an attempt towards a phased transition to using
xarray.datatree
.