Skip to content

Commit

Permalink
Merge pull request #9044 from rouault/numpy2_compat
Browse files Browse the repository at this point in the history
autotest: make it compatible with current numpy 2.0dev
  • Loading branch information
rouault authored Jan 11, 2024
2 parents f8270f8 + 27b063d commit c5534fd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions autotest/gcore/numpy_rw_multidim.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ def test_numpy_rw_multidim_numpy_array_as_dataset():
np.int32,
np.float32,
np.float64,
np.cfloat,
np.cdouble,
np.complex64,
np.complex128,
):
ar = np.array([[1, 2, 3], [4, 5, 6]], dtype=typ)
ds = gdal_array.OpenMultiDimensionalNumPyArray(ar)
Expand All @@ -123,7 +123,7 @@ def test_numpy_rw_multidim_numpy_array_as_dataset():
assert myarray
assert np.array_equal(myarray.ReadAsArray(), ar)

ar = np.array([[1, 2, 3], [4, 5, 6]], dtype=np.unicode_)
ar = np.array([[1, 2, 3], [4, 5, 6]], dtype=np.str_)
with pytest.raises(
Exception, match="Unable to access numpy arrays of typecode `U'"
):
Expand Down Expand Up @@ -190,8 +190,8 @@ def test_numpy_rw_multidim_numpy_array_as_dataset_negative_strides():
np.int32,
np.float32,
np.float64,
np.cfloat,
np.cdouble,
np.complex64,
np.complex128,
):
ar = np.array([[1, 2, 3], [4, 5, 6]], dtype=typ)
ar = ar[::-1, ::-1] # Test negative strides
Expand Down

0 comments on commit c5534fd

Please sign in to comment.