scverse / spatialdata

An open and interoperable data framework for spatial omics data
https://spatialdata.scverse.org/
BSD 3-Clause "New" or "Revised" License
174 stars 34 forks source link

Cannot import ensure_warnings from xarray #518

Closed aeisenbarth closed 1 month ago

aeisenbarth commented 1 month ago
>>> from spatialdata.testing import assert_elements_are_identical
ImportError: cannot import name 'ensure_warnings' from 'xarray.testing'

Previously, spatialdata was compatible with xarray==2023.12.0. That version has testing.py refactored to a submodule testing/assertions.py and ensure_warnings is not exposed in testing/__init__.py: https://github.com/pydata/xarray/commit/ab6a2553e142e1d6f90548bba66b7f8ead483dca#diff-b3cff50fb52cd3e5d1496dd39678056a9745e7efb8da58d47e439e46b8aa6bbc

Apparently, spatialdata==0.1.0 was tested with an older version of xarray (although no constraints in pyproject dependencies given).

aeisenbarth commented 1 month ago

Sorry, not an issue in spatialdata. This was caused by xarray-datatree 0.0.13 instead of 0.0.14