From 4ca0734a845f8c4d8ed63220e7ac59a58ffd00c7 Mon Sep 17 00:00:00 2001
From: Kaushik Kulkarni <kaushikcfd@gmail.com>
Date: Mon, 28 Jun 2021 14:39:02 -0500
Subject: [PATCH] PytatoPyOpenCLArrayContext: do not implement
 transform_loopy_program

---
 arraycontext/impl/pytato/__init__.py | 15 +++------------
 test/test_arraycontext.py            | 18 ++++++++++++------
 2 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/arraycontext/impl/pytato/__init__.py b/arraycontext/impl/pytato/__init__.py
index 2a4b5be..8565c66 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 094ee13..4f5a359 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([
-- 
GitLab