add ability to end the lattice at the beginning of an element - #63
Open
roussel-ryan wants to merge 3 commits into
Open
add ability to end the lattice at the beginning of an element#63roussel-ryan wants to merge 3 commits into
roussel-ryan wants to merge 3 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new option for controlling how the end element of a sliced lattice is determined when building a Bmad model. The main change is the addition of the
end_modeparameter, allowing users to specify whether the slice should end at the provided element or at the element just before it. This provides more flexibility for users working with different lattice slicing requirements. The pull request also adds tests to ensure the new functionality works as expected and updates relevant documentation.Enhancements to lattice slicing:
end_modeparameter (default:"end") tobuild_bmad_modelinfactory.py, allowing users to specify whether the slice should end at the given element or the element before it. Raises aValueErrorfor invalid modes. (virtual_accelerator/bmad/factory.py) [1] [2]get_normalized_element_namesfunction to determine the correct end element whenend_mode="beginning". (virtual_accelerator/bmad/factory.py)API and documentation updates:
get_cu_hxr_bmad_modelfunction signature and docstring to accept and describe the newend_modeparameter. (virtual_accelerator/models/cu_hxr.py) [1] [2]end_modeparameter is passed through to the model factory. (virtual_accelerator/models/cu_hxr.py)Testing:
end_modeparameter, ensuring the model ends at the correct element for both "end" and "beginning" modes. (virtual_accelerator/tests/test_cu_hxr.py)