Source code for yggdrasil.communication.transforms.DirectTransform

from yggdrasil.communication.transforms.TransformBase import TransformBase


[docs]class DirectTransform(TransformBase): r"""Base class for message transforms.""" _transformtype = 'direct' _schema_subtype_description = "Pass the message through unchanged"
[docs] def evaluate_transform(self, x, no_copy=False): r"""Call transform on the provided message. Args: x (object): Message object to transform. no_copy (bool, optional): If True, the transformation occurs in place. Otherwise a copy is created and transformed. Defaults to False. Returns: object: The transformed message. """ return x
[docs] @classmethod def get_testing_options(cls, **kwargs): r"""Get testing options for the transform class. Returns: list: Multiple dictionaries of keywords and messages before/after pairs that will result from the transform created by the provided keywords. """ return [{'kwargs': {}, 'in/out': [(1, 1)]}]