Skip to content
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

Dashboard File Importing #785

Merged
merged 2 commits into from
Feb 7, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix exportTemplate.py
Was not properly displaying the correct information when both space charge and csr were selected
  • Loading branch information
proy30 committed Jan 23, 2025
commit db39d7c9d3fe2cefd71a744d70923f694bacbef9
21 changes: 12 additions & 9 deletions src/python/impactx/dashboard/Toolbar/exportTemplate.py
Original file line number Diff line number Diff line change
@@ -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}'
@@ -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}
"""
Loading