Skip to content

Commit 8117a4b

Browse files
committed
MAINT: NumPy normalize_axis_tuple
* this function moved from NumPy core to the public API in recent NumPy builds, and is causing SciPy CI failures here: https://github.com/scipy/scipy/actions/runs/6555137521/job/17803175138?pr=19402 * normally I'd use PEP440 for this (either vendored or through the appropriate PyPA lib) but maybe you'd prefer to cheat like this on major version vs. more infrastructure?
1 parent 5c82ea3 commit 8117a4b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

array_api_compat/common/_linalg.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
from typing import Literal, Optional, Sequence, Tuple, Union
66
from ._typing import ndarray
77

8-
from numpy.core.numeric import normalize_axis_tuple
8+
import numpy as np
9+
if np.__version__[0] == "2":
10+
from numpy.lib.array_utils import normalize_axis_tuple
11+
else:
12+
from numpy.core.numeric import normalize_axis_tuple
913

1014
from ._aliases import matmul, matrix_transpose, tensordot, vecdot
1115
from .._internal import get_xp

0 commit comments

Comments
 (0)