Skip to content

Commit

Permalink
Use npg sum_of_squares
Browse files Browse the repository at this point in the history
Closes #107
  • Loading branch information
dcherian committed Aug 16, 2022
1 parent e405517 commit 310797c
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ci/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- pip
- xarray
- numpydoc
- numpy_groupies
- numpy_groupies>=0.9.19
- toolz
- matplotlib-base
- myst-parser
Expand Down
2 changes: 1 addition & 1 deletion ci/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:
- pytest-xdist
- xarray
- pre-commit
- numpy_groupies>=0.9.15
- numpy_groupies>=0.9.19
- pooch
- toolz
- numba
2 changes: 1 addition & 1 deletion ci/minimal-requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
- pytest
- pytest-cov
- pytest-xdist
- numpy_groupies>=0.9.15
- numpy_groupies==0.9.19
- pandas
- pooch
- toolz
2 changes: 1 addition & 1 deletion ci/no-dask.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
- xarray
- numpydoc
- pre-commit
- numpy_groupies>=0.9.15
- numpy_groupies>=0.9.19
- pooch
- toolz
- numba
2 changes: 1 addition & 1 deletion ci/no-xarray.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
- dask-core
- numpydoc
- pre-commit
- numpy_groupies>=0.9.15
- numpy_groupies>=0.9.19
- pooch
- toolz
- numba
14 changes: 11 additions & 3 deletions flox/aggregate_npg.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,20 @@ def _get_aggregate(engine):


def sum_of_squares(
group_idx, array, engine, *, axis=-1, func="sum", size=None, fill_value=None, dtype=None
group_idx,
array,
engine,
*,
axis=-1,
func="sumofsquares",
size=None,
fill_value=None,
dtype=None,
):

return _get_aggregate(engine).aggregate(
group_idx,
array**2,
array,
axis=axis,
func=func,
size=size,
Expand Down Expand Up @@ -60,7 +68,7 @@ def nansum_of_squares(group_idx, array, engine, *, axis=-1, size=None, fill_valu
group_idx,
array,
engine=engine,
func="nansum",
func="nansumofsquares",
size=size,
fill_value=fill_value,
axis=axis,
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ include_package_data = True
python_requires = >=3.8
install_requires =
pandas
numpy_groupies >= '0.9.15'
numpy_groupies >= '0.9.19'
toolz

[options.extras_require]
Expand Down

0 comments on commit 310797c

Please sign in to comment.