Uh oh!
There was an error while loading. Please reload this page.
Speedup for bounding_box_query - #1104
Conversation
for more information, see https://pre-commit.ci
Performance/bounding box query
Simplify dask bbox query
… performance issues
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #1104 +/- ##
==========================================
+ Coverage 92.04% 92.06% +0.01%
==========================================
Files 51 51 Lines 7785 7792 +7 ==========================================
+ Hits 7166 7174 +8 + Misses 619 618 -1
🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| axes: tuple[str, ...], | ||
| min_coordinate: list[Number] | ArrayLike, | ||
| max_coordinate: list[Number] | ArrayLike, | ||
| points_df: pd.DataFrame | None = None, |
There was a problem hiding this comment.
_bounding_box_mask_points() is called only in two locations, and in both points_df is available. I will therefore remove the points argument, and only keep points_df.
| ------- | ||
| The masks for the points inside the bounding boxes. | ||
| """ | ||
| element_axes = get_axes_names(points) |
There was a problem hiding this comment.
This function uses single dispatch and expects a Dask DataFrame. I will extend this to support also pd.DataFrame. In the future we will allow points to be pd.DataFrame also inside the SpatialData object.
…n; add extra tests for querying points; remove unnecessary copy() in polygon query of points
…s_adjusted in identity path, restore npartitions - Restore np.minimum/np.maximum swap so axis-flip transformations (negative scale) no longer raise ValueError; add regression test - Use axes_adjusted/min_coordinate_adjusted consistently in the identity path - Revert npartitions=1 back to points.npartitions in result construction - Add test for general affine transform (rotate 45° + translate) in aligned space Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.

Speedup for
bounding_box_query(), especially in the case of many points in the object. Main improvements:compute()callWith this, we achieved speedups between 30% and 70% (depending on the data). In the future, one could consider using a spatial index for the point to speed things up further.
@LucaMarconato it would be great if you could add a test for the case we discussed at the hackathon, just to ensure our rewrite of the transformation logic didn't break anything.
CC @dschaub95