Skip to content

spectral-library 0.3.0

Released 2026-04-04.

Highlights

  • Rust-accelerated batch mapping via a PyO3/Rayon native extension for spectrum reconstruction, target-sensor projection, segment merging, and neighbor refinement
  • LinearSpectralMapper for fixed input @ weights + bias high-throughput mapping without per-sample KNN retrieval
  • Dense batch vectorization across the full segment retrieval, reconstruction, and projection pipeline
  • Cross-platform compiled wheels (Linux x86_64/aarch64, macOS x86_64/arm64, Windows AMD64) built via cibuildwheel

What Changed

New Public API

Symbol Purpose
LinearSpectralMapper Compiled linear mapper for million-pixel throughput
BatchMappingArrayResult Dense result type for array-oriented batch mapping
SpectralMapper.compile_linear_mapper() Compile a prepared runtime into a reusable linear mapper
SpectralMapper.map_reflectance_debug() Single-sample mapping with full diagnostic payload
SpectralMapper.map_reflectance_batch_debug() Batch mapping returning rich MappingResult objects
SpectralMapper.map_reflectance_batch_arrays() Explicit dense batch path returning BatchMappingArrayResult
SpectralMapper.map_reflectance_batch_ndarray() Direct ndarray input batch mapping
SpectralMapper.map_reflectance_batch_to_zarr() Stream large batch results to Zarr stores

Slim vs Debug Paths

map_reflectance() and map_reflectance_batch() now default to slim result paths that skip neighbor ids, per-segment diagnostics, and review payloads. Use the _debug() variants when you need the full payload.

CLI Additions

  • --output-format zarr and --output-chunk-size flags for streaming batch output

Build and Distribution

  • Wheels now include a compiled Rust extension for all major platforms
  • cibuildwheel builds in the release workflow replace pure-Python wheel builds
  • Package checks CI installs the Rust toolchain for editable-install tests

Full Changelog

See CHANGELOG.md for the complete list of additions, changes, and fixes.