Skip to content

Commit

Permalink
Update core.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Illviljan committed Aug 22, 2024
1 parent 674ef3f commit 38ad910
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions xarray/namedarray/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,9 @@ def __le__(self, other: int | float | NamedArray, /):
return less_equal(self, asarray(other))

def __lshift__(self, other: int | NamedArray, /):
from xarray.namedarray._array_api import bitwise_left_shift
from xarray.namedarray._array_api import bitwise_left_shift, asarray

return bitwise_left_shift(self)
return bitwise_left_shift(self, asarray(other))

def __lt__(self, other: int | float | NamedArray, /):
from xarray.namedarray._array_api import asarray, less
Expand Down Expand Up @@ -555,9 +555,9 @@ def __neg__(self, /):
return negative(self)

def __or__(self, other: int | bool | NamedArray, /):
from xarray.namedarray._array_api import bitwise_or
from xarray.namedarray._array_api import bitwise_or, asarray

return bitwise_or(self)
return bitwise_or(self, asarray(other))

def __pos__(self, /):
from xarray.namedarray._array_api import positive
Expand All @@ -570,9 +570,9 @@ def __pow__(self, other: int | float | NamedArray, /):
return pow(self, asarray(other))

def __rshift__(self, other: int | NamedArray, /):
from xarray.namedarray._array_api import bitwise_right_shift
from xarray.namedarray._array_api import bitwise_right_shift, asarray

return bitwise_right_shift(self)
return bitwise_right_shift(self, asarray(other))

def __setitem__(
self,
Expand All @@ -597,9 +597,9 @@ def __truediv__(self, other: float | NamedArray, /):
return divide(self, asarray(other))

def __xor__(self, other: int | bool | NamedArray, /):
from xarray.namedarray._array_api import bitwise_xor
from xarray.namedarray._array_api import bitwise_xor, asarray

return bitwise_xor(self)
return bitwise_xor(self, asarray(other))

def __iadd__(self, other: int | float | NamedArray, /):
from xarray.namedarray._array_api import asarray
Expand Down

0 comments on commit 38ad910

Please sign in to comment.