Read failure with aligned example data; fails on "shapes"

wget https://s3.embl.de/spatialdata/spatialdata-sandbox/xenium_rep1_io_aligned.zip

unzip to find folder data_aligned.zarr

>>> sdata = sd.read_zarr("data_aligned.zarr")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/exouser/.local/lib/python3.10/site-packages/spatialdata/_io/io_zarr.py", line 121, in read_zarr
    shapes[subgroup_name] = _read_shapes(f_elem_store)
  File "/home/exouser/.local/lib/python3.10/site-packages/spatialdata/_io/io_shapes.py", line 33, in _read_shapes
    coords = np.array(f["coords"])
  File "/home/exouser/.local/lib/python3.10/site-packages/zarr/hierarchy.py", line 511, in __getitem__
    raise KeyError(item)
KeyError: 'coords'

The read will succeed with sd.read_zarr("data_aligned.zarr", selection=["points", "images"]) but if “shapes” is added, it fails as above.

>>> session_info.show(dependencies=True)
-----
session_info        1.0.0
spatialdata         0.2.1
-----
PIL                         10.4.0
anndata                     0.10.7
asciitree                   NA
attr                        21.2.0
certifi                     2020.06.20
chardet                     4.0.0
cloudpickle                 3.0.0
colorama                    0.4.4
cycler                      0.12.1
cython_runtime              NA
dask                        2024.8.0
dask_expr                   1.1.10
dask_image                  NA
datashader                  0.16.3
datatree                    0.0.14
dateutil                    2.9.0.post0
exceptiongroup              1.2.1
fsspec                      2023.6.0
geopandas                   1.0.1
h5py                        3.11.0
idna                        3.3
importlib_metadata          NA
jinja2                      3.0.3
kiwisolver                  1.4.5
lazy_loader                 0.4
llvmlite                    0.42.0
markupsafe                  2.0.1
matplotlib                  3.9.0
more_itertools              8.10.0
msgpack                     1.0.8
multipledispatch            0.6.0
multiscale_spatial_image    1.0.1
natsort                     8.4.0
networkx                    3.3
numba                       0.59.1
numcodecs                   0.13.0
numpy                       1.26.4
ome_zarr                    NA
packaging                   24.0
pandas                      2.2.2
param                       2.1.1
pkg_resources               NA
platformdirs                2.5.1
pooch                       v1.8.2
psutil                      5.9.0
pyarrow                     17.0.0
pyct                        0.5.0
pygments                    2.18.0
pyparsing                   2.4.7
pyproj                      3.6.1
pytz                        2022.1
requests                    2.25.1
rich                        NA
scipy                       1.13.1
shapely                     2.0.5
sitecustomize               NA
six                         1.16.0
skimage                     0.24.0
spatial_image               1.1.0
tblib                       3.0.0
tlz                         0.12.1
toolz                       0.12.1
tqdm                        4.66.4
typing_extensions           NA
tzdata                      2024.1
urllib3                     1.26.5
xalt_python_pkg_filter      NA
xarray                      2024.7.0
xarray_dataclasses          1.8.0
xarray_schema               0.0.3
xrspatial                   0.4.0
yaml                        5.4.1
zarr                        2.18.2
zipp                        NA
zoneinfo                    NA
zope                        NA
-----
Python 3.10.12 (main, Jul 29 2024, 16:56:48) [GCC 11.4.0]
Linux-6.5.0-44-generic-x86_64-with-glibc2.35
-----
Session information updated at 2024-08-07 12:13

Hi, thanks for reporting the issue. Please check this link to see an explanation on why the issue occurs: Error on the tutorial Deep learning example on image tiles · Issue #652 · scverse/spatialdata · GitHub.

The solution is already prepared, we just need to cut a new release. I will be doing it later today.

I just made a release for spatialdata, spatialdata-io, napari-spatialdata and spatialdata-plot. The packages should be available via pip within minutes, and should be available in conda earliest in a few hours and latest in 1-2 days.