impactx
impactx copied to clipboard
Python: Element Groups & Lattice Manipulation
At least on the Python side, it will be beneficial to have support to arbitrarily group elements to select and manipulate (ramp/scale up/down currents, deactivate, etc.).
Helper: Select By Type
We could add helper functions to select elements in a list & KnownElementsList by type (i.e., in filter()).
Allowing Arbitrary Runtime Attributes
One way to simplify user-defined selections would be to allow users to add arbitrary runtime attributes to every element. This can be used to add "tags"/"keywords" or any type of book keeping information.
This means we just need to add py::dynamic_attr() as we do in the Programmable element.
A downside of doing this generally is that typos, like quad1.k_typo = 12, will not raise errors. That said, this is the default behavior in Python anyway, we just disable it right now for all of our elements besides the Programmable one.
Other needs
We can take a look again at other codes, e.g., PyAT and Cheetah (IIRC?) have sensible Python selectors for lattice manipulation.
Maybe a bit duply with #1088