accml.core.utils package
Subpackages
Submodules
accml.core.utils.basic_measurement_execution_engine module
- class accml.core.utils.basic_measurement_execution_engine.BasicMeasurementExecutionEngine(*, backend, cmd_rewriter, storage, expected_view_for_output, num_readings)[source]
Bases:
MeasurementExecutionEngineCommon functionality of the measurement execution engine
- Parameters:
backend (BackendRW)
cmd_rewriter (CommandRewriterBase)
storage (StorageInterface)
expected_view_for_output (str)
num_readings (int)
- async execute(commands_collection, detectors, *, md, **kwargs)[source]
The commands collections is missing Context i.e. in which view it is operating.
- Return type:
- Parameters:
commands_collection (Sequence[TransactionCommand])
detectors (Sequence[ReadCommand])
Todo
evaluate if a set / read method should be provided as separate methods
- async trigger_read(rcmds)[source]
- Return type:
- Parameters:
rcmds (Sequence[ReadCommand])
Todo
- review handling context or view:
design / device
Can commands be only converted once?
command rewriter: separate function for read commands? i.e. a delegation to liaison manager
- accml.core.utils.basic_measurement_execution_engine.convert_data(cmd_rewriter, detectors, data)[source]
Here only command rewritter is used. As always the same command is used one could just look up the translation object once and then do batch processing.
Early optimisation …
- Return type:
- Parameters:
cmd_rewriter (CommandRewriterBase)
detectors (Sequence[ReadCommand])
- accml.core.utils.basic_measurement_execution_engine.convert_data_seq(*, cmd_rewriter, detectors, data, output_view, backend_view)[source]
- Return type:
- Parameters:
cmd_rewriter (CommandRewriterBase)
detectors (Sequence[ReadCommand])
data (Sequence[SingleReading])
output_view (str)
backend_view (str)
Todo
merge with convert_data
- accml.core.utils.basic_measurement_execution_engine.convert_read_commands(*, cmd_rewriter, commands, output_view, backend_view)[source]
- Parameters:
cmd_rewriter (CommandRewriterBase)
commands (Sequence[ReadCommand])
output_view (str)
backend_view (str)
- accml.core.utils.basic_measurement_execution_engine.convert_set_commands(*, cmd_rewriter, commands, output_view, backend_view)[source]
- Parameters:
cmd_rewriter (CommandRewriterBase)
output_view (str)
backend_view (str)
- accml.core.utils.basic_measurement_execution_engine.convert_transaction_commands_design_to_device(cmd_rewriter, transaction)[source]
- Return type:
- Parameters:
cmd_rewriter (CommandRewriterBase)
Warning
not tested code
- accml.core.utils.basic_measurement_execution_engine.convert_transaction_commands_device_to_design(cmd_rewriter, transaction)[source]
- Return type:
- Parameters:
cmd_rewriter (CommandRewriterBase)
- async accml.core.utils.basic_measurement_execution_engine.execute(backend, detectors, commands, num_readings)[source]
- Return type:
- Parameters:
backend (BackendRW)
detectors (Sequence[ReadCommand])
commands (Sequence[TransactionCommand])
num_readings (int)
- async accml.core.utils.basic_measurement_execution_engine.execute_step(backend, detectors, transaction_commands, num_readings)[source]
Handle transactional commands
- Return type:
- Parameters:
- async accml.core.utils.basic_measurement_execution_engine.read(backend, detectors)[source]
- Return type:
- Parameters:
backend (BackendRW)
detectors (Sequence[ReadCommand])
- async accml.core.utils.basic_measurement_execution_engine.read_and_encapsulate(backend, detectors)[source]
put data into a ReadToGether envelope
- Return type:
- Parameters:
backend (BackendRW)
detectors (Sequence[ReadCommand])