Strange bug. Running the 00_xenium_and_visium.ipynb notebook, at the end of the notebook the get_extent() function does not recognize SpatialData for xe_rep1_roi_sdata. If we save the object and reload it, it works.
sd.get_extent(xe_rep1_roi_sdata)
gives
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[81], line 1
----> 1 sd.get_extent(xe_rep1_roi_sdata)
File ~/miniconda3/envs/ome/lib/python3.10/functools.py:889, in singledispatch.<locals>.wrapper(*args, **kw)
885 if not args:
886 raise TypeError(f'{funcname} requires at least '
887 '1 positional argument')
--> 889 return dispatch(args[0].__class__)(*args, **kw)
File ~/embl/projects/basel/spatialdata/src/spatialdata/_core/data_extent.py:174, in get_extent(e, coordinate_system, exact, has_images, has_labels, has_points, has_shapes, elements)
106 @singledispatch
107 def get_extent(
108 e: SpatialData | SpatialElement,
(...)
117 ] = None,
118 ) -> BoundingBoxDescription:
119 """
120 Get the extent (bounding box) of a SpatialData object or a SpatialElement.
121
(...)
172 the box `[minx, miny, maxx, maxy] = [-0.707, 0, 0.707, 1.414]`.
173 """
--> 174 raise ValueError(f"The object type {type(e)} is not supported.")
ValueError: The object type <class 'spatialdata._core.spatialdata.SpatialData'> is not supported.
Maybe it is just a problem with autoreload, I will re-run the notebook and check this. Edit: the problem disappeared, I attribute it to autoreload and close this.
Strange bug. Running the
00_xenium_and_visium.ipynb
notebook, at the end of the notebook theget_extent()
function does not recognizeSpatialData
forxe_rep1_roi_sdata
. If we save the object and reload it, it works.gives
but
works as expected.