From d1b03a129593d8b9053af4c8580f0b2aa9ef9959 Mon Sep 17 00:00:00 2001 From: "[6~" Date: Mon, 18 Nov 2019 18:01:20 -0600 Subject: [PATCH] Fix some pymbolic/loopy usage deprecations --- grudge/symbolic/compiler.py | 2 +- grudge/symbolic/primitives.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/grudge/symbolic/compiler.py b/grudge/symbolic/compiler.py index 3aac28bb..e425fa49 100644 --- a/grudge/symbolic/compiler.py +++ b/grudge/symbolic/compiler.py @@ -1018,7 +1018,7 @@ class ToLoopyInstructionMapper(object): lp.Assignment( expr_mapper(var(name)), expr_mapper(expr), - temp_var_type=lp.auto if dnr else None, + temp_var_type=lp.Optional(None) if dnr else lp.Optional(), no_sync_with=frozenset([ ("*", "any"), ]), diff --git a/grudge/symbolic/primitives.py b/grudge/symbolic/primitives.py index 63adf3db..0b9fac20 100644 --- a/grudge/symbolic/primitives.py +++ b/grudge/symbolic/primitives.py @@ -40,9 +40,9 @@ from pytools.obj_array import join_fields, make_obj_array # noqa class ExpressionBase(pymbolic.primitives.Expression): - def stringifier(self): + def make_stringifier(self, originating_stringifier=None): from grudge.symbolic.mappers import StringifyMapper - return StringifyMapper + return StringifyMapper() def _sym(): @@ -658,6 +658,10 @@ class TracePair: self.exterior[index], self.interior[index]) + def __len__(self): + assert len(self.exterior) == len(self.interior) + return len(self.exterior) + @property def int(self): return self.interior -- GitLab