pypi numpy-groupies 0.13.0

one hour ago

Highlights

  • Complex input: every implementation aggregates complex values, following numpy's rules — var/std/sumofsquares return a real dtype (squared magnitude), min/max/first/last order 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, first and last propagate 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_groupies no longer fails on numpy-less systems, aggregate_purepy (and the shared registry in aggregate_common) import nothing but the standard library

Improvements

  • Full type annotations across the package and a py.typed marker, 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.lock tracked; 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

Don't miss a new numpy-groupies release

NewReleases is sending notifications on new releases.