Skip to content

Allow usage of zero-length element - #435

Open
gubaidulinvadim wants to merge 3 commits into
mainfrom
fix-zero-length-magnet
Open

gubaidulinvadim wants to merge 3 commits into
mainfrom
fix-zero-length-magnet

Conversation

@gubaidulinvadim

Copy link
Copy Markdown
Member

Closes #360 by introducing a pyAMLException when the user tries to set a zero-length element.

@GamelinAl does this answer your issue?

@gubaidulinvadim gubaidulinvadim added this to the ESRF Workshop milestone Sep 17, 2026
@gubaidulinvadim gubaidulinvadim self-assigned this Sep 17, 2026
@gubaidulinvadim gubaidulinvadim added the bug Something isn't working label Sep 17, 2026
@GamelinAl

Copy link
Copy Markdown
Member

I am not sure. For which reasons we should throw an error instead of making it work with the integrated strength?

@gubaidulinvadim

Copy link
Copy Markdown
Member Author

It is so that it does not fail silently and will not confuse the user. I'd imagine you would also need the length to do the actual conversion to current. There are no thin elements in the control system.

@GamelinAl

Copy link
Copy Markdown
Member

It is so that it does not fail silently and will not confuse the user. I'd imagine you would also need the length to do the actual conversion to current. There are no thin elements in the control system.

I think I disagree, in SOLEIL MML lattice all the corrector (skew, H/V) and even part of the sextupoles are thin magnets. I don't like it but there is no problem for unit conversion. I think we should still allow for thin magnets to be controlled to be compatible with AT lattice which uses it.

@simoneliuzzo @TeresiaOlsson What do you think?

@TeresiaOlsson

Copy link
Copy Markdown
Member

I think so too. We also had thin correctors in MML before I made them thick so could be that many labs have that and transitioning between MML and pyAML will be less easy if we don't allow it.

@gubaidulinvadim

Copy link
Copy Markdown
Member Author

As you wish

@GamelinAl

Copy link
Copy Markdown
Member

I proposed a solution in #360

@GamelinAl GamelinAl changed the title Added an error throw for setting magnet with zero length. Allow usage of zero-length element Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting a value to a zero-length magnet fails silently

3 participants