Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/spatialdata_io/converters/legacy_anndata.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,4 +350,4 @@ def from_legacy_anndata(adata: AnnData) -> SpatialData:
new_table = TableModel.parse(new_table, region=REGION, region_key=REGION_KEY, instance_key=INSTANCE_KEY)
else:
new_table = adata.copy()
return SpatialData(table=new_table, images=images, shapes=shapes)
return SpatialData(tables={"table": new_table}, images=images, shapes=shapes)
6 changes: 3 additions & 3 deletions tests/converters/test_legacy_anndata.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def blobs_annotating_element(name: BlobsTypes) -> SpatialData:
n = len(instance_id)
new_table = AnnData(shape=(n, 0), obs={"region": [name for _ in range(n)], "instance_id": instance_id})
new_table = TableModel.parse(new_table, region=name, region_key="region", instance_key="instance_id")
del sdata.table
sdata.table = new_table
del sdata["table"]
sdata["table"] = new_table
return sdata


Expand Down Expand Up @@ -67,7 +67,7 @@ def idempotency_check_from_anndata(adata0: SpatialData, include_images: bool) ->

@pytest.mark.parametrize("name", ["blobs_labels", "blobs_circles", "blobs_polygons", "blobs_multipolygons"])
@pytest.mark.parametrize("include_images", [False, True])
def test_bidectional_convesion(name: BlobsTypes, include_images: bool) -> None:
def test_bidirectional_conversion(name: BlobsTypes, include_images: bool) -> None:
if include_images:
pytest.skip(
"include_images=True can't be tested because the bug "
Expand Down
Loading