Skip to content

Commit 87fb577

Browse files
author
Sonja Stockhaus
committed
fix mypy typing error
1 parent f25648e commit 87fb577

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/spatialdata_plot/pl/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,15 +2415,15 @@ def _prepare_transformation(
24152415

24162416
def _get_datashader_trans_matrix_of_single_element(
24172417
trans: Identity | Scale | Affine | MapAxis | Translation,
2418-
) -> npt.NDArray[Any]:
2418+
) -> ArrayLike:
24192419
flip_matrix = np.array([[1, 0, 0], [0, -1, 0], [0, 0, 1]])
2420-
tm: npt.NDArray[Any] = trans.to_affine_matrix(("x", "y"), ("x", "y"))
2420+
tm: ArrayLike = trans.to_affine_matrix(("x", "y"), ("x", "y"))
24212421

24222422
if isinstance(trans, Identity):
24232423
return np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
24242424
if isinstance(trans, (Scale | Affine)):
24252425
# idea: "flip the y-axis", apply transformation, flip back
2426-
flip_and_transform: npt.NDArray[Any] = flip_matrix @ tm @ flip_matrix
2426+
flip_and_transform: ArrayLike = flip_matrix @ tm @ flip_matrix
24272427
return flip_and_transform
24282428
if isinstance(trans, MapAxis):
24292429
# no flipping needed
@@ -2434,7 +2434,7 @@ def _get_datashader_trans_matrix_of_single_element(
24342434

24352435
def _get_transformation_matrix_for_datashader(
24362436
trans: Scale | Identity | Affine | MapAxis | Translation | SDSequence,
2437-
) -> npt.NDArray[Any]:
2437+
) -> ArrayLike:
24382438
"""Get the affine matrix needed to transform shapes for rendering with datashader."""
24392439
if isinstance(trans, SDSequence):
24402440
tm = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])

0 commit comments

Comments
 (0)