You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description, motivation and use case ElementHolder stores every element for a control mode, but its public API still requires callers to know whether an object is an individual element or a configured array. The typed holders cover magnets and BPMs, but users cannot yet browse all elements through one consistent collection interface.
This matters for interactive workflows that start from a mode and need to select elements by name before applying existing array operations.
Proposed solution
Add a generic public collection API to ElementHolder:
holder.get() returns all attached elements as an ElementArray.
holder[:] is equivalent to holder.get().
holder[pattern] selects elements by name wildcard and returns the most specific compatible array type.
Keep get_element() and get_elements() unchanged for backward compatibility. Exact configured-array lookup remains available through get_elements(name); the new API is for generic collection navigation.
Describe alternatives you've considered
Keeping only get_element() and get_elements() preserves the current API, but requires callers to decide in advance whether they need a singleton or an array. Exposing the internal _ALL mapping would avoid new methods but would leak implementation details and bypass typed array behavior.
ElementArray already provides slicing, wildcard selection, and set-like operations. Domain-specific field filtering remains the responsibility of typed arrays; for example, model_name is a magnet-specific field.
Activity
gupichon commentedon Sep 4, 2026
@GamelinAl, here the issue we discussed.