Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 20 additions & 5 deletions src/array_api_extra/_lib/_at.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def add(
# Note for this and all other methods based on _iop:
# operator.iadd and operator.add subtly differ in behaviour, as
# only iadd will trigger exceptions when y has an incompatible dtype.
return self._op(_AtOp.ADD, operator.iadd, operator.add, y, copy=copy, xp=xp)
return self._op(_AtOp.ADD, operator.iadd, operator.add, y, copy=copy, xp=xp) # pyright: ignore[reportUnknownArgumentType]

def subtract(
self,
Expand All @@ -392,7 +392,12 @@ def subtract(
) -> Array: # numpydoc ignore=PR01,RT01
"""Apply ``x[idx] -= y`` and return the updated array."""
return self._op(
_AtOp.SUBTRACT, operator.isub, operator.sub, y, copy=copy, xp=xp
_AtOp.SUBTRACT,
operator.isub, # pyright: ignore[reportUnknownArgumentType]
operator.sub,
y,
copy=copy,
xp=xp,
)

def multiply(
Expand All @@ -404,7 +409,12 @@ def multiply(
) -> Array: # numpydoc ignore=PR01,RT01
"""Apply ``x[idx] *= y`` and return the updated array."""
return self._op(
_AtOp.MULTIPLY, operator.imul, operator.mul, y, copy=copy, xp=xp
_AtOp.MULTIPLY,
operator.imul, # pyright: ignore[reportUnknownArgumentType]
operator.mul,
y,
copy=copy,
xp=xp,
)

def divide(
Expand All @@ -416,7 +426,12 @@ def divide(
) -> Array: # numpydoc ignore=PR01,RT01
"""Apply ``x[idx] /= y`` and return the updated array."""
return self._op(
_AtOp.DIVIDE, operator.itruediv, operator.truediv, y, copy=copy, xp=xp
_AtOp.DIVIDE,
operator.itruediv, # pyright: ignore[reportUnknownArgumentType]
operator.truediv, # pyright: ignore[reportUnknownArgumentType]
y,
copy=copy,
xp=xp,
)

def power(
Expand All @@ -427,7 +442,7 @@ def power(
xp: ModuleType | None = None,
) -> Array: # numpydoc ignore=PR01,RT01
"""Apply ``x[idx] **= y`` and return the updated array."""
return self._op(_AtOp.POWER, operator.ipow, operator.pow, y, copy=copy, xp=xp)
return self._op(_AtOp.POWER, operator.ipow, operator.pow, y, copy=copy, xp=xp) # pyright: ignore[reportUnknownArgumentType]

def min(
self,
Expand Down