Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mypy error in pytato.loopy regarding get_dependencies arg #571

Merged
merged 2 commits into from
Dec 20, 2024
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: 1 addition & 2 deletions pytato/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,7 @@ def _binary_op(

if not isinstance(other, (Array, *SCALAR_CLASSES)):
# https://github.com/python/mypy/issues/4791
# This type-ignore will become necessary with mypy 1.14.
return NotImplemented # not-yet-type: ignore[no-any-return]
return NotImplemented # type: ignore[no-any-return]

# }}}

Expand Down
6 changes: 4 additions & 2 deletions pytato/loopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ def extend_bindings_with_shape_inference(knl: lp.LoopKernel,
from loopy.kernel.array import ArrayBase
from loopy.symbolic import get_dependencies as lpy_get_deps
from pymbolic.mapper.substitutor import make_subst_func
from pymbolic.primitives import is_expression

from pytato.transform import SizeParamGatherer

Expand All @@ -426,8 +427,9 @@ def extend_bindings_with_shape_inference(knl: lp.LoopKernel,
lp_size_params: frozenset[str] = reduce(frozenset.union,
(lpy_get_deps(not_none(arg.shape))
for arg in knl.args
if isinstance(arg, ArrayBase)),
frozenset())
if isinstance(arg, ArrayBase)
and is_expression(arg.shape)
), frozenset())

pt_size_params: frozenset[SizeParam] = reduce(frozenset.union,
(get_size_param_deps(bnd)
Expand Down
Loading