@@ -2363,15 +2363,15 @@ def _prepare_transformation(
2363
2363
2364
2364
def _get_datashader_trans_matrix_of_single_element (
2365
2365
trans : Identity | Scale | Affine | MapAxis | Translation ,
2366
- ) -> npt . NDArray [ Any ] :
2366
+ ) -> ArrayLike :
2367
2367
flip_matrix = np .array ([[1 , 0 , 0 ], [0 , - 1 , 0 ], [0 , 0 , 1 ]])
2368
- tm : npt . NDArray [ Any ] = trans .to_affine_matrix (("x" , "y" ), ("x" , "y" ))
2368
+ tm : ArrayLike = trans .to_affine_matrix (("x" , "y" ), ("x" , "y" ))
2369
2369
2370
2370
if isinstance (trans , Identity ):
2371
2371
return np .array ([[1 , 0 , 0 ], [0 , 1 , 0 ], [0 , 0 , 1 ]])
2372
2372
if isinstance (trans , (Scale | Affine )):
2373
2373
# idea: "flip the y-axis", apply transformation, flip back
2374
- flip_and_transform : npt . NDArray [ Any ] = flip_matrix @ tm @ flip_matrix
2374
+ flip_and_transform : ArrayLike = flip_matrix @ tm @ flip_matrix
2375
2375
return flip_and_transform
2376
2376
if isinstance (trans , MapAxis ):
2377
2377
# no flipping needed
@@ -2382,7 +2382,7 @@ def _get_datashader_trans_matrix_of_single_element(
2382
2382
2383
2383
def _get_transformation_matrix_for_datashader (
2384
2384
trans : Scale | Identity | Affine | MapAxis | Translation | SDSequence ,
2385
- ) -> npt . NDArray [ Any ] :
2385
+ ) -> ArrayLike :
2386
2386
"""Get the affine matrix needed to transform shapes for rendering with datashader."""
2387
2387
if isinstance (trans , SDSequence ):
2388
2388
tm = np .array ([[1 , 0 , 0 ], [0 , 1 , 0 ], [0 , 0 , 1 ]])
@@ -2545,7 +2545,7 @@ def _multipolygon_to_circle(multipolygon: shapely.MultiPolygon) -> tuple[shapely
2545
2545
points = np .array (coords )
2546
2546
circle_points = points [ConvexHull (points ).vertices ]
2547
2547
center = np .mean (circle_points , axis = 0 )
2548
- radius = max (np .linalg .norm (p - center ) for p in circle_points )
2548
+ radius = max (float ( np .linalg .norm (p - center ) ) for p in circle_points )
2549
2549
assert isinstance (radius , float ) # shut up mypy
2550
2550
return shapely .Point (center ), radius
2551
2551
0 commit comments