[Bug] ModuleNotFoundError with xarray >= v2025.03.0
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start with cf_xarray/accessor.py and reproduce the import failure using xarray v2025.03.0, comparing it with the working v2025.01.2 setup. Check the referenced xarray arithmetic module move and any other affected imports; done means cf_xarray imports successfully with the newer xarray release and its relevant tests pass.
Written by the indexing model from the issue text.
Description
Xarray's v2025.03.0 release last week seems to have included a breaking change that results in cf_xarray erroring out on import.
After I updated our dependencies today, xarray got bumped from v2025.01.2 to v2025.03.0, and I starting seeing this error in my stack trace:
my/code/common/io.py:16: in <module>
from cf_xarray import decode_compress_to_multi_index, encode_multi_index_as_compress
.venv/lib/python3.11/site-packages/cf_xarray/__init__.py:2: in <module>
from .accessor import CFAccessor # noqa
.venv/lib/python3.11/site-packages/cf_xarray/accessor.py:27: in <module>
from xarray.core.arithmetic import SupportsArithmetic
E ModuleNotFoundError: No module named 'xarray.core.arithmetic'
When I pin the constraint for xarray to xarray >= 2023.10.1, < 2025.3.0 I no longer see this issue, so I have a good workaround, just wanted to make sure to report in case you have the appetite to fix the issue or other followers encounter the same problem.
You can see the problematic file move in question here (xarray/core/arithmetic.py → xarray/computation/arithmetic.py). There may be others.
- Dominant language
- Python
- Stars
- 181
- Forks
- 49
- Avg merge
- 43m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from xarray-contrib/cf-xarray
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
xarray-contrib/cf-xarray#623 ·
-
Consider adding opt-in support for circular axes when calling `bounds_to_vertices` (related to #594) Open
Difficulty 5/5 Over a week Newbie friendliness 38/100
xarray-contrib/cf-xarray#596 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
xarray-contrib/cf-xarray#570 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
xarray-contrib/cf-xarray#568 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
xarray-contrib/cf-xarray#543 · 14 comments ·
All issues in xarray-contrib/cf-xarray
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
zostera/django-bootstrap4#894 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3276 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#759 ·