Skip to content

Commit

Permalink
mypy: fix errors from numpy 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl authored and inducer committed Dec 13, 2024
1 parent a5eaebe commit c4f00b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion arraycontext/container/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,8 @@ def _deserialize_ndarray_container( # type: ignore[misc]

result = type(template)(template.shape, dtype=object)
for i, subary in serialized:
result[i] = subary
# FIXME: numpy annotations don't seem to handle object arrays very well
result[i] = subary # type: ignore[call-overload]

return result

Expand Down
2 changes: 1 addition & 1 deletion arraycontext/loopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def get(c_name, nargs, naxes):
from arraycontext.transform_metadata import ElementwiseMapKernelTag

def sub(name: str) -> Variable | Subscript:
return Variable(name)[subscript] if subscript else Variable(name)
return Subscript(Variable(name), subscript) if subscript else Variable(name)

return make_loopy_program(
[domain_bset], [
Expand Down

0 comments on commit c4f00b8

Please sign in to comment.