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
2 changes: 1 addition & 1 deletion arraycontext/impl/pytato/fake_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,6 @@ def absolute(self, a):
return self.abs(a)

def vdot(self, a: Array, b: Array):

return rec_multimap_array_container(pt.vdot, a, b)

# }}}
7 changes: 4 additions & 3 deletions test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
THE SOFTWARE.
"""
import logging
from typing import cast
from typing import Optional, Tuple, cast # noqa: UP035

import numpy as np
import pytest
Expand Down Expand Up @@ -63,7 +63,7 @@ def test_dataclass_array_container() -> None:
class ArrayContainerWithOptional:
x: np.ndarray
# Deliberately left as Optional to test compatibility.
y: np.ndarray | None
y: Optional[np.ndarray] # noqa: UP045

with pytest.raises(TypeError, match="Field 'y' union contains non-array"):
# NOTE: cannot have wrapped annotations (here by `Optional`)
Expand All @@ -76,7 +76,8 @@ class ArrayContainerWithOptional:
@dataclass
class ArrayContainerWithTuple:
x: Array
y: tuple[Array, Array]
# Deliberately left as Tuple to test compatibility.
y: Tuple[Array, Array] # noqa: UP006

with pytest.raises(TypeError, match="Typing annotation not supported on field 'y'"):
dataclass_array_container(ArrayContainerWithTuple)
Expand Down
Loading