accml_lib.core.model.utils package

Submodules

accml_lib.core.model.utils.command module

class accml_lib.core.model.utils.command.BehaviourOnError(value)[source]

Bases: IntEnum

ignore = 2
roll_back = 3
stop = 1
class accml_lib.core.model.utils.command.Command(id, property, value, behaviour_on_error)[source]

Bases: object

Parameters:
behaviour_on_error: BehaviourOnError
classmethod from_jsons(d, **kwargs)[source]

Todo

check if kwargs needs to be passed to some argument

Parameters:

d (dict)

id: str

can be the identifier of a lattice element or a device

property: str
to_jsons(**kwargs)[source]
value: int | float

the object can not be deserialized need to be more precise here

class accml_lib.core.model.utils.command.CommandSequence(commands)[source]

Bases: object

These commands are expected to be executed on by one

Parameters:

commands (Sequence[TransactionCommand])

commands: Sequence[TransactionCommand]
class accml_lib.core.model.utils.command.ReadCommand(id, property)[source]

Bases: object

Use for retrieving data

Parameters:
id: str
property: str
class accml_lib.core.model.utils.command.TransactionCommand(transaction)[source]

Bases: object

Commands that should be executed (more or less) at the same time

In particular: state of the machine is only relevant after all commands have been executed

Parameters:

transaction (Sequence[Command])

transaction: Sequence[Command]

accml_lib.core.model.utils.identifiers module

class accml_lib.core.model.utils.identifiers.ConversionID(lattice_property_id, device_property_id)[source]

Bases: object

Parameters:
device_property_id: DevicePropertyID
lattice_property_id: LatticeElementPropertyID
class accml_lib.core.model.utils.identifiers.DevicePropertyID(device_name, property)[source]

Bases: object

Parameters:
  • device_name (str)

  • property (str)

device_name: str
known()[source]
Return type:

bool

property: str
class accml_lib.core.model.utils.identifiers.LatticeElementPropertyID(element_name, property)[source]

Bases: object

Parameters:
  • element_name (str)

  • property (str)

element_name: str
known()[source]
Return type:

bool

property: str

accml_lib.core.model.utils.tango_resource_locator module

Support of Tango Resource Locator

Tango resource locators seem to need a bit extra treatment e.g. Bluesky expects them to be compatible with json names

accml needs a bit further investigation to fully support TRL with all available tools without treating TRL specially

class accml_lib.core.model.utils.tango_resource_locator.TangoResourceLocator(domain, family, member)[source]

Bases: object

Lightweight Tango Resource Locator (TRL) for device names only.

This class intentionally represents only the core Tango device name consisting of exactly three components:

domain / family / member

Todo

review whole stack to find where trl can not be used as string

or to say differently that TRL can be used as strings. These are only made json compatible where imposed by (external) modules

Limitations and design choices

  • Only the device name part of a TRL is supported. Full TRL features such as protocol (tango://), host:port, attributes, properties (->), database selectors (#dbase), or wildcards are deliberately NOT handled here.

  • The class is designed to be a small, explicit value object and not a full TRL parser.

  • Input tokens are assumed to be already valid Tango name tokens. No automatic escaping, sanitization, or normalization is performed except where explicitly documented.

  • Users are responsible for providing JSON-compatible tokens when serialization is required. The helper method json_compatible() exists for this purpose but is not lossless.

  • Tango device names are case-insensitive. Equality comparisons are therefore performed in a case-insensitive manner.

Rationale

This restricted scope avoids implicit behavior, keeps the object predictable, and makes failures explicit. Any logic related to full TRL parsing or environment-specific resolution should live at a higher level in the application stack.

as_trl()[source]
Return type:

str

domain: str
family: str
classmethod from_trl(trl)[source]
Parameters:

trl (str)

json_compatible()[source]
Return type:

str

member: str
Parameters:
accml_lib.core.model.utils.tango_resource_locator.clear_token(token)[source]

Todo

jsons complains on this name

accml_lib.core.model.utils.tango_resource_locator.name_from_trl(trl)[source]

Todo

not used … remove me

Module contents