Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 17, 2024
1 parent d8a955f commit 0856ccb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 4 additions & 2 deletions xarray/namedarray/_array_api/_elementwise_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ def hypot(


def imag(
x: NamedArray[_ShapeType, np.dtype[_SupportsImag[_ScalarType]]], / # type: ignore[type-var]
x: NamedArray[_ShapeType, np.dtype[_SupportsImag[_ScalarType]]],
/, # type: ignore[type-var]
) -> NamedArray[_ShapeType, np.dtype[_ScalarType]]:
"""
Returns the imaginary component of a complex number for each element x_i of the
Expand Down Expand Up @@ -483,7 +484,8 @@ def pow(x1: NamedArray[Any, Any], x2: NamedArray[Any, Any], /) -> NamedArray[Any


def real(
x: NamedArray[_ShapeType, np.dtype[_SupportsReal[_ScalarType]]], / # type: ignore[type-var]
x: NamedArray[_ShapeType, np.dtype[_SupportsReal[_ScalarType]]],
/, # type: ignore[type-var]
) -> NamedArray[_ShapeType, np.dtype[_ScalarType]]:
"""
Returns the real component of a complex number for each element x_i of the
Expand Down
2 changes: 1 addition & 1 deletion xarray/namedarray/_array_api/_manipulation_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ def _broadcast_arrays(*arrays: NamedArray[Any, Any]) -> NamedArray[Any, Any]:


def _broadcast_arrays_with_minimal_size(
*arrays: NamedArray[Any, Any]
*arrays: NamedArray[Any, Any],
) -> NamedArray[Any, Any]:
"""
Given any number of variables, return variables with matching dimensions.
Expand Down
4 changes: 0 additions & 4 deletions xarray/namedarray/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,6 @@ def __setitem__(
value: int | float | bool | NamedArray,
/,
) -> None:

if isinstance(key, NamedArray):
key = key._data
self._data.__setitem__(key, self._maybe_asarray(value)._data)
Expand Down Expand Up @@ -708,7 +707,6 @@ def __radd__(self, other: int | float | NamedArray, /):
return add(self._maybe_asarray(other), self)

def __iand__(self, other: int | bool | NamedArray, /):

self._data &= self._maybe_asarray(other)._data
return self

Expand Down Expand Up @@ -791,7 +789,6 @@ def __rrshift__(self, other: int | NamedArray, /):
return bitwise_right_shift(self._maybe_asarray(other), self)

def __isub__(self, other: int | float | NamedArray, /):

self._data -= self._maybe_asarray(other)._data
return self

Expand All @@ -810,7 +807,6 @@ def __rtruediv__(self, other: float | NamedArray, /):
return divide(self._maybe_asarray(other), self)

def __ixor__(self, other: int | bool | NamedArray, /):

self._data ^= self._maybe_asarray(other)._data
return self

Expand Down

0 comments on commit 0856ccb

Please sign in to comment.