diff --git a/arraycontext/impl/pytato/__init__.py b/arraycontext/impl/pytato/__init__.py index 2a4b5be902bf2e859553a643daaba8a8682ac693..8565c6689125c75327b02b7b3fd454159277636e 100644 --- a/arraycontext/impl/pytato/__init__.py +++ b/arraycontext/impl/pytato/__init__.py @@ -134,18 +134,9 @@ class PytatoPyOpenCLArrayContext(ArrayContext): return LazilyCompilingFunctionCaller(self, f) def transform_loopy_program(self, t_unit): - from warnings import warn - warn( - "Using arraycontext.PytatoPyOpenCLArrayContext.transform_loopy_program " - "to transform a program. This is deprecated and will stop working " - "in 2022. Instead, subclass PytatoPyOpenCLArrayContext and implement " - "the specific logic required to transform the program for your " - "package or application. Check higher-level packages " - "(e.g. meshmode), which may already have subclasses you may want " - "to build on.", - DeprecationWarning, stacklevel=2) - - return t_unit + raise ValueError("PytatoPyOpenCLArrayContext does not implement " + "transform_loopy_program. Sub-classes are supposed " + "to implement it.") def tag(self, tags: Union[Sequence[Tag], Tag], array): return array.tagged(tags) diff --git a/test/test_arraycontext.py b/test/test_arraycontext.py index 094ee1346964b9dac1d6a46cabba0f7b071dae76..4f5a359e8f2c566ad30a3a84fc1ba47514cab283 100644 --- a/test/test_arraycontext.py +++ b/test/test_arraycontext.py @@ -33,6 +33,7 @@ from arraycontext import ( freeze, thaw, FirstAxisIsElementsTag, PyOpenCLArrayContext, + PytatoPyOpenCLArrayContext, ArrayContainer,) from arraycontext import ( # noqa: F401 pytest_generate_tests_for_array_contexts, @@ -56,6 +57,16 @@ class _PyOpenCLArrayContextForTests(PyOpenCLArrayContext): return t_unit +class _PytatoPyOpenCLArrayContextForTests(PytatoPyOpenCLArrayContext): + """Like :class:`PytatoPyOpenCLArrayContext`, but applies no program + transformations whatsoever. Only to be used for testing internal to + :mod:`arraycontext`. + """ + + def transform_loopy_program(self, t_unit): + return t_unit + + class _PyOpenCLArrayContextWithHostScalarsForTestsFactory( _PytestPyOpenCLArrayContextFactoryWithClass): actx_class = _PyOpenCLArrayContextForTests @@ -68,12 +79,7 @@ class _PyOpenCLArrayContextForTestsFactory( class _PytatoPyOpenCLArrayContextForTestsFactory( _PytestPytatoPyOpenCLArrayContextFactory): - """Like :class:`PytatoPyOpenCLArrayContext`, but applies no program transformations - whatsoever. Only to be used for testing internal to :mod:`arraycontext`. - """ - - def transform_loopy_program(self, t_unit): - return t_unit + actx_class = _PytatoPyOpenCLArrayContextForTests pytest_generate_tests = pytest_generate_tests_for_array_contexts([