Skip to content

Commit ebe7df4

Browse files
ConchylicultorThe dataclass_array Authors
authored andcommitted
Fix numpy 2 errors
PiperOrigin-RevId: 665992136
1 parent 726f13e commit ebe7df4

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

dataclass_array/array_dataclass_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,13 +520,13 @@ def test_absolute_axis(xnp: enp.NpModule):
520520
assert p._to_absolute_axis((0, 1, -1)) == (0, 1, 3)
521521
assert p._to_absolute_axis((-1, -2)) == (3, 2)
522522

523-
with pytest.raises(np.AxisError):
523+
with pytest.raises(np.exceptions.AxisError):
524524
assert p._to_absolute_axis(4)
525525

526-
with pytest.raises(np.AxisError):
526+
with pytest.raises(np.exceptions.AxisError):
527527
assert p._to_absolute_axis(-5)
528528

529-
with pytest.raises(np.AxisError):
529+
with pytest.raises(np.exceptions.AxisError):
530530
assert p._to_absolute_axis((0, 4))
531531

532532

dataclass_array/utils/np_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def to_absolute_axis(axis: Axes, *, ndim: int) -> Axes:
157157
return tuple(range(ndim))
158158
elif isinstance(axis, int):
159159
if axis >= ndim or axis < -ndim:
160-
raise enp.lazy.np.AxisError(
160+
raise enp.lazy.np.exceptions.AxisError(
161161
axis=axis,
162162
ndim=ndim,
163163
# msg_prefix=

dataclass_array/utils/np_utils_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ def test_to_absolute_axis():
5555
assert np_utils.to_absolute_axis((0, 1, -1), ndim=4) == (0, 1, 3)
5656
assert np_utils.to_absolute_axis((-1, -2), ndim=4) == (3, 2)
5757

58-
with pytest.raises(np.AxisError):
58+
with pytest.raises(np.exceptions.AxisError):
5959
assert np_utils.to_absolute_axis(4, ndim=4)
6060

61-
with pytest.raises(np.AxisError):
61+
with pytest.raises(np.exceptions.AxisError):
6262
assert np_utils.to_absolute_axis(-5, ndim=4)
6363

64-
with pytest.raises(np.AxisError):
64+
with pytest.raises(np.exceptions.AxisError):
6565
assert np_utils.to_absolute_axis((0, 4), ndim=4)
6666

6767

0 commit comments

Comments
 (0)