Skip to content

Monitors and actuators acces from tuning tools - #418

Merged
gubaidulinvadim merged 5 commits into
mainfrom
feature-tune-monitor-selection
Sep 15, 2026
Merged

gubaidulinvadim merged 5 commits into
mainfrom
feature-tune-monitor-selection

Conversation

@gubaidulinvadim

@gubaidulinvadim gubaidulinvadim commented Sep 14, 2026

Copy link
Copy Markdown
Member

@simoneliuzzo this answers #178 and makes a public access to monitors and actuators of tuning tools in pyAML. @JeanLucPons is there any reason to keep them "private"?

It is possible to do now, for example,

print(sr.design.tune.quadrupoles)

to access the quadrupole array used for tune correction. Before, it was "hidden" as a private attribute _quadrupoles.

For #414 , public access to monitors and actuators would need to be made a requirement for a generic tuning tool.

@simoneliuzzo I am trying to also answer #177, but I think this is already implemented. I am not sure if your issue also means something like swapping the tune monitor for an existing Tune tuning tool or simply a request on the interface in the constructor.

Currently, you can make a Tune tuning tool with a selected betatron_tune_name (tune monitor name). You'd still need to attach it to the simulator or control system after creation, but this is a general pyAML interface as of now for interactive object creation.

tune2 = Tune('ALTUNE', quad_array_name='QCORR', response_matrix='respmat.json', betatron_tune_name='BETATRON_TUNE2')
tune2.attach(sr.design)
tune2.attach(sr.live)
print(tune2.tune_monitor)

Resolves #178
Resolves #177

@gubaidulinvadim gubaidulinvadim added this to the ESRF Workshop milestone Sep 14, 2026
@gubaidulinvadim gubaidulinvadim self-assigned this Sep 14, 2026
@gubaidulinvadim gubaidulinvadim added the enhancement New feature or request label Sep 14, 2026
simoneliuzzo
simoneliuzzo previously approved these changes Sep 15, 2026
@JeanLucPons

Copy link
Copy Markdown
Member

No there is no reason to keep it private.
It is ok for me.

@JeanLucPons

Copy link
Copy Markdown
Member

@gubaidulinvadim
Concerning attachment of self created tool, i think it was already discussed and the idea would be to add a add() method to Accelerator that will automatically do attachment to each cs or simulator instance.

tune2 = Tune('ALTUNE', quad_array_name='QCORR', response_matrix='respmat.json', betatron_tune_name='BETATRON_TUNE2')
tune2.attach(sr.design)
tune2.attach(sr.live)
print(tune2.tune_monitor)

should be:

tune2 = Tune('ALTUNE', quad_array_name='QCORR', response_matrix='respmat.json', betatron_tune_name='BETATRON_TUNE2')
sr.add(tune2)
print(tune2.tune_monitor)

@gubaidulinvadim

Copy link
Copy Markdown
Member Author

@gubaidulinvadim Concerning attachment of self created tool, i think it was already discussed and the idea would be to add a add() method to Accelerator that will automatically do attachment to each cs or simulator instance.

tune2 = Tune('ALTUNE', quad_array_name='QCORR', response_matrix='respmat.json', betatron_tune_name='BETATRON_TUNE2')
tune2.attach(sr.design)
tune2.attach(sr.live)
print(tune2.tune_monitor)

should be:

tune2 = Tune('ALTUNE', quad_array_name='QCORR', response_matrix='respmat.json', betatron_tune_name='BETATRON_TUNE2')
sr.add(tune2)
print(tune2.tune_monitor)

Thanks, that's clear. I've only written it to explain in the PR that this will be improved later.

@gubaidulinvadim

Copy link
Copy Markdown
Member Author

@simoneliuzzo @JeanLucPons Sorry, there was a merge conflict with main (in the docstrings). This needs to be reapproved.

@gubaidulinvadim
gubaidulinvadim merged commit 1575472 into main Sep 15, 2026
4 checks passed
@gubaidulinvadim
gubaidulinvadim deleted the feature-tune-monitor-selection branch September 15, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

access monitors and actuators from tuning tools Feature: tune_monitor selection in tune_correction

3 participants