Skip to content

Commit

Permalink
add __array__ method to APRSlicer
Browse files Browse the repository at this point in the history
  • Loading branch information
joeljonsson committed Nov 6, 2023
1 parent 12a7c84 commit 9ce0fde
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyapr/reconstruction/APRSlicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ def shape(self):
def ndim(self):
return 3

def __array__(self):
# allows things like np.max(APRSlicer)
return np.array(self.parts)

def astype(self, typespec):
parts = type(type_to_particles(typespec))(np.array(self.parts).astype(typespec))
dtype = typespec
Expand Down

0 comments on commit 9ce0fde

Please sign in to comment.