Skip to content

ElementHolder API: one accessor per element family (merge magnet/magnets, bpm/bpms, ...) #531

In review

Description

@gupichon-soleil

Sub-issue of #468 (part A, holders).

Scope:

  • One accessor per element family, singular: magnet, combined_function_magnet, serialized_magnet, diagnostic.bpm. Plural accessors are removed.
  • Methods: get(name) returns one element, get_array(name) and attribute access return a configured array, get_array() returns every element of the family (replaces .all()), [key] returns an element for a literal name and a typed array for a pattern (*, re:, list, ~).
  • Same convention at the root: ElementHolder.get(name) returns one element, get_array(name=None) becomes public.
  • Merge GenericElementHolder and GenericArrayHolder into one GenericHolder, merge each XHolder/XsHolder pair in sub_holders.py.
  • Update internal callers (tuning tools), tests, examples, notebooks and docs.

Done when no plural family accessor remains and the test suite passes.

Metadata

Metadata

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions