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
Fixes#190: GPU-enable all classification operations (#852)
* GPU-enable all classification ops: equal_interval, quantile, natural_breaks now support all 4 backends (#190)
- Add Dask+CuPy backend for equal_interval via _run_dask_cupy_equal_interval
- Replace quantile Dask+CuPy NotImplementedError with working implementation that materializes data to CPU for percentile computation
- Add CuPy, Dask+NumPy, and Dask+CuPy backends for natural_breaks by extracting shared _compute_natural_break_bins helper
- Add 7 new tests covering all new backend combinations
- Update README feature matrix to reflect full backend support
* fix OOM in dask classification backends for large datasets
- quantile dask+cupy: replace full materialization with map_blocks(cupy.asnumpy)
to convert chunks to CPU one at a time, then delegate to dask's streaming
approximate percentile
- natural_breaks dask backends: sample lazily from the dask array and only
materialize the sample (default 20k points), not the entire dataset.
Add _generate_sample_indices helper that uses O(num_sample) memory via
RandomState.choice() for large datasets, falling back to the original
linspace+shuffle for small datasets to preserve determinism with numpy
* optimize classification ops: reduce memory allocations and dask passes
- Remove unnecessary .ravel() in _run_equal_interval; nanmin/nanmax work on 2D
- Combine double where(±inf) into single isinf pass in _run_equal_interval
and _run_cupy_bin, halving temporary allocations
- Use dask.compute(min, max) instead of two separate .compute() calls so
dask reads data once instead of twice
- Build cuts as numpy array for all backends (was needlessly dask for k elements)
- Replace boolean fancy indexing in dask natural_break functions with
da.where + da.nanmax to preserve chunk structure
- Delete _run_dask_cupy_equal_interval; unified _run_equal_interval with
module=da handles both dask+numpy and dask+cupy
* add 14 new classify tests: mutation safety, edge cases, cross-backend consistency
- Missing backend: natural_breaks dask+cupy num_sample
- Input mutation: verify all 5 functions don't modify input DataArray
- Untested path: natural_breaks with num_sample=None
- Edge cases: equal_interval k=1, all-NaN input for equal_interval and
natural_breaks
- Name parameter: verify default and custom name on all 5 functions
- Cross-backend: verify natural_breaks cupy and dask match numpy results
on a separate 10x10 dataset
* added a few more classify methods and experimental geodesic slope and aspect
* added supported geodesic helpers and test
* add description column to README feature matrix tables
* fix non-deterministic maximum_breaks when gaps are equal
Replace np.argpartition with np.argsort(kind='stable') so that
tied gap sizes are broken by index order, consistently selecting
the highest-value gaps.
|[Atmospherically Resistant Vegetation Index (ARVI)](xrspatial/multispectral.py)|Vegetation index resistant to atmospheric effects using blue band correction |✅️ |✅️ | ✅️ |✅️ |
168
+
|[Enhanced Built-Up and Bareness Index (EBBI)](xrspatial/multispectral.py)|Highlights built-up areas and barren land from thermal and SWIR bands |✅️ |✅️ | ✅️ |✅️ |
169
+
|[Enhanced Vegetation Index (EVI)](xrspatial/multispectral.py)|Enhanced vegetation index reducing soil and atmospheric noise |✅️ |✅️ | ✅️ |✅️ |
170
+
|[Green Chlorophyll Index (GCI)](xrspatial/multispectral.py)|Estimates leaf chlorophyll content from green and NIR reflectance |✅️ |✅️ | ✅️ |✅️ |
171
+
|[Normalized Burn Ratio (NBR)](xrspatial/multispectral.py)|Measures burn severity using NIR and SWIR band difference |✅️ |✅️ | ✅️ |✅️ |
172
+
|[Normalized Burn Ratio 2 (NBR2)](xrspatial/multispectral.py)|Refines burn severity mapping using two SWIR bands |✅️ |✅️ | ✅️ |✅️ |
173
+
|[Normalized Difference Moisture Index (NDMI)](xrspatial/multispectral.py)|Detects vegetation moisture stress from NIR and SWIR reflectance |✅️ |✅️ | ✅️ |✅️ |
174
+
|[Normalized Difference Vegetation Index (NDVI)](xrspatial/multispectral.py)|Quantifies vegetation density from red and NIR band difference |✅️ |✅️ | ✅️ |✅️ |
175
+
|[Soil Adjusted Vegetation Index (SAVI)](xrspatial/multispectral.py)|Vegetation index with soil brightness correction factor |✅️ |✅️ | ✅️ |✅️ |
176
+
|[Structure Insensitive Pigment Index (SIPI)](xrspatial/multispectral.py)|Estimates carotenoid-to-chlorophyll ratio for plant stress detection |✅️ |✅️ | ✅️ |✅️ |
177
+
|[True Color](xrspatial/multispectral.py)|Composites red, green, and blue bands into a natural color image |✅️ | ️ | ✅️ | ️ |
0 commit comments