Conversation
|
This looks mostly good to me. However, when I test I notice something strange: I do not understand what strengths of an array of combined function magnets are returned. For me, I would naively think that it will be a 2D array with a shape of (32, 4). A single ESRF combined function magnet returns array of (4,) corresponding to A0, B0, A1, B2. So, what is returned by a combined function array? Also, there's a small issue for the user. The element array has no strength attribute because it can contain elements that are not magnets. But the user would want to have an array of, let's say, all H correctors. Some will be single function magnets and some will be combined function magnets. Then if I want to print the strength of all H correctors, I need to manually loop over all the magnets and have something like: Is this correct? |
|
Yes this seems correct. Virutal Magnet are there especially for this, and aggregators are there to prevent from setpoint duplications. However, if you have a set of |
|
I see, I didn't check if there are different types of combined function magnets. The strengths array in this example then is not very useful because it had to be flattened and there's no way to tell to which field component an array element belongs. For the user, it would definitely be good to have a way to change all H correctors (combined and not) in a single operation. For the naming and sorting-by-name part, this is already very good. |
This is possible. You can create an array of HCorrector having both virtual and simple |
This PR propose dynamic arrays to answer #46
Here are few possible writing.
Improvement and ideas are welcome.
The selection code is located in pyaml/arrays/element_array.py
outputs