Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds Multipole class to atdisable_6d atenable_6d #874

Merged
merged 6 commits into from
Dec 12, 2024

Conversation

oscarxblanco
Copy link
Contributor

This PR fixes the issus #873 where atdisable_6d fails to disable 6D when the ring has atmultipole elements.

I add the Multipole class to the list, and also an argument as it is the case for all other elements.

@oscarxblanco oscarxblanco changed the title fix disable_6d adding Multipole class fix atdisable_6d atenable_6d adding Multipole class Dec 12, 2024
@oscarxblanco oscarxblanco changed the title fix atdisable_6d atenable_6d adding Multipole class adds Multipole class to atdisable_6d atenable_6d Dec 12, 2024
@oscarxblanco oscarxblanco added Matlab For Matlab/Octave AT code bug fix labels Dec 12, 2024
@oscarxblanco
Copy link
Contributor Author

Dear @swhite2401, dear @lfarv ,
who should review this pull request ?

Best regards,
o

Copy link
Contributor

@lfarv lfarv left a comment

Choose a reason for hiding this comment

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

missing argument in atenable_6d

@lfarv
Copy link
Contributor

lfarv commented Dec 12, 2024

I had a look and it looks nice. However I found a strange thing: both atenable_6d and atdisable_6d mention an Octupole class. But as far as I could see, this class does not exist:

The Class field was not part of the initial definition of elements. As such, it is not mandatory. It is assigned by the element creation functions, but there is no atoctupole.m element creation function which would assign elem.Class='Octupole'. If the Class field is absent, the "class" is returned by atguessclass or guessclass_6d. None of these functions knows about an Octupole class: any magnet with order higher than 3 is considered as Multipole.

So the 'octupass' keyword in atenable_6d is accessed either if a user explicitly set the Class attribute to 'Octupole' (unlikely), or in a lattice read from a file created in PyAT, since the Octupole class exist in python and is saved in .mat files.

Creating an Octupole class in Matlab would require adding an atoctupole.m creation function, modifying atguessclass.m and guessclass_6d.m to identify octupoles, and modifying at2str.m and at2py.m to generate their proper representation. It could be a topic for another PR.

Copy link
Contributor

@lfarv lfarv left a comment

Choose a reason for hiding this comment

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

OK

@oscarxblanco oscarxblanco merged commit 15e8f5a into master Dec 12, 2024
23 checks passed
@oscarxblanco oscarxblanco deleted the fix_disable_6d_with_atmultipole branch December 12, 2024 17:57
@oscarxblanco
Copy link
Contributor Author

Dear @lfarv ,
my guess is that Octupoles were created in pyat to have some compatibility with the MAD-X element definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Matlab For Matlab/Octave AT code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants