Skip to content

Commit

Permalink
Type-ignore ndarray assignments for numpy 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Dec 10, 2024
1 parent c21f7ea commit 4f1ec21
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pymbolic/mapper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ def map_numpy_array(self,
import numpy
result = numpy.empty(expr.shape, dtype=object)
for i in numpy.ndindex(expr.shape):
result[i] = self.rec(expr[i], *args, **kwargs)
result[i] = self.rec(expr[i], *args, **kwargs) # type: ignore[assignment]

# True fact: ndarrays aren't expressions
return result # type: ignore[return-value]
Expand Down
2 changes: 1 addition & 1 deletion pymbolic/mapper/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def map_numpy_array(self, expr: np.ndarray) -> ResultT:
import numpy
result = numpy.empty(expr.shape, dtype=object)
for i in numpy.ndindex(expr.shape):
result[i] = self.rec(expr[i])
result[i] = self.rec(expr[i]) # type: ignore[call-overload]
return result # type: ignore[return-value]

def map_multivector(self, expr: MultiVector) -> ResultT:
Expand Down

0 comments on commit 4f1ec21

Please sign in to comment.