Open aulemahal opened 2 days ago
Fixes #315
ESMpy has stored its grid sizes in int32 forever, but before numpy 2 our get_shape function was returning normal ints while it now returns np.int32 scalars with numpy 2.0.
int32
get_shape
np.int32
The reason is that tuple(np.array([1, 1], dtype=np.int32)) changed behaviour in numpy 2, preserving the dtype of the individual elements in the tuple, while it previously implicitly casted them with python's scalar. See https://numpy.org/doc/stable/numpy_2_0_migration_guide.html#changes-to-numpy-data-type-promotion
tuple(np.array([1, 1], dtype=np.int32))
Fixes #315
ESMpy has stored its grid sizes in
int32
forever, but before numpy 2 ourget_shape
function was returning normal ints while it now returnsnp.int32
scalars with numpy 2.0.The reason is that
tuple(np.array([1, 1], dtype=np.int32))
changed behaviour in numpy 2, preserving the dtype of the individual elements in the tuple, while it previously implicitly casted them with python's scalar. See https://numpy.org/doc/stable/numpy_2_0_migration_guide.html#changes-to-numpy-data-type-promotion