pysdic.Transformation.from_dict#
- classmethod Transformation.from_dict(data)[source]#
Create a transformation instance from a dictionary.
The class instantiated is given by the
'type'key of the dictionary:If called on
pysdic.Transformation, the'type'key is required and any registered subclass can be instantiated.If called on a subclass
cls, the'type'key is optional (defaults tocls) and must designateclsor one of its subclasses.
T = Transformation.from_dict(data) # Any registered transformation T = MyTransformation.from_dict(data) # MyTransformation or a subclass of it
- Parameters:
data (Dict[str, Any]) – A dictionary containing the parameters and constants for the transformation.
- Returns:
A new instance of the transformation initialized with the data from the dictionary.
- Return type: