Skip to content

Releases: ml31415/numpy-groupies

0.13.2

Choose a tag to compare

@ml31415 ml31415 released this 14 Oct 00:51
139b556

This patch release collects four integer-accuracy fixes found while comparing the implementations against each other and against python integer references - grouped reductions on large int64/uint64 values now give the right answers on every backend.

Fixes

  • Numba argmin/argmax: the running extreme is kept in the input dtype instead of a float64 accumulator, so distinct int64/uint64 values above 2**53 are no longer merged before the comparison (#103)
  • NumPy sumofsquares: integer values are widened to the resolved output dtype before squaring, removing the premature input-dtype overflow (#104)
  • sum output dtype: the overflow guesses in the numpy and pandas implementations now use the number of values to be aggregated instead of the number of output groups - all values in a single group no longer silently wrap; the pure python implementation accumulates integral groups as python ints (#105)
  • NumPy nanargmin/nanargmax: the NaN replacement is skipped for integer inputs, which cannot contain NaNs, instead of promoting uint64 to float64 and merging distinct values (#106)

Thanks to @antonsoo for three of the four fixes and the thorough oracle-based validation behind them.

Full changelog: v0.13.1...v0.13.2

0.13.1

Choose a tag to compare

@ml31415 ml31415 released this 09 Oct 18:17
026e3a9

Improvements

  • Python 3.15 support (#102): 3.15 added to the CI test matrix and the trove classifiers, and the release workflow now builds and smoke-tests the artifacts on 3.15. Validated against the final CPython 3.15.0: the full test suite gives the same result as on 3.14, and numba 0.68 / pandas 3.0 / numpy 2.5 ship cp315 wheels. The Python versions badge picks this up automatically.

Development

  • DEFAULT_FILL_VALUE no longer carries pickle/deepcopy singleton support: nothing in the package pickles, the sentinel is always resolved inside an aggregate call, and multiprocessing workers import the module themselves — the singleton exists natively in every process.

Full changelog: v0.13.0...v0.13.1

0.13.0

Choose a tag to compare

@ml31415 ml31415 released this 09 Oct 17:00

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

v0.12.3

Choose a tag to compare

@ml31415 ml31415 released this 27 Sep 17:58

This release cuts the per-call Python overhead of the numba implementation and
adds an out= parameter for writing results into caller-provided buffers.

Faster calls

  • Jitted fast-path entry: for the common case of 1-d integer indices and
    1-d data, bounds check, output-size detection, buffer allocation and the
    aggregation kernel now run inside a single compiled call — Python-level
    validation and allocation are skipped entirely on this path.
  • Cheaper dispatch everywhere: all implementations resolve known function
    names through a single fused dispatch table, output dtype and fill-value
    plans are memoized across calls, and input validation relies on cheap
    attribute checks instead of the full dtype machinery.

New feature

  • out=: the numba aggregate (named functions) and uaggregate accept
    an output array of matching shape and dtype and gather the result into it
    with a jitted kernel — useful to avoid allocations in hot loops.

Full Changelog: v0.12.2...v0.12.3

v0.12.2

Choose a tag to compare

@ml31415 ml31415 released this 23 Sep 19:54

Full Changelog: v0.12.1...v0.12.2

v0.12.1

Choose a tag to compare

@ml31415 ml31415 released this 23 Sep 12:15

Full Changelog: v0.12.0...v0.12.1

v0.12.0

Choose a tag to compare

@ml31415 ml31415 released this 23 Sep 10:51

What's Changed

New Contributors

Full Changelog: v0.11.3...v0.12.0

v0.11.3

Choose a tag to compare

@ml31415 ml31415 released this 22 May 11:45
1dd8c3d

What's Changed

New Contributors

Full Changelog: v0.11.2...v0.11.3

v0.11.2

Choose a tag to compare

@dcherian dcherian released this 31 Jul 18:29
6c499ff

What's Changed

  • Improve precision for mean, std, var, cumsum. by @dcherian in #90

Full Changelog: v0.11.1...v0.11.2

v0.11.1

Choose a tag to compare

@ml31415 ml31415 released this 20 Apr 07:53

What's Changed

Full Changelog: v0.11.0...v0.11.1