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
3 changes: 3 additions & 0 deletions arraycontext/impl/pytato/fake_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,7 @@ def amin(self, a, axis=None):
def absolute(self, a):
return self.abs(a)

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

return rec_multimap_array_container(pt.vdot, a, b)
# }}}
9 changes: 4 additions & 5 deletions test/test_arraycontext.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,10 @@ def evaluate(np_, *args_):

assert_close_to_numpy_in_containers(actx, evaluate, args)

if sym_name in ["where", "min", "max", "any", "all", "conj", "vdot", "sum"]:
pytest.skip(f"'{sym_name}' not supported on scalars")

args = [randn(0, dtype)[()] for i in range(n_args)]
assert_close_to_numpy(actx, evaluate, args)
if sym_name not in ["where", "min", "max", "any", "all", "conj", "vdot", "sum"]:
# Scalar arguments are supported.
args = [randn(0, dtype)[()] for i in range(n_args)]
assert_close_to_numpy(actx, evaluate, args)


@pytest.mark.parametrize(("sym_name", "n_args", "dtype"), [
Expand Down
4 changes: 2 additions & 2 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 Optional, cast
from typing import cast

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: Optional[np.ndarray] # noqa: UP007
y: np.ndarray | None

with pytest.raises(TypeError, match="Field 'y' union contains non-array"):
# NOTE: cannot have wrapped annotations (here by `Optional`)
Expand Down
Loading