-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
The MagnetArray class needs to improved, it probably should inherit from a more generic class ElementArray which handles all kind of pyAML elements (BPMs, RF cavities, ...).
Most the features we need are detailed in section 2.3 of the User Interface Specification but I recall a few here:
I propose the following behavior for arrays (which I think match the User Interface Specification document):
- The array is composed of different types of pyAML elements, then it's a
ElementArrayand there is no access at the array level to the individual element specific properties (magnet strength, BPM reading, ...), only to the common properties (name,hardware_name, ...). - The array is composed of the same pyAML type, then there is an array level access to the individual element specific properties.
- Specific case of
CombinedFunctionMagnet. If an array is composed ofSextupoleandCombinedFunctionMagnetwith a sextupolar component, then the sextupolar strength is accessible at the array level.
- Subset Handling:
- Subsets (e.g.,
qcorr[0:5]) should return aMagnetArray, not alist.- Bug:
qcorr[0:5].strengths→AttributeError: 'list' object has no attribute 'strengths'.
- Bug:
- Subsets (e.g.,
- Support heterogeneous
MagnetArray(different magnet types). - Implement element access by:
hardware_nameor list ofhardware_name(with wildcard type regex possible)nameor list ofname(with wildcard type regex possible)- Element type filtering
- a boolean array of
len(ElementArray)
- Implement element wise boolean operators
- For example the & operator should return the intersection of two arrays:
bpm_cell8 = sr.cell8 & sr.bpm # return an ElementArray with the common element between the two arrays sr.cell8 and sr.bpm.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels