Skip to content

Commit

Permalink
support mean, sum and variance in array_functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche committed May 24, 2024
1 parent d5fb9e8 commit 632a246
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/delayedarray/DelayedArray.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,15 @@ def __array_function__(self, func, types, args, kwargs) -> "DelayedArray":
decimals = 0
return DelayedArray(Round(seed, decimals=decimals))

if func == numpy.mean:
return self.mean(**kwargs)

if func == numpy.sum:
return self.sum(**kwargs)

if func == numpy.var:
return self.var(**kwargs)

if func == numpy.shape:
return self.shape

Expand Down

0 comments on commit 632a246

Please sign in to comment.