Skip to content

Commit

Permalink
Fix exportTemplate.py
Browse files Browse the repository at this point in the history
Was not properly displaying the correct information when both space charge and csr were selected
  • Loading branch information
proy30 committed Jan 23, 2025
1 parent e2de344 commit db39d7c
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/python/impactx/dashboard/Toolbar/exportTemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ def build_space_charge_or_csr():
Generates simulation content for space charge
and csr.
"""
content = ""

if state.space_charge:
content = f"""# Space Charge
sim.csr = {state.csr}
content += f"""# Space Charge
sim.space_charge = {state.space_charge}
sim.dynamic_size = {state.dynamic_size}
sim.poisson_solver = '{state.poisson_solver}'
Expand All @@ -81,15 +82,17 @@ def build_space_charge_or_csr():
sim.mlmg_absolute_tolerance = {state.mlmg_absolute_tolerance}
sim.mlmg_max_iters = {state.mlmg_max_iters}
sim.mlmg_verbosity = {state.mlmg_verbosity}
"""
elif state.csr:
content = f"""# Coherent Synchrotron Radiation
sim.space_charge = {state.space_charge}
"""
if state.csr:
content += f"""# Coherent Synchrotron Radiation
sim.csr = {state.csr}
sim.particle_shape = {state.particle_shape}
sim.csr_bins = {state.csr_bins}
"""
else:
"""
if not state.space_charge:
content += f"""
sim.particle_shape = {state.particle_shape}
"""
if not content:
content = f"""
sim.particle_shape = {state.particle_shape}
"""
Expand Down

0 comments on commit db39d7c

Please sign in to comment.