Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 16, 2024
1 parent 8b44de3 commit c9616e3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/spatialdata_io/readers/visium_hd.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,24 +370,24 @@ def _get_bins(path_bins: Path) -> list[str]:
# add labels layer (rasterized bins).
labels_name = f"{dataset_id}_{bin_size_str}_labels"

labels_element=rasterize_bins(
labels_element = rasterize_bins(
sdata,
bins = shapes_name,
bins=shapes_name,
table_name=bin_size_str,
row_key=VisiumHDKeys.ARRAY_ROW,
col_key= VisiumHDKeys.ARRAY_COL,
col_key=VisiumHDKeys.ARRAY_COL,
value_key=None,
return_region_as_labels=True,
)
sdata[ labels_name ] = labels_element
)

sdata[labels_name] = labels_element

adata = sdata[ bin_size_str ]
adata = sdata[bin_size_str]

adata.obs[VisiumHDKeys.REGION_KEY] = labels_name
adata.obs[VisiumHDKeys.REGION_KEY] = adata.obs[VisiumHDKeys.REGION_KEY].astype("category")

del adata.uns[ TableModel.ATTRS_KEY ]
del adata.uns[TableModel.ATTRS_KEY]

adata = TableModel.parse(
adata,
Expand All @@ -396,8 +396,8 @@ def _get_bins(path_bins: Path) -> list[str]:
instance_key=str(VisiumHDKeys.INSTANCE_KEY),
)

del sdata[ bin_size_str ]
sdata[ bin_size_str ] = adata
del sdata[bin_size_str]
sdata[bin_size_str] = adata

return sdata

Expand Down

0 comments on commit c9616e3

Please sign in to comment.