You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* implement selection
* update
* vectorize adjust_bounding_box_to_real_axes
* update
* replace append with insert
* add comment
* vectorize
* update to handle multiple boxes
* vectorize with numba
* fix corner len
* update
* fix validation
* refactor
* refactor
* add test for query with multiple bounding boxes
* fix typing
* vectorize bounding box query on polygons
* add test to cover no polygon overlap (None)
* vectorize bounding box query on points and tests
* fix type
* Fix rasterize path and bugs in PR #687 dataloader; add benchmark
**Bugs fixed in datasets.py:**
- rasterize=True path was broken: __getitem__ always called image.sel() regardless
of rasterize flag, bypassing rasterize_fn entirely. Fixed by storing self._rasterize
and branching in __getitem__.
- ad.concat(*tables_l) unpacked the list as positional args, failing with >1 region.
Fixed to ad.concat(tables_l).
- Vectorized selection pre-computation was always run even for rasterize=True where
it is unused. Fixed by guarding with `if not rasterize`.
- Removed stale commented-out pandas.apply fallback code.
**Fixes in _utils.py:**
- Removed redundant nopython=True from @nb.njit (njit implies nopython=True,
and the argument caused a RuntimeWarning).
- Replaced invalid nb.types.Array[nb.float64, nb.float64] annotations with np.ndarray.
**Fixes in spatial_query.py:**
- Restored BoundingBoxRequest validation that was commented out. The validator's
__post_init__ already handles both 1-D (single box) and 2-D (multi-box) arrays.
**Benchmark (benchmark_dataloader.py):**
Synthetic 2048x2048 image, 500 circle regions (32 px radius), 3-channel.
Phase main PR (fixed) speedup
init ~162 ms ~20 ms ~8x
fetch 500 ~618 ms ~118 ms ~5x
per-tile ~1237 us ~235 us ~5x
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* add asv benchmark for dataloader performance
---------
Co-authored-by: Luca Marconato <m.lucalmer@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Dataloader benchmarks live in `benchmarks/benchmark_dataloader.py`. They use a synthetic in-memory `SpatialData` (2048×2048 image, 500 circle regions) and compute two metrics:
0 commit comments