Skip to content

Commit

Permalink
fix importing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
proy30 committed Feb 10, 2025
1 parent 9c14165 commit 1e277c8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
18 changes: 16 additions & 2 deletions src/python/impactx/dashboard/Input/components.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Optional

from .. import setup_server, vuetify
from .. import setup_server, html, vuetify
from .generalFunctions import generalFunctions

server, state, ctrl = setup_server()
Expand Down Expand Up @@ -41,7 +41,21 @@ def documentation_icon(section_name: str) -> vuetify.VIcon:
"""

def open_documentation():
new_url = DashboardDefaults.DOCUMENTATION.get(section_name)
"""
Retrieves the documentation link with the provided section_name
and opens the documentation sidebar on the dashoard.
"""

DOCUMENTATION = {
"input_parameters": "https://impactx.readthedocs.io/en/latest/usage/python.html#impactx.ImpactX",
"lattice_configuration": "https://impactx.readthedocs.io/en/latest/usage/python.html#lattice-elements",
"distribution_parameters": "https://impactx.readthedocs.io/en/latest/usage/python.html#initial-beam-distributions",
"space_charge": "https://impactx.readthedocs.io/en/latest/usage/parameters.html#space-charge",
"csr": "https://impactx.readthedocs.io/en/latest/usage/parameters.html#coherent-synchrotron-radiation-csr",
}


new_url = DOCUMENTATION.get(section_name)
if state.documentation_drawer_open and state.documentation_url == new_url:
state.documentation_drawer_open = False
else:
Expand Down
8 changes: 0 additions & 8 deletions src/python/impactx/dashboard/Input/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,3 @@ class DashboardDefaults:
"beta": "m",
"emitt": "m",
}

DOCUMENTATION = {
"input_parameters": "https://impactx.readthedocs.io/en/latest/usage/python.html#impactx.ImpactX",
"lattice_configuration": "https://impactx.readthedocs.io/en/latest/usage/python.html#lattice-elements",
"distribution_parameters": "https://impactx.readthedocs.io/en/latest/usage/python.html#initial-beam-distributions",
"space_charge": "https://impactx.readthedocs.io/en/latest/usage/parameters.html#space-charge",
"csr": "https://impactx.readthedocs.io/en/latest/usage/parameters.html#coherent-synchrotron-radiation-csr",
}
2 changes: 2 additions & 0 deletions src/python/impactx/dashboard/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from trame.widgets import vuetify as vuetify
from trame.widgets import html

# isort: off

Expand All @@ -20,6 +21,7 @@
__all__ = [
"JupyterApp",
"setup_server",
"html",
"vuetify",
"AnalyzeSimulation",
"NavigationComponents",
Expand Down

0 comments on commit 1e277c8

Please sign in to comment.