mxcubecore.model.protocols.tango#

Models the tango section of YAML hardware configuration file.

Provides an API to read configured tango channels and commands.

Classes

Channel(*[, attribute, polling_period, timeout])

Tango channel configuration.

Command(*[, name])

Tango command configuration.

Device(*[, commands, channels])

Configuration of a tango device.

TangoConfig([root])

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

class mxcubecore.model.protocols.tango.Channel(*, attribute: str | None = None, polling_period: int | None = None, timeout: int | None = None)[source]#

Bases: BaseModel

Tango channel configuration.

Parameters:
  • attribute (str | None) –

  • polling_period (int | None) –

  • timeout (int | 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]] = {'attribute': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'polling_period': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'timeout': FieldInfo(annotation=Union[int, 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.tango.Command(*, name: str | None = None)[source]#

Bases: BaseModel

Tango 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.tango.Device(*, commands: Dict[str, Command | None] | None = None, channels: Dict[str, Channel | None] | None = None)[source]#

Bases: BaseModel

Configuration of a tango device.

Parameters:
get_channels() Iterable[Tuple[str, Channel]][source]#

Get all channels configured for this device.

This method will fill in optional configuration properties for a channel.

Return type:

Iterable[Tuple[str, Channel]]

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

Get all commands configured for this device.

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]] = {'channels': FieldInfo(annotation=Union[Dict[str, Union[Channel, NoneType]], NoneType], required=False, default=None), '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.tango.TangoConfig(root: RootModelRootType = PydanticUndefined)[source]#

Bases: RootModel[Dict[str, Device]]

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

Parameters:

root (RootModelRootType) –

get_tango_devices() Iterable[Tuple[str, Device]][source]#

Get all tango devices specified in this section.

Return type:

Iterable[Tuple[str, Device]]

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, Device], 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.