ParameterModel#

class ParameterModel(*, name, parent_name=None, label=None, parent_label=None, unit=None, data_type=None, collection_type=None, element_indices=None, **extra_data)#

Bases: BaseModel

Pydantic parameter 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.parameter_model

Attributes

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name

parent_name

label

parent_label

unit

data_type

collection_type

element_indices

Methods

decode

Creates instance of exa.common.data.parameter.Parameter out of pydantic ParameterModel

encode

Creates pydantic ParameterModel out of exa.common.data.parameter.Parameter instance

Parameters:
  • name (str) –

  • parent_name (str | None) –

  • label (str | None) –

  • parent_label (str | None) –

  • unit (str | None) –

  • data_type (int | Tuple[int, ...] | None) –

  • collection_type (int | None) –

  • element_indices (int | list[int] | None) –

  • 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.Parameter out of pydantic ParameterModel

Return type:

Parameter

classmethod encode(parameter)#

Creates pydantic ParameterModel out of exa.common.data.parameter.Parameter instance

Parameters:

parameter (Parameter) –

Return type:

ParameterModel