From a21bc66ef563c4ec6c8c4c07d99bdc59f224063a Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 20 Dec 2024 11:56:05 -0600 Subject: [PATCH 1/2] Fix mypy error in pytato.loopy regarding get_dependencies arg --- pytato/loopy.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pytato/loopy.py b/pytato/loopy.py index de4c26506..bdf543887 100644 --- a/pytato/loopy.py +++ b/pytato/loopy.py @@ -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 @@ -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) From c8b6ce52682698c3d4c2719503c7b2e788ee41e4 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Fri, 20 Dec 2024 12:16:51 -0600 Subject: [PATCH 2/2] Enable type-ignore in array.py now that mypy 1.14 is released --- pytato/array.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pytato/array.py b/pytato/array.py index 064a98b4d..e42706613 100644 --- a/pytato/array.py +++ b/pytato/array.py @@ -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] # }}}