Replace np.asanyarray with np.array to avoid problems when ArrayWithUnit is input.