mxcubecore.model.protocols.epics#

Models the epics section of YAML hardware configuration file.

Provides an API to read configured EPICS channels.

Classes

Channel(*[, suffix, polling_period])

EPICS channel configuration.

EpicsConfig([root])

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

Prefix(*, channels)

Configuration of an EPICS prefix section.

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

Bases: BaseModel

EPICS channel configuration.

Parameters:
  • suffix (str | None) –

  • polling_period (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]] = {'polling_period': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'suffix': 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.epics.EpicsConfig(root: RootModelRootType = PydanticUndefined)[source]#

Bases: RootModel[Dict[str, Prefix]]

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

Parameters:

root (RootModelRootType) –

get_prefixes() Iterable[Tuple[str, Prefix]][source]#

Get all prefixes specified in this section.

Return type:

Iterable[Tuple[str, Prefix]]

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

class mxcubecore.model.protocols.epics.Prefix(*, channels: Dict[str, Channel | None] | None)[source]#

Bases: BaseModel

Configuration of an EPICS prefix section.

Parameters:

channels (Dict[str, Channel | None] | None) –

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

Get all channels configured for prefix.

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

Return type:

Iterable[Tuple[str, Channel]]

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=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.