Skip to content

Commit 93f6e45

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

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/spatialdata_plot/pl/utils.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,9 +1802,7 @@ def _type_check_params(param_dict: dict[str, Any], element_type: str) -> dict[st
18021802
if (norm := param_dict.get("norm")) is not None:
18031803
if element_type in {"images", "labels"} and not isinstance(norm, Normalize):
18041804
raise TypeError("Parameter 'norm' must be of type Normalize.")
1805-
if element_type in {"shapes", "points"} and not isinstance(
1806-
norm, bool | Normalize
1807-
):
1805+
if element_type in {"shapes", "points"} and not isinstance(norm, bool | Normalize):
18081806
raise TypeError("Parameter 'norm' must be a boolean or a mpl.Normalize.")
18091807

18101808
if (scale := param_dict.get("scale")) is not None:
@@ -1823,15 +1821,11 @@ def _type_check_params(param_dict: dict[str, Any], element_type: str) -> dict[st
18231821
raise ValueError("Parameter 'size' must be a positive number.")
18241822

18251823
if element_type == "shapes" and (shape := param_dict.get("shape")) is not None:
1826-
valid_shapes = {"circle", "hex", "visium_hex", "square"}
1824+
valid_shapes = {"circle", "hex", "visium_hex", "square"}
18271825
if not isinstance(shape, str):
1828-
raise TypeError(
1829-
f"Parameter 'shape' must be a String from {valid_shapes} if not None."
1830-
)
1826+
raise TypeError(f"Parameter 'shape' must be a String from {valid_shapes} if not None.")
18311827
if shape not in valid_shapes:
1832-
raise ValueError(
1833-
f"'{shape}' is not supported for 'shape', please choose from {valid_shapes}."
1834-
)
1828+
raise ValueError(f"'{shape}' is not supported for 'shape', please choose from {valid_shapes}.")
18351829

18361830
table_name = param_dict.get("table_name")
18371831
table_layer = param_dict.get("table_layer")

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,4 +551,4 @@ def sdata_hexagonal_grid_spots():
551551
# Use ShapesModel.parse() to create a properly validated GeoDataFrame
552552
shapes_gdf = ShapesModel.parse(gdf)
553553

554-
return SpatialData(shapes={"spots": shapes_gdf})
554+
return SpatialData(shapes={"spots": shapes_gdf})

0 commit comments

Comments
 (0)