Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autotest: make it compatible with current numpy 2.0dev #9044

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading