Description, motivation and use case
I thought harder after the community meeting to try and find a way to simplify configuration. Typically when writing the configuration files, they include devices with highly repeatable config. A "template" could be used to drastically reduce the number of lines in the configuration files.
@TeresiaOlsson @simoneliuzzo @gubaidulinvadim @GamelinAl @gupichon @JeanLucPons
I would very much like your opinion.
Proposed solution
A template in the configuration file can be used to repeat devices.
Example
The idea would be to have something like this in the configuration file:
- class: pyaml.configuration.template.Template
template: |
class: pyaml.magnet.hcorrector.HCorrector
name: %template_parameter%
model:
class: pyaml.magnet.linear_model.LinearMagnetModel
unit: rad
hardware_unit: str
calibration_factor: 1.0
powerconverter: MAGNET/%template_parameter%/B1L
string_to_replace: "%template_parameter%"
parameter_list:
- PKDK_WL_108
- PKDK_WL_93
- PKDK_WL_79
- PKDK_WL_64
- class: pyaml.magnet.hcorrector.HCorrector
name: ANOTHER
model:
class: pyaml.magnet.linear_model.LinearMagnetModel
unit: rad
hardware_unit: str
calibration_factor: 1.0
powerconverter: MAGNET/ANOTHER/B1L
then this could be expanded when building the storage ring.
Additional context
I have opened a draft PR #442 where I tried to implement something like this. It is definitely not perfect and there are a lot of edge cases that may cause problems.
Checklist
Description, motivation and use case
I thought harder after the community meeting to try and find a way to simplify configuration. Typically when writing the configuration files, they include devices with highly repeatable config. A "template" could be used to drastically reduce the number of lines in the configuration files.
@TeresiaOlsson @simoneliuzzo @gubaidulinvadim @GamelinAl @gupichon @JeanLucPons
I would very much like your opinion.
Proposed solution
A template in the configuration file can be used to repeat devices.
Example
The idea would be to have something like this in the configuration file:
then this could be expanded when building the storage ring.
Additional context
I have opened a draft PR #442 where I tried to implement something like this. It is definitely not perfect and there are a lot of edge cases that may cause problems.
Checklist