Conversation
There was a problem hiding this comment.
2 things:
- You can remove the hardware part. For model without needed conversion or extra calculation we will do as for magnet using identity bpm model.
- It would be nice to test attached field and initialize them to None in
__init__()i.e.
@property
def tilt(self) -> RWBpmTiltScalar:
if self.__tilt is None:
raise PyAMLException(f"{str(self)} does not support tilt")
return self.__tiltThere was a problem hiding this comment.
OK, I will correct. I understood that the hardware part can be skipped only yesterday by looking at your RF device implementation.
There was a problem hiding this comment.
According to @gupichon modifications, an other field than FamName can be used for elements identification.
So you should pass it to the construct of your RBpmArray and use this field.
index = self.lattice.get_refpts(self.element.FamName)There was a problem hiding this comment.
Unfortunately I'm not sure that get_refpts() can be used to select on an arbitrary AT field.
You may need to extract the index at each call.
There was a problem hiding this comment.
I think a simple mods like below should be ok.
def get(self) -> np.array:
index = self.lattice.index(self.element)
_, orbit = at.find_orbit(self.lattice, refpts=index)
return orbit[0, [0, 2]]There was a problem hiding this comment.
May be remove the debug trace
print(self.__BPMS.keys())
JeanLucPons
left a comment
There was a problem hiding this comment.
Nice works. Thanks
Just few details above !
…e part from BPM. Corrected bug in tests.
|
I've made the corrections and also added a test with a nonzero orbit by setting one of the corrector magnet strength to 1e-6 in the test. FYI, I've created an issue in tango-pyaml python-accelerator-middle-layer/tango-pyaml#21 but I'm not sure if it originates in tango-pyaml or in pyaml itself. If I use |
Yes I think there is a bug in attribute_read_only that prevents to use get(). |
First try at BPM implementation. Following Issue #6 and some discussions with Jean-Luc. I've only added the simplest tests for now.