35 '''This module contains an abstract parent class for adjoint
55 '''An abstract class for Adjoint transformations. Requires a list of
56 active variables to be passed when creating an instance of the
57 class. Also supports an optional writer argument.
59 :param active_variables: a list of names of the active variables.
60 :type active_variables: list of \
61 :py:class:`psyclone.psyir.symbols.DataSymbol`
63 :raises TypeError: if the active_variables are of the wrong type.
66 def __init__(self, active_variables):
67 super(AdjointTransformation, self).__init__()
69 if not isinstance(active_variables, list):
71 f
"The active variables argument should be a list, but found "
72 f
"'{type(active_variables).__name__}'.")
74 if not active_variables:
75 raise TypeError(
"There should be at least one active variable.")
77 for active_variable
in active_variables:
78 if not isinstance(active_variable, DataSymbol):
80 f
"Active variables should be of type DataSymbol, but "
81 f
"found '{type(active_variable).__name__}'.")
90 __all__ = [
"AdjointTransformation"]