Skip to content

Commit ccd8d7e

Browse files
committed
remove ufunc generator
1 parent f41d2de commit ccd8d7e

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

dascore/utils/array.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -180,35 +180,6 @@ def _apply_op_units(patch, other, operator, attrs, reversed=False):
180180
return new
181181

182182

183-
def generate_ufunc(np_ufunc: np.ufunc) -> Callable:
184-
"""
185-
Create a patch ufunc from a binary ufunc.
186-
187-
Parameters
188-
----------
189-
np_ufunc
190-
Any numpy u function.
191-
192-
Examples
193-
--------
194-
>>> import numpy as np
195-
>>> from dascore.utils.array import generate_ufunc
196-
>>> # Make a patch function from np add
197-
>>> ufunc = generate_ufunc(np.add)
198-
>>> # Now it can be used to operate on two patches
199-
>>> pat = ufunc(patch, patch)
200-
>>> # But can also be used to accumulate patches along dimensions.
201-
>>> # EG cumsum.
202-
>>> pat2 = ufunc.accumulate(patch, dim="time")
203-
>>> # Or to reduce dimensions (eg aggregate).
204-
>>> pat3 = ufunc.reduce(patch, dim="distance")
205-
206-
Notes
207-
-----
208-
- The entire ufunc interface is not yet implemented.
209-
"""
210-
211-
212183
def _get_new_coord(coord, dim_reduce="empty"):
213184
"""Get the new coordinate."""
214185

0 commit comments

Comments
 (0)