Skip to content

Commit

Permalink
Merge pull request numpy#25146 from rgommers/array-api-fixes
Browse files Browse the repository at this point in the history
BUG: fix issues with `newaxis` and `linalg.solve` in `numpy.array_api`
  • Loading branch information
seberg authored Nov 14, 2023
2 parents 34ab283 + 562d55f commit 0f61000
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion numpy/array_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@

__all__ = ["__array_api_version__"]

from ._constants import e, inf, nan, pi
from ._constants import e, inf, nan, pi, newaxis

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

Expand Down
1 change: 1 addition & 0 deletions numpy/array_api/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
inf = np.inf
nan = np.nan
pi = np.pi
newaxis = np.newaxis
6 changes: 3 additions & 3 deletions numpy/array_api/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,9 @@ def _solve(a, b):
# This does nothing currently but is left in because it will be relevant
# when complex dtype support is added to the spec in 2022.
signature = 'DD->D' if isComplexType(t) else 'dd->d'
with errstate(call=_raise_linalgerror_singular, invalid='call',
over='ignore', divide='ignore', under='ignore'):
r = gufunc(a, b, signature=signature, extobj=extobj)
with np.errstate(call=_raise_linalgerror_singular, invalid='call',
over='ignore', divide='ignore', under='ignore'):
r = gufunc(a, b, signature=signature)

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

Expand Down

0 comments on commit 0f61000

Please sign in to comment.