Highlights
- Complex input: every implementation aggregates complex values, following numpy's rules —
var/std/sumofsquaresreturn a real dtype (squared magnitude),min/max/first/lastorder by real part with the imaginary part breaking ties, and requesting a non-complex output dtype is refused where the imaginary part would be lost (#98) - NaN semantics aligned with numpy:
min,max,firstandlastpropagate NaN, and a group of nothing but NaNs takes the fill value instead of crashing the kernels (#100) - median of an even-sized group averages the two middle values in float64, matching numpy also for narrow integer dtypes (#99)
- The pure python implementation works without numpy: importing
numpy_groupiesno longer fails on numpy-less systems,aggregate_purepy(and the shared registry inaggregate_common) import nothing but the standard library
Improvements
- Full type annotations across the package and a
py.typedmarker, so downstream type checkers see the signatures - Documentation rewrite: a slimmer README, the function reference and benchmarks moved to
docs/, the helper functions (uaggregate,unpack,step_count,multi_arange,label_contiguous_1d,relabel_groups_*,default_fill_value, …) are now documented in the reference
Development
uv.locktracked; pre-commit runs ruff, ruff-format, rumdl (markdown) and codespell — also in CI on every push- The package type checks cleanly under mypy
Full changelog: v0.12.3...v0.13.0