Skip to content

Commit 136bdd7

Browse files
committed
BUG: fix issues with newaxis and linalg.solve in numpy.array_api
[skip azp] [skip cirrus] [skip circle] Original NumPy Commit: 562d55fe7b6b6e03d7fd776392f56fb992a2bafd
1 parent 35fbef9 commit 136bdd7

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

array_api_strict/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125

126126
__all__ = ["__array_api_version__"]
127127

128-
from ._constants import e, inf, nan, pi
128+
from ._constants import e, inf, nan, pi, newaxis
129129

130130
__all__ += ["e", "inf", "nan", "pi"]
131131

array_api_strict/_constants.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
inf = np.inf
55
nan = np.nan
66
pi = np.pi
7+
newaxis = np.newaxis

array_api_strict/linalg.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@ def _solve(a, b):
318318
# This does nothing currently but is left in because it will be relevant
319319
# when complex dtype support is added to the spec in 2022.
320320
signature = 'DD->D' if isComplexType(t) else 'dd->d'
321-
with errstate(call=_raise_linalgerror_singular, invalid='call',
322-
over='ignore', divide='ignore', under='ignore'):
323-
r = gufunc(a, b, signature=signature, extobj=extobj)
321+
with np.errstate(call=_raise_linalgerror_singular, invalid='call',
322+
over='ignore', divide='ignore', under='ignore'):
323+
r = gufunc(a, b, signature=signature)
324324

325325
return wrap(r.astype(result_t, copy=False))
326326

0 commit comments

Comments
 (0)