Skip to content

Conversation

@JeanLucPons
Copy link
Contributor

@JeanLucPons JeanLucPons commented Jan 12, 2026

This PR adds support for native BPM aggregator.
It also include support for needed vector variable and bring an incompatibly with the tango native backend due to the new function attach_array() to be implemented. pyaml_cs_oa backend is already up-to-date.
Please merge #123 and tag to 0.2.1 before merging this PR.

type: pyaml.accelerator
facility: BESSY2
machine: sr
energy: 1.7e9
controls:
  - type: pyaml_cs_oa.controlsystem
    prefix: "pons:"
    name: live
data_folder: /data/store
arrays:
  - type: pyaml.arrays.bpm
    name: ORBIT
    elements:
    - BPMZ5D1R
    - BPMZ6D1R
devices:
- type: pyaml.bpm.bpm
  name: BPMZ5D1R
  model:
    type: pyaml.bpm.bpm_simple_model
    x_pos_index: 0
    y_pos_index: 1
    x_pos:
      type: pyaml_cs_oa.epicsR
      read_pvname: ORBITCC:rdPos
      unit: nm
    y_pos:
      type: pyaml_cs_oa.epicsR
      read_pvname: ORBITCC:rdPos
      unit: nm
- type: pyaml.bpm.bpm
  name: BPMZ6D1R
  model:
    type: pyaml.bpm.bpm_simple_model
    x_pos_index: 2
    y_pos_index: 3
    x_pos:
      type: pyaml_cs_oa.epicsR
      read_pvname: ORBITCC:rdPos
      unit: nm
    y_pos:
      type: pyaml_cs_oa.epicsR
      read_pvname: ORBITCC:rdPos
      unit: nm
from pyaml.accelerator import Accelerator

sr = Accelerator.load("bessy2bpms.yaml")
print(sr.live.get_bpms("ORBIT").positions.get())
print(sr.live.get_bpms("ORBIT").h.get())
print(sr.live.get_bpms("ORBIT").v.get())
print(sr.live.get_bpm("BPMZ5D1R").positions.get())
print(sr.live.get_bpm("BPMZ6D1R").positions.get())
15 Jan% 2026, 09:00:25 | WARNING | OA control system binding for PyAML initialized with name 'live' and prefix='pons:'
[[ 144.05649344  455.74660592]
 [  96.43369884 -529.71892797]]
[144.05649344  96.43369884]
[ 455.74660592 -529.71892797]
[144.05649344 455.74660592]
[  96.43369884 -529.71892797]

Copy link
Contributor

@gubaidulinvadim gubaidulinvadim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me. I think it will be good to specify in the docstring that by native backend we mean that the underlying Device / PV implement an array of positions for many BPMs. (If I understand this correctly). I would like if @gupichon will also confirm that it is ok to merge because we wanted to fix the version to be used at the workshop.

@JeanLucPons
Copy link
Contributor Author

OK. It will be nice to update the native tango-backend before fixing release for the workshop otherwise orbit correction on the bessy VA will not be possible with main pyaml branch.

Copy link
Contributor

@gupichon gupichon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small error in the yaml test file a "/" is missing.

y_pos_index: 1
x_pos:
type: tango.pyaml.attribute_read_only
attribute: srdiag/bpm/c01-04Position
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo error

@JeanLucPons JeanLucPons merged commit 25384b4 into main Jan 15, 2026
4 checks passed
@JeanLucPons JeanLucPons deleted the bpm-cs-native-aggregator branch January 15, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants