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_config: ClassVar[ConfigDict] = {}

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

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

Bases: BaseModel

Tango command configuration.

Parameters:

name (str | None)

model_config: ClassVar[ConfigDict] = {}

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

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_config: ClassVar[ConfigDict] = {}

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

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_config: ClassVar[ConfigDict] = {}

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