raise error if invalid axes dimensions
@@ -1049,9 +1049,10 @@ class Map(abc.ABC):
axes = [ax.copy() for ax in self.geom.axes]
geom = geom.copy(axes=axes)
axes_eq = True
+ elif geom.ndim != self.geom.ndim:
+ raise TypeError(f"Invalid axes in the target geom.")
else:
- axes_eq = geom.ndim == self.geom.ndim
- axes_eq &= np.all(
+ axes_eq = np.all(
[ax0 == ax1 for ax0, ax1 in zip(geom.axes, self.geom.axes)]
)
