Skip to content

Commit 8be4eca

Browse files
committed
xarray 2023 compatibility
1 parent 820e3c2 commit 8be4eca

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

bioimageio/core/stat_calculators.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ def compute(
139139
else:
140140
n = int(np.prod([tensor.sizes[d] for d in self._axes]))
141141

142+
if xr.__version__.startswith("2023"):
143+
var = xr.dot(c, c, dims=self._axes) / n
144+
else:
145+
var = xr.dot(c, c, dim=self._axes) / n
146+
142147
var = xr.dot(c, c, dim=self._axes) / n
143148
assert isinstance(var, xr.DataArray)
144149
std = np.sqrt(var)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"ruyaml",
4343
"tqdm",
4444
"typing-extensions",
45-
"xarray>=2024.01,<2025.3.0",
45+
"xarray>=2023.01,<2025.3.0",
4646
],
4747
include_package_data=True,
4848
extras_require={

0 commit comments

Comments
 (0)