routine to instantiate an impactx lattice based on a synergia lattice#1271
routine to instantiate an impactx lattice based on a synergia lattice#1271egstern wants to merge 26 commits intoBLAST-ImpactX:developmentfrom
Conversation
There was a problem hiding this comment.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
|
Great! Thanks for sharing! |
the value for what MAD-X called FINT is no longer the fourth argument so all the calls need to be updated.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
| ) | ||
|
|
||
| return ocelem | ||
|
|
Check warning
Code scanning / CodeQL
Unnecessary pass Warning
| # only do linear bend | ||
| main_bend_elem = impactx.elements.CFbend( | ||
| ds, radius_of_curvature, k1, nslice=ns, name=nm | ||
| ) |
Check warning
Code scanning / CodeQL
Unnecessary pass Warning
| else: | ||
| # CF bend | ||
|
|
||
| if order == Order.linear: |
Check warning
Code scanning / CodeQL
Unnecessary pass Warning
| ) | ||
| else: | ||
| phi = bendangle * 180 / np.pi | ||
| main_bend_elem = impactx.elements.ExactSbend(ds, phi, nslice=ns, name=nm) |
Check warning
Code scanning / CodeQL
Unnecessary pass Warning
| de_model = "linear" | ||
|
|
||
| if e1 != 0.0: | ||
| us_dipedge = impactx.elements.DipEdge( |
Check warning
Code scanning / CodeQL
Unnecessary pass Warning
cemitch99
left a comment
There was a problem hiding this comment.
It looks like one feature still needed for this PR is documentation in a README.
closely match Synergia.
for more information, see https://pre-commit.ci
| model="linear", | ||
| name=nm + "_usedge", | ||
| ) | ||
| pass |
Check warning
Code scanning / CodeQL
Unnecessary pass Warning
linter complaints.
for more information, see https://pre-commit.ci
| 2 * hgap, | ||
| K2=fint, | ||
| location="entry", | ||
| model=de_model, |
Check failure
Code scanning / CodeQL
Potentially uninitialized local variable Error
| 2 * hgap, | ||
| K2=fint, | ||
| location="exit", | ||
| model=de_model, |
Check failure
Code scanning / CodeQL
Potentially uninitialized local variable Error
| radius_of_curvature, | ||
| 2 * hgap, | ||
| K2=fint, | ||
| model=de_model, |
Check failure
Code scanning / CodeQL
Potentially uninitialized local variable Error
| radius_of_curvature, | ||
| 2 * hgap, | ||
| K2=fint, | ||
| model=de_model, |
Check failure
Code scanning / CodeQL
Potentially uninitialized local variable Error
2) A script that parses the lattice with Synergia, converts to ImpactX
format with syn2_to_impactx and runs a simulation.
for more information, see https://pre-commit.ci
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
| pass |
Check warning
Code scanning / CodeQL
Unnecessary pass Warning
|
|
||
| # clean shutdown | ||
| sim.finalize() | ||
| pass |
Check warning
Code scanning / CodeQL
Unnecessary pass Warning
| ref.set_kin_energy_MeV(kin_energy) | ||
|
|
||
| # charge to mass ratio | ||
| qm_eev = 1.0 / (1.0e-9 * mp) |
Check notice
Code scanning / CodeQL
Unused local variable Note
| beta_y = lf.beta.ver | ||
| alpha_y = lf.alpha.ver | ||
| psi_x = lf.psi.hor | ||
| psi_y = lf.psi.ver |
Check notice
Code scanning / CodeQL
Unused local variable Note
| alpha_x = lf.alpha.hor | ||
| beta_y = lf.beta.ver | ||
| alpha_y = lf.alpha.ver | ||
| psi_x = lf.psi.hor |
Check notice
Code scanning / CodeQL
Unused local variable Note
| lattice_raw.set_all_string_attribute("extractor_type", "libff") | ||
|
|
||
| if enable_rf: | ||
| lattice_with_rf = set_rf( |
Check notice
Code scanning / CodeQL
Unused local variable Note
This is the start of an example that demonstrates converting a lattice parsed in Synergia from a MAD-X into an ImpactX lattice.