Skip to content

Commit

Permalink
Merge pull request #186 from scverse/LucaMarconato/fix-xenium-default
Browse files Browse the repository at this point in the history
Fix xenium default value and add deprecation warning
  • Loading branch information
LucaMarconato authored Aug 1, 2024
2 parents f69bd66 + f5263e1 commit 8387b91
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/spatialdata_io/readers/xenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def xenium(
*,
cells_boundaries: bool = True,
nucleus_boundaries: bool = True,
cells_as_circles: bool = False,
cells_as_circles: bool | None = None,
cells_labels: bool = True,
nucleus_labels: bool = True,
transcripts: bool = True,
Expand Down Expand Up @@ -146,6 +146,14 @@ def xenium(
... )
>>> sdata.write("path/to/data.zarr")
"""
if cells_as_circles is None:
cells_as_circles = True
warnings.warn(
"The default value of `cells_as_circles` will change to `False` in the next release. "
"Please pass `True` explicitly to maintain the current behavior.",
DeprecationWarning,
stacklevel=3,
)
image_models_kwargs, labels_models_kwargs = _initialize_raster_models_kwargs(
image_models_kwargs, labels_models_kwargs
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_xenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_roundtrip_with_data_limits() -> None:
def test_example_data(dataset: str, expected: str) -> None:
f = Path("./data") / dataset
assert f.is_dir()
sdata = xenium(f)
sdata = xenium(f, cells_as_circles=False)
from spatialdata import get_extent

extent = get_extent(sdata, exact=False)
Expand Down

0 comments on commit 8387b91

Please sign in to comment.