Conversation
|
@cr-xu Hi, can I have the workflows approved? |
|
@cr-xu What should I do about the pkl file used for consistency test? |
|
@cr-xu Also, I don't know that it makes sense to implement splitting for the super imposed element unless splitting is grabbing the already split components in the superimposed element. |
…es buffer, so that vectorization tests pass
…th superimposed.length
For a new element being implemented, you could just generate those and add those to the tests. They are mostly for keeping track that we don't accidentally introduce breaking changes. |
That probably depends on the way how it is intended to be used. From the current code I see that the superimposed element is put at the center of the other element. So if the real element is not centered, we would already split the base element accordingly and only construct the SuperImposed with split elements, right? In that case, the splitting doesn't make sense and you can just leave it empty. |
…in SuperimposedElement class
|
@cr-xu |
…cy tests would consistently look for the same pkl file generated off parsing the elements name
This PR implements a
SuperimposedElementclass that supports placing an additional element in the center of another element.Description
The
SuperimposedElementclass has abase_elementandsuperimposed_element. During tracking thebase_elementis split in half and thesuperimposed_elementis placed in between both halves at runtime. This allows modification of the base / superimposed element properties in place, without worrying about correctly accounting for the eventual splitting of the element.Motivation and Context
This PR addresses problems with setting element attributes when trying to model beamlines that have superimposed elements. For example, previous cheetah lattices split the elements in the lattice itself, meaning that the length and strength elements were not equal to the full element properties. This created unexpected bugs when setting element parameters (e.g. geometric focusing strength) that depend on the length of the element (for example, when converting from integrated gradient to
Addresses #592
Types of changes
Checklist
flake8(required).pytesttests pass (required).pyteston a machine with a CUDA GPU and made sure all tests pass (required).Note: We are using a maximum length of 88 characters per line.