mxcubecore.model.nstate#
Pydantic models for N-state hardware option lists.
Classes
|
A single selectable value from an N-state device. |
- class mxcubecore.model.nstate.NStateOption(*, value: str | tuple[float, float], label: str | None = None, description: str | None = None, severity: Literal['info', 'warning', 'danger'] | None = None)[source]#
Bases:
BaseModelA single selectable value from an N-state device.
Stores a value along some optional information for the user to make a better informed choice.
- Parameters:
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'description': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'label': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'severity': FieldInfo(annotation=Union[Literal['info', 'warning', 'danger'], NoneType], required=False, default=None), 'value': FieldInfo(annotation=Union[str, tuple[float, float]], required=True)}#
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.