SettingModel#
- class SettingModel(*, parameter, value=None, **extra_data)#
Bases:
BaseModel
Pydantic setting model
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Module:
exa.common.api.model.setting_model
Attributes
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
parameter
value
Methods
Creates instance of
exa.common.data.parameter.Setting
out of pydantic SettingModelCreates pydantic
SettingModel
out ofSetting
instance.serialize_value
- Parameters:
parameter (ParameterModel) –
value (Any) –
extra_data (Any) –
- model_config: ClassVar[ConfigDict] = {'extra': 'allow'}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- decode()#
Creates instance of
exa.common.data.parameter.Setting
out of pydantic SettingModel- Return type:
- classmethod encode(setting)#
Creates pydantic
SettingModel
out ofSetting
instance.Converts numpy scalars to native types to avoid problems with JSON encoding.
- Parameters:
setting (Setting) –
- Return type: