Skip to content

Commit

Permalink
Fix some functions that were missing ._array
Browse files Browse the repository at this point in the history
They were only working because we define __array__, which may be going away
(data-apis#67).
  • Loading branch information
asmeurer committed Oct 15, 2024
1 parent 019d935 commit ff126d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions array_api_strict/_elementwise_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def conj(x: Array, /) -> Array:
"""
if x.dtype not in _complex_floating_dtypes:
raise TypeError("Only complex floating-point dtypes are allowed in conj")
return Array._new(np.conj(x))
return Array._new(np.conj(x._array))

@requires_api_version('2023.12')
def copysign(x1: Array, x2: Array, /) -> Array:
Expand Down Expand Up @@ -480,7 +480,7 @@ def imag(x: Array, /) -> Array:
"""
if x.dtype not in _complex_floating_dtypes:
raise TypeError("Only complex floating-point dtypes are allowed in imag")
return Array._new(np.imag(x))
return Array._new(np.imag(x._array))


def isfinite(x: Array, /) -> Array:
Expand Down Expand Up @@ -755,7 +755,7 @@ def real(x: Array, /) -> Array:
"""
if x.dtype not in _complex_floating_dtypes:
raise TypeError("Only complex floating-point dtypes are allowed in real")
return Array._new(np.real(x))
return Array._new(np.real(x._array))


def remainder(x1: Array, x2: Array, /) -> Array:
Expand Down

0 comments on commit ff126d7

Please sign in to comment.