-
Notifications
You must be signed in to change notification settings - Fork 5
Diamond 2 conversion #145
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
Diamond 2 conversion #145
Conversation
These mismatch currently, THERING uses 49 while the ao uses 48. They should match ideally but this is still WIP
Octupoles and Dipoles do not currently have a group FamilyName, this may be added in the future?
There are now multiple elements which are linked to LI-RF-MOSC-01 where previously there was just one, so we need to add the unit conversion for all of them
Instead of hardcoding, get it from the ao
Elements have both a FamName and a Class, with the FamName typically being a specific instance of a Class. Class is also referred to as type in mml. Because of differenes between the DI ao and the DII ao, we need to have awkward conversions and special cases for different element families. eg in DI lattice, there is only 1 FamName in the Bend Class, but in DII there are many and the Bend Class is used in the lattice but not in the ao. We also have to handle special cases for combined Sexts/Octs and Steerers and a special case for combined bend and bend trims (BBVMXS & BBVMXL). This code is not pretty and could do with a refactor, but does currently provide the same configuration for I04 as the old script, as well as creating a working DII configuration.
This is being done prior to major changes to the generation scripts for the D2 ringmodes
Currently these are just octupoles. Support the b3 field and also combined hstr/vstr/multipole elements
Old modes are generated using the updated scripts, the only changes is the removal of the redundant name column from elements.csv
The name was only ever equal to and so this was already guarenteed to be None based off the load_mml.m script
8171377 to
17ad36f
Compare
|
FAILED tests/test_load.py::test_available_ringmodes - AssertionError: assert {'DIADTHz', 'DIADSP', 'VMXTHz', 'I04SP', 'SRI0913_MOGA', 'I04', 'DIAD', 'VMX', 'VMXSP', 'I04THz', '4... |
A bug in load_mml was causing quadrupole elements to be configured with the wrong PV names. This meant that when doing tunefb, we were writing to the wrong PVs and wrong elements, causing tunefb to go wrong. I have changed load_mml so that it looks up the element indexes in the quadrupole family list of pvs, rather than in the combined quadrupole list of pvs.
DIAD was regenerated and changed length due to modifications made in mml 3 years ago
The MML lattice has been altered,some RF cavities have been moved and AT markers added
By default we now index using elem.FamName instead of Class. The only exception is for FamNames defined in TYPE_MAP which are remapped to different lookup keys which are needed to lookup data from the ao. lookup_key is also now only defined in one place. This change has uncovered that we were previously using the wrong PV names for BBVMXL elements, these were previously being treated as regular BB elements. This wont actually change anything in Virtac as we treat all 'BEND' magnets the same using the same PV. BBVMXL and BBVMXS are not accurately simulated.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #145 +/- ##
=======================================
Coverage 99.11% 99.11%
=======================================
Files 12 12
Lines 788 788
=======================================
Hits 781 781
Misses 7 7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Currently our csv files dont specify names, but in the future we might want to. So I have added back in support for names specified in future csv files.
|
I need to update the tests to remove references to the old ringmodes. And then message tobyn and then this is ready to merge |
It would crash if the csv had no name column
The tests now test against I04 and DIAD instead of VMX and DIAD. I also factored out a couple of constants from the test files
|
Fixed tests |
MJGaughran
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine. A more descriptive name for the '48' ring mode would be good, but this shouldn't impact anything if we decide to change it later on.
Uh oh!
There was an error while loading. Please reload this page.