Repository navigation
Feature IDs interface - #527
gubaidulinvadim wants to merge 11 commits into
Conversation
| control_mode: APPLE01_MODE | ||
| model_operating_point: {gap: 4.0, phase: 0.0, mode: parallel} | ||
| disabled_operating_point: {gap: 30.0, phase: 0.0} | ||
| orbit_feedforward: ID01_ORBIT_FF |
There was a problem hiding this comment.
Nested dictionaries hide the way to configure the device (e.g. here in control variables). To properly have the SchemaValidator discover, describe and validate the configuration you would need to do something like this:
- type: pyaml.insertion_device
name: APPLE01
device_id: APPLE01_SERIAL
lattice_names: ID02
description: Kickmap measured at 4 mm gap and zero phase.
control_variables:
- type: pyaml.insertion_devices.control_variable
name: gap
unit: mm
backend: APPLE01_GAP
movement_flag: APPLE01_GAP_MOVING
- type: pyaml.insertion_devices.control_variable
name: phase
unit: mm, backend: APPLE01_PHASE
movement_flag: APPLE01_MOVING
control_mode: APPLE01_MODE
model_operating_point:
- type: pyaml.insertion_devices.operating_point
name: gap
value: 4.0
- type: pyaml.insertion_devices.operating_point
name: phase
value: 0.0
- type: pyaml.insertion_devices.operating_point
name: mode
value: parallel
disabled_operating_point:
- type: pyaml.insertion_devices.operating_point
name: gap
value: 30.0
- type: pyaml.insertion_devices.operating_point
name: phase
value: 0.0
orbit_feedforward: ID01_ORBIT_FF
There was a problem hiding this comment.
I believe this is only a configuration file issue because both formats are valid yaml. But I agree that the docstring example should show the intended way of writing a config file.
There was a problem hiding this comment.
Nope, you are right. I'm making the changes to allow a PyAMLish interface. But a dictionary gives simpler code and in this case maybe it's not worth it having the validation.
There was a problem hiding this comment.
You can still build the same dictionary at init, I think there is no need to keep the pyaml.insertion_devices.operating_point type after initialization. Also since it is just a value with a name it could be a general pyaml "NamedValue" or something configuration class.
|
atcollab/at#1124 is now merged. I will extend the implementation to support several model working points for a single ID (kickmaps corresponding to different gap/phase/polarisation values). This shouldn't change the code much. Working points will be a list of working points, and the simulator will allow changing between working point configurations. |
|
Updated to handle multiple kickmaps in a single element. Tests are failing because we are using older version of pyAT (0.9) where this functionality is not yet present. |
This PR should allow an insertion device interface for pyAML that allows control of gap/phase or current (for electromagnetic IDs). It is flexible enough to cover several types of IDs. Each ID can have an attached feedforward (to be implemented as a MeasurementTool) for tuning or orbit. pyAT counterpart can have fixed settings of gap/phase corresponding to the model of the kickmap. A subholder is added for insertion devices.
This PR is to be merged after #526.
Resolves #509, #524, #525. This implementation is different to the interface proposed in the issue because I found that this solution is a bit more compact. In the end, the simplest solution is to have all cases covered together. Switching between different models/kickmaps of the ID could be easily done if atcollab/at#1124 is merged on the side of pyAT.
@eddrial You could have a look, but this is already a pyAML-specific implementation. However, the main class of pyaml/insertion_device/insertion_device.py should be easy to understand.