Closed neutrinoceros closed 2 weeks ago
I also note that datatree was last released in 2011 and that I can't build it on Apple Silicon, so I'd like to ask whether it'd be possible to not depend on it at all ?
@neutrinoceros I can't speak for the maintainers here, but datatree is a major building block of the new CfRadial2/FM301 based datamodel pyart will eventually converge to. The former experimental implementation in https://github.com/xarray-contrib/datatree (which has a recent 0.0.15 version) has been merge/transformed into xarray codebase as of xarray 2024.10.0
as long as there's a portable solution I'm happy to use it
Yes, be sure to use https://pypi.org/project/xarray-datatree/ not https://pypi.org/project/datatree/.
note that adding
diff --git a/requirements.txt b/requirements.txt
index cec08287..edde1d57 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -13,3 +13,4 @@ mda-xdrlib
xarray
cartopy
pint
+xarray-datatree
I still get an error when running python -c "from pyart import io"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/clm/dev/pyart/pyart/__init__.py", line 29, in <module>
from . import (
File "/Users/clm/dev/pyart/pyart/xradar/__init__.py", line 1, in <module>
from .accessor import Xradar, Xgrid # noqa
File "/Users/clm/dev/pyart/pyart/xradar/accessor.py", line 8, in <module>
import datatree
File "/Users/clm/dev/pyart/.venv/lib/python3.10/site-packages/datatree/__init__.py", line 2, in <module>
from .datatree import DataTree
File "/Users/clm/dev/pyart/.venv/lib/python3.10/site-packages/datatree/datatree.py", line 33, in <module>
from xarray.core.utils import (
ImportError: cannot import name 'HybridMappingProxy' from 'xarray.core.utils' (/Users/clm/dev/pyart/.venv/lib/python3.10/site-packages/xarray/core/utils.py)
Heads up: xarray-datatree has been merged to xarray since 2024.10.0. Related: #1681
I agree with @kmuehlbauer 's points here! I think the best steps are:
I agree with @kmuehlbauer 's points here! I think the best steps are:
- [x] pin xradar<=0.7.0 and xarray<=2024.9.0 and do a release (FIX: Fix pinning of xradar and xarray #1682)
- [x] fix anything which has to be fixed (FIX: Ensure backwards compatibility with datatree/new versions of xarray #1681)
- [x] pin xradar>=0.8.0 and xarray>=2024.10.0 and do a another release
This should all be resolved with the release yesterday, and the release today. The pypi wheels are currently building, and the conda-forge version of the updated xradar/xarray versions will be out by the end of the day today. Thank you for raising this critical issue @neutrinoceros @juhi24 and for the suggestions/feedback here, as well as upstream fixes @kmuehlbauer ❤️
Thank you !
Description
installing pyart in a fresh env appears to be currently broken, because some modules depend on
datatree
, which is not declared as an explicit dependency. I'm assuming this is an oversight from #1622What I Did