Repository navigation
Releases: ml31415/numpy-groupies
Releases · ml31415/numpy-groupies
Release list
0.13.2
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
Improvements
- Python 3.15 support (#102):
3.15added 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_VALUEno longer carries pickle/deepcopy singleton support: nothing in the package pickles, the sentinel is always resolved inside anaggregatecall, 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
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
v0.12.3
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 numbaaggregate(named functions) anduaggregateaccept
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
v0.12.1
v0.12.0
v0.11.3
What's Changed
- Fix compatibility with 32bt architectures by @avalentino in #94
New Contributors
- @avalentino made their first contribution in #94
Full Changelog: v0.11.2...v0.11.3