attribute_linker#

class ConfigModel(*, attribute_name)[source]#

Bases: LinkerConfigModel

Base configuration model for linker definitions.

This class defines the configuration structure used to instantiate a specific linking strategy. Each concrete implementation of a LatticeElementsLinker may define its own subclass extending this model to include additional configuration parameters.

model_config#

Pydantic configuration allowing arbitrary field types and forbidding unexpected extra keys.

Type:

ConfigDict

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

attribute_name: str#
class PyAtAttributeElementsLinker(config_model)[source]#

Bases: LatticeElementsLinker

Abstract base class defining the interface for PyAT–PyAML element linking.

Implementations of this class define how PyAML elements are matched to PyAT elements based on a given linking strategy (e.g., by family name, by index, or by a custom attribute).

Parameters:

config_model (ConfigModel) – The configuration model for the linking strategy.

get_element_identifier(element)[source]#

Get the element identifier for the given element.

Parameters:

element (Element) – The element to get the identifier for

Returns:

LinkerIdentifier – The identifier for linking the element

class PyAtAttributeIdentifier(attribute_name, identifier)[source]#

Bases: LinkerIdentifier

Abstract base class for identifiers used to match PyAML and PyAT elements.

The identifier acts as an intermediate representation between the PyAML configuration and the PyAT lattice. Its exact structure depends on the linking strategy (e.g., family name, element index, or user-defined tag).

Subclasses should define the fields and logic necessary to represent a unique reference to one or more PyAT elements.