Skip to content

Commit d07aa1d

Browse files
committed
remove upper xarray pin
1 parent db3e14c commit d07aa1d

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- bump bioimageio.spec library version to 0.5.5.6
44
- Replace `conda activate <env name>` with `conda run -n <env name> python --version` when checking if a conda environment exists
55
(This is closer to the actual `conda run` command we need and avoids requests by conda to rerun `conda init` (in CI).)
6+
- remove upper xarray pin (use ops from xarray.computation.ops, fallback to xarray.core.ops for older xarray versions)
67

78
### 0.9.3
89

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies = [
1818
"scipy",
1919
"tqdm",
2020
"typing-extensions",
21-
"xarray>=2023.01,<2025.3.0",
21+
"xarray>=2023.01",
2222
]
2323
classifiers = [
2424
"Development Status :: 3 - Alpha",

src/bioimageio/core/_magic_tensor_ops.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@
66
from typing import Any, Callable
77

88
from typing_extensions import Self
9-
from xarray.core import nputils, ops
9+
from xarray.core import nputils
10+
11+
try:
12+
# xarray >= 2025.03
13+
from xarray.computation import ops
14+
except ImportError:
15+
# xarray < 2025.03
16+
from xarray.core import ops # type: ignore
1017

1118

1219
class MagicTensorOpsMixin:

0 commit comments

Comments
 (0)