Skip to content

New magnet holder api - #347

Merged
JeanLucPons merged 4 commits into
mainfrom
new-magnet-holder-api
Aug 14, 2026
Merged

New magnet holder api#347
JeanLucPons merged 4 commits into
mainfrom
new-magnet-holder-api

Conversation

@JeanLucPons

Copy link
Copy Markdown
Member

This PR implements new holder API for magnet(s).
Part of #199

@gubaidulinvadim gubaidulinvadim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The changes are actually minimal to make a subholder.

Comment thread pyaml/common/magnets_holder.py Outdated
def __init__(self, peer: "ElementHolder"):
self._peer = peer

def get(self, name: str = None) -> Magnet:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should return an array type?

Comment thread pyaml/common/magnets_holder.py
@JeanLucPons

Copy link
Copy Markdown
Member Author

I added the selection as specified in #199

sr = Accelerator.load("tests/config/EBSOrbit.yaml")
arr = sr.design.magnets["QD2E-C3*"]

Selection by other field such as device name will required that we first agreed on __repr__. For the time being repr are not coherent between various objects.

@JeanLucPons
JeanLucPons merged commit c5673dd into main Aug 14, 2026
4 checks passed
@JeanLucPons
JeanLucPons deleted the new-magnet-holder-api branch August 14, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants