accml_lib.core.bl package
Submodules
accml_lib.core.bl.command_rewritter module
convert from lattice element change to device property
- Please note:
here we have to map (lattice_name, property) -> (device_name, property)
- class accml_lib.core.bl.command_rewritter.CommandRewriter(liaison_manager, translation_service)[source]
Bases:
CommandRewriterBaseCommand rewriter.
This module translates commands between two state spaces: from a lattice element specification to a device property specification (forward) and vice versa (inverse).
It uses a liaison manager to map identifiers and a translator service to convert the command values between representations.
- Parameters:
liaison_manager (LiaisonManagerBase)
translation_service (TranslatorServiceBase)
- forward_read_command(command)[source]
Typically an answer of liaison manager
- Return type:
- Parameters:
command (ReadCommand)
- inverse(cmd)[source]
Convert a command from a device property space back to the lattice space.
:param : param cmd: The command to be transformed.
- inverse_read_command(command)[source]
Typically an answer of liaison manager
- Return type:
- Parameters:
command (ReadCommand)
- inverse_translate_one(cmd, dev_prop_id, lat_prop_id)[source]
Perform a single inverse translation.
:param : param dev_prop_id: The source device property identifier :param : param cmd: The original command :param : param lat_prop_id: The target lattice property identifier
- Return type:
- Returns:
A new Command with the value converted to the lattice state.
- Parameters:
cmd (Command)
dev_prop_id (DevicePropertyID)
lat_prop_id (LatticeElementPropertyID)
accml_lib.core.bl.delta_backend module
- class accml_lib.core.bl.delta_backend.DeltaBackendRProxy(*, backend, cache, filter=<accml_lib.core.bl.delta_backend.NOOPFilter object>)[source]
Bases:
BackendRhandle delta properties
- Parameters:
backend (BackendR)
cache (StateCache)
filter (FilterInterface)
- class accml_lib.core.bl.delta_backend.DeltaBackendRWProxy(backend, cache, filter=<accml_lib.core.bl.delta_backend.NOOPFilter object>)[source]
Bases:
DeltaBackendRProxy,BackendRWhandle delta properties
- Parameters:
backend (BackendRW)
cache (StateCache)
filter (FilterInterface)
- class accml_lib.core.bl.delta_backend.NOOPFilter[source]
Bases:
FilterInterface
accml_lib.core.bl.liaison_manager module
- class accml_lib.core.bl.liaison_manager.LiaisonManager(forward_lut, inverse_lut)[source]
Bases:
LiaisonManagerBaseTodo
consider internally to represent classes of devices with a certain functionallity
- So internally have
classes of devices providing similar properties
this can be used when searching for suggesting alternatives to the user when searching for it
- Parameters:
forward_lut (Mapping[LatticeElementPropertyID, DevicePropertyID])
inverse_lut (Mapping[DevicePropertyID, Sequence[LatticeElementPropertyID]])
- forward(id_)[source]
- Return type:
- Parameters:
id_ (LatticeElementPropertyID)
Todo
for symmetry: should return a sequence too!
- inverse(id_)[source]
needs to return a sequence: e.g. power converters often power more than one magnet
- Return type:
- Parameters:
id_ (DevicePropertyID)
accml_lib.core.bl.translator_service module
- class accml_lib.core.bl.translator_service.TranslatorService(lut)[source]
Bases:
TranslatorServiceBase- Parameters:
lut (Mapping[ConversionID, StateConversion])
- get(id_)[source]
- Return type:
- Parameters:
id_ (ConversionID)
- objects_for_device(id_)[source]
- Parameters:
id_ (ConversionID)
- objects_for_lat_elem(id_)[source]
- Parameters:
id_ (ConversionID)
accml_lib.core.bl.unit_conversion module
- class accml_lib.core.bl.unit_conversion.EnergyDependentLinearUnitConversion(*, intercept, slope, brho)[source]
Bases:
StateConversionTypical example: magnet parameters
- class accml_lib.core.bl.unit_conversion.LinearUnitConversion(*, intercept, slope)[source]
Bases:
StateConversionTypical example: tune
accml_lib.core.bl.yellow_pages module
- class accml_lib.core.bl.yellow_pages.FamilyName(value)[source]
Bases:
Enum- master_clock = 'master_clock'
- quadrupoles = 'quadrupoles'
- tune_correction_quadrupoles = 'tune_correction_quadrupoles'
- class accml_lib.core.bl.yellow_pages.YellowPages(d)[source]
Bases:
YellowPagesBaseor use: get(family_name: str) separate yellow pages for lattice elements and devices
- Parameters:
d (dict)
- get(family_name)[source]
Return a sequence with all identifiers belonging to base class
- Return type:
- Parameters:
family_name (str | FamilyName)