Skip to content

Commit 6d8abc9

Browse files
committed
cleanup astype method
1 parent d0e3c7b commit 6d8abc9

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pyapr/reconstruction/APRSlicer.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,7 @@ def __array__(self):
7373

7474
def astype(self, typespec):
7575
parts = type(type_to_particles(typespec))(np.array(self.parts).astype(typespec))
76-
dtype = typespec
77-
# self._slice = self._slice.astype(typespec)
78-
# self.tree_mode
79-
return APRSlicer(self.apr, parts, mode=self.mode, level_delta=self.patch.level_delta, tree_mode='max' if typespec is int else 'mean')
76+
return APRSlicer(self.apr, parts, mode=self.mode, level_delta=self.patch.level_delta, tree_mode='max' if typespec in [int, np.int32, 'int', 'int32'] else 'mean')
8077

8178
def new_empty_slice(self):
8279
return np.zeros((self.patch.z_end-self.patch.z_begin,

0 commit comments

Comments
 (0)