Skip to content

Commit 81f99aa

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

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

src/spatialdata/_core/query/spatial_query.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from __future__ import annotations
22

3-
import warnings
43
from abc import abstractmethod
54
from collections.abc import Callable, Mapping
65
from dataclasses import dataclass
@@ -668,18 +667,15 @@ def _(
668667

669668
# materialize the points in the intrinsic coordinate system once
670669
points_pd = points.compute()
671-
670+
672671
# checking the type of the transformation
673672
# in the case of an identity or scaling transform, we can skip the whole
674673
# projection into intrinsic space and reprojection into the global coordinate system
675674
is_identity_transform = input_axes_without_c == output_axes_without_c and np.allclose(
676675
m_without_c, np.eye(m_without_c.shape[0])
677676
)
678-
is_scaling_transform = (
679-
input_axes_without_c == output_axes_without_c
680-
and _is_scaling_transform(m_without_c_linear)
681-
)
682-
677+
is_scaling_transform = input_axes_without_c == output_axes_without_c and _is_scaling_transform(m_without_c_linear)
678+
683679
# if the transform is identity, we can save extra for the affine transformation
684680
if is_identity_transform:
685681
bounding_box_masks = _bounding_box_mask_points(
@@ -691,8 +687,8 @@ def _(
691687
)
692688
elif is_scaling_transform:
693689
# Pull scale factors from the diagonal and the translation from the last column
694-
scales = np.diagonal(m_without_c_linear) # shape: (n_axes,)
695-
translation = m_without_c[:-1, -1] # shape: (n_axes,)
690+
scales = np.diagonal(m_without_c_linear) # shape: (n_axes,)
691+
translation = m_without_c[:-1, -1] # shape: (n_axes,)
696692

697693
# Invert the affine: x_intrinsic = (x_output - translation) / scale
698694
min_intrinsic = (min_coordinate_adjusted - translation) / scales

0 commit comments

Comments
 (0)