Function np.any has no reduce function: back to the initial code and make a cast
@@ -1211,11 +1211,8 @@ class Map(abc.ABC):
map_out : `~Map`
Map with non-spatial axes summed over
"""
- mfunc = np.add
- if self.data.dtype is np.dtype(bool):
- mfunc = np.any
return self.reduce_over_axes(
- func=mfunc, axes_names=axes_names, keepdims=keepdims, weights=weights
+ func=np.add, axes_names=axes_names, keepdims=keepdims, weights=weights
)
def reduce_over_axes(
@@ -1249,7 +1246,6 @@ class Map(abc.ABC):
map_out = map_out.reduce(
axis_name, func=func, keepdims=keepdims, weights=weights
)
- map_out.data = map_out.data.astype(self.data.dtype)
return map_out
