-
Notifications
You must be signed in to change notification settings - Fork 22
More tools for dual energy matching #251
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
base: main
Are you sure you want to change the base?
Conversation
Using new colocho_feature branch
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.
Hi William, thanks for the PR. I left a couple of comments. Once we get those resolved, the PR will be ready to merge. Please merge with main so that the tests run as they should. We can move this PR back to your fork to make it easier for you to change.
YAML_LOCATION = os.path.join(os.path.dirname(__file__), "yaml/") | ||
print(YAML_LOCATION) |
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.
What is this print statement trying to accomplish? The only time this print statement will run is when we import the bmad_modeling
path, which is not intuitive for the user.
@@ -45,6 +47,7 @@ def get_energy_gain_pvlist(beam_path): | |||
except FileNotFoundError: | |||
print(f"Could not find yaml file {yaml_file_name}") |
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'd like to throw an error here. It can provide more information than the regular FileNotFoundError does. I don't think there's a situation where the caller of this function wants to proceed even if there's a file not found error. If that's the case, the caller can wrap this function in their own try/catch statement.
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.
Once the comments are addressed, this can get merged. Linting as well. Thanks!
@@ -31,6 +32,7 @@ def get_rf_quads_pvlist(tao, all_data_maps, beam_code=1): | |||
for pv in map.pvlist: | |||
if "BEAMCODE" in pv: | |||
pv = map.accelerate_pvname | |||
pv = pv[0:21] + beam_code + pv[22:] |
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.
Is there a more general way to grab this info? i.e. slit on colon (:) or something else? Or can we always be sure the 0:21 and 22: will be correct?
@@ -3,10 +3,11 @@ cu: | |||
L0: REFS:IN20:751:EDES | |||
L1: REFS:LI21:231:EDES | |||
L2: REFS:LI24:790:EDES | |||
L3: REFS:LI30:901:EDES | |||
L3: REFS:DMP?:400:EDES | |||
|
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.
Does this PV have ? in it? I'm unfamiliar w/ this.
@williamColocho any updates on this PR? If it's on hold can we close it for now? |
Creating this for @williamColocho
Adding tools for energy gain in dual energy matching mode. The Dump energy PV needs to be determined dynamically depending on primary/secondary beam path.