pysdic.Parametrization.from_dict#

classmethod Parametrization.from_dict(data)[source]#

Create a parametrization instance from a dictionary.

The class instantiated is given by the 'type' key of the dictionary:

  • If called on pysdic.Parametrization, the 'type' key is required and any registered subclass can be instantiated.

  • If called on a subclass cls, the 'type' key is optional (defaults to cls) and must designate cls or one of its subclasses.

P = Parametrization.from_dict(data)       # Any registered parametrization
P = MyParametrization.from_dict(data)     # MyParametrization or a subclass of it
Parameters:

data (Dict[str, Any]) – A dictionary containing the constants for the parametrization.

Returns:

A new instance of the parametrization initialized with the data from the dictionary.

Return type:

Parametrization