Skip to content

Commit db30c1d

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent daafe12 commit db30c1d

24 files changed

+42
-69
lines changed

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from datetime import datetime
1010
from importlib.metadata import metadata
1111
from pathlib import Path
12+
1213
import spatialdata_io.experimental
1314

1415
_ = spatialdata_io.experimental

src/spatialdata_io/__main__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
2929

3030
@click.group()
3131
def cli() -> None:
32-
"""
33-
Convert standard technology data formats to SpatialData object.
32+
"""Convert standard technology data formats to SpatialData object.
3433
3534
Usage:
3635

src/spatialdata_io/_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import Any
66

77

8-
def inject_docs(**kwargs: Any) -> Callable[..., Any]: # noqa: D103
8+
def inject_docs(**kwargs: Any) -> Callable[..., Any]:
99
# taken from scanpy
1010
def decorator(obj: Any) -> Any:
1111
obj.__doc__ = dedent(obj.__doc__).format(**kwargs)

src/spatialdata_io/_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
# these two functions should be removed and imported from spatialdata._utils once the multi_table branch, which
1212
# introduces them, is merged
1313
def deprecation_alias(**aliases: str) -> Callable[[Callable[..., RT]], Callable[..., RT]]:
14-
"""
15-
Decorate a function to warn user of use of arguments set for deprecation.
14+
"""Decorate a function to warn user of use of arguments set for deprecation.
1615
1716
Parameters
1817
----------

src/spatialdata_io/converters/generic_to_zarr.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ def generic_to_zarr(
2121
data_axes: str | None = None,
2222
coordinate_system: str | None = None,
2323
) -> None:
24-
"""
25-
Read generic data from an input file and save it as a SpatialData zarr store.
24+
"""Read generic data from an input file and save it as a SpatialData zarr store.
2625
2726
Parameters
2827
----------

src/spatialdata_io/converters/legacy_anndata.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ def to_legacy_anndata(
2222
table_name: str | None = None,
2323
include_images: bool = False,
2424
) -> AnnData:
25-
"""
26-
Convert a SpatialData object to a (legacy) spatial AnnData object.
25+
"""Convert a SpatialData object to a (legacy) spatial AnnData object.
2726
2827
This is useful for using packages expecting spatial information in AnnData, for example Scanpy and older versions
2928
of Squidpy. Using this format for any new package is not recommended.
@@ -219,8 +218,7 @@ def to_legacy_anndata(
219218

220219

221220
def from_legacy_anndata(adata: AnnData) -> SpatialData:
222-
"""
223-
Convert (legacy) spatial AnnData object to SpatialData object.
221+
"""Convert (legacy) spatial AnnData object to SpatialData object.
224222
225223
This is useful for parsing a (legacy) spatial AnnData object, for example the ones produced by Scanpy and older
226224
version of Squidpy.

src/spatialdata_io/readers/_utils/_read_10x_h5.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ def _read_10x_h5(
4444
genome: str | None = None,
4545
gex_only: bool = True,
4646
) -> AnnData:
47-
"""
48-
Read 10x-Genomics-formatted hdf5 file.
47+
"""Read 10x-Genomics-formatted hdf5 file.
4948
5049
Parameters
5150
----------

src/spatialdata_io/readers/codex.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ def codex(
2727
fcs: bool = True,
2828
imread_kwargs: Mapping[str, Any] = MappingProxyType({}),
2929
) -> SpatialData:
30-
"""
31-
Read *CODEX* formatted dataset.
30+
"""Read *CODEX* formatted dataset.
3231
3332
This function reads the following files:
3433

src/spatialdata_io/readers/cosmx.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ def cosmx(
3535
imread_kwargs: Mapping[str, Any] = MappingProxyType({}),
3636
image_models_kwargs: Mapping[str, Any] = MappingProxyType({}),
3737
) -> SpatialData:
38-
"""
39-
Read *Cosmx Nanostring* data.
38+
"""Read *Cosmx Nanostring* data.
4039
4140
This function reads the following files:
4241

src/spatialdata_io/readers/curio.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
def curio(
2020
path: str | Path,
2121
) -> SpatialData:
22-
"""
23-
Read *Curio* formatted dataset.
22+
"""Read *Curio* formatted dataset.
2423
2524
This function reads the following files:
2625
@@ -73,7 +72,7 @@ def curio(
7372
categories = metrics[CurioKeys.CATEGORY].unique()
7473
for cat in categories:
7574
df = metrics.loc[metrics[CurioKeys.CATEGORY] == cat]
76-
adata.uns[cat] = dict(zip(df.iloc[:, 0], df.iloc[:, 1]))
75+
adata.uns[cat] = dict(zip(df.iloc[:, 0], df.iloc[:, 1], strict=False))
7776
adata.uns[CurioKeys.TOP_CLUSTER_DEFINING_FEATURES] = var_features_clusters
7877

7978
# adding Moran's I information in adata.var, for the variable for which it is available

0 commit comments

Comments
 (0)