github numbagg/numbagg v0.9.5

5 hours ago

Behavior Changes

  • group_nanmean now promotes boolean and integer input to float64. It previously computed the mean in the input's integer dtype, so a group of [4, 5] gave 4 rather than 4.5 (#553)
  • The moving functions now raise ValueError for a min_count greater than window, which no window can satisfy, instead of returning an all-NaN array (#817)

Bug Fixes

  • Offset the covariance accumulators in nancorrmatrix and nancovmatrix (#759) and in the four moving matrix functions (#767), and accumulate in float64. On input far from zero the old form lost the result to cancellation: with standard-normal columns shifted by 1e8, move_covmatrix returned variances of -15 and move_corrmatrix values of 2.4. move_corrmatrix and move_exp_nancorrmatrix now also clip to [-1, 1], as np.corrcoef does
  • Fix two label-dtype overflows in the grouped functions: widening a labels array no longer picks an unsigned dtype, which turned the -1 "no group" label into a large positive one, and the num_labels default no longer overflows on a label at the dtype's maximum (#749)
  • Accept a tuple axis in the move_exp_* functions (#598)

Type Stubs

  • Add stubs for move_corrmatrix, move_covmatrix, move_exp_nancorrmatrix and move_exp_nancovmatrix (#810)
  • Annotate the matrix function returns in funcs.pyi (#812)
  • Widen the nanquantile and nanmedian return types to np.ndarray, since **kwargs reaches the gufunc and an out= or dtype= argument decides the result dtype (#815)
  • Accept a tuple axis in the moving-function stubs (#783)

Internal

  • move_corrmatrix and move_covmatrix move out of MOVE_FUNCS into a new MOVE_MATRIX_FUNCS list (#768)
  • Type checking moves from mypy to ty, and stubtest now checks the stubs against the runtime in CI (#472, #505, #748)
  • Various dependency updates

Full Changelog: v0.9.4...v0.9.5

Don't miss a new numbagg release

NewReleases is sending notifications on new releases.