mxcubecore.model.protocols.sardana#

Classes

Command(*[, name])

Sardana command configuration.

Door(*[, commands])

Configuration of a Sardana door.

SardanaConfig([root])

The 'sardana' section of the hardware object's YAML configuration file.

class mxcubecore.model.protocols.sardana.Command(*, name: str | None = None)[source]#

Bases: BaseModel

Sardana command configuration.

Parameters:

name (str | None) –

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]] = {'name': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubecore.model.protocols.sardana.Door(*, commands: Dict[str, Command | None] | None = None)[source]#

Bases: BaseModel

Configuration of a Sardana door.

Parameters:

commands (Dict[str, Command | None] | None) –

get_commands() Iterable[Tuple[str, Command]][source]#

Get all commands configured for this door.

This method will fill in optional configuration properties for commands.

Return type:

Iterable[Tuple[str, Command]]

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]] = {'commands': FieldInfo(annotation=Union[Dict[str, Union[Command, NoneType]], NoneType], required=False, default=None)}#

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class mxcubecore.model.protocols.sardana.SardanaConfig(root: RootModelRootType = PydanticUndefined)[source]#

Bases: RootModel[Dict[str, Door]]

The ‘sardana’ section of the hardware object’s YAML configuration file.

Parameters:

root (RootModelRootType) –

get_doors() Iterable[Tuple[str, Door]][source]#

Get all Sardana doors specified in this section.

Return type:

Iterable[Tuple[str, Door]]

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]] = {'root': FieldInfo(annotation=Dict[str, Door], 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.