mxcubecore.model.protocols.exporter#

Models the exporter section of YAML hardware configuration file.

Provides an API to read configured exporter channels and commands.

Classes

Address(*[, commands, channels])

Configuration of an exporter end point.

Channel(*[, attribute])

Exporter channel configuration.

Command(*[, name])

Exporter command configuration.

ExporterConfig([root])

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

class mxcubecore.model.protocols.exporter.Address(*, commands: Dict[str, Command | None] | None = None, channels: Dict[str, Channel | None] | None = None)[source]#

Bases: BaseModel

Configuration of an exporter end point.

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

Get all channels configured for this exporter address.

This method will fill in optional configuration properties for channels.

Return type:

Iterable[Tuple[str, Channel]]

get_commands() Iterable[tuple[str, mxcubecore.model.protocols.exporter.Command]][source]#

Get all commands configured for this exporter address.

This method will fill in optional configuration properties the commands.

Return type:

Iterable[tuple[str, mxcubecore.model.protocols.exporter.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.exporter.Channel(*, attribute: str | None = None)[source]#

Bases: BaseModel

Exporter channel configuration.

Parameters:

attribute (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]] = {'attribute': 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.exporter.Command(*, name: str | None = None)[source]#

Bases: BaseModel

Exporter 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.exporter.ExporterConfig(root: RootModelRootType = PydanticUndefined)[source]#

Bases: RootModel[Dict[str, Address]]

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

Parameters:

root (RootModelRootType) –

get_addresses() Iterable[Tuple[str, Address]][source]#

Get all exporter addresses specified in this section.

Return type:

Iterable[Tuple[str, Address]]

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