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: Add tooltips #843

Merged
merged 6 commits into from
Feb 11, 2025
Merged

Conversation

proy30
Copy link
Member

@proy30 proy30 commented Feb 11, 2025

Replacing #759, resolves #722

The core functionality works by taking a list of class names where the docstrings are located, scanning through each property and method that matches a key in the DEFAULTS dictionary, and then outputting a dictionary with the appropriate tooltip.

For example, in defaults.py we can have something like:

INPUT_PARAMETERS = {
    "charge_qe": -1,
}

When we call:

get_docstrings([RefPart, ImpactX], INPUT_PARAMETERS )

the function iterates through each property and method in the two classes until it finds:

@property
def charge_qe(self) -> float:
    """
    Get reference particle charge (positive elementary charge)
    """

It then appends the extracted docstring to the output dictionary, resulting in something like:

TOOLTIPS = {
    "charge_qe": "Get reference particle charge (positive elementary charge)",
}

Note: The tooltips are not added to the distribution/lattice configuration sections. A separate PR is needed to update defaults.py with the correct defaults to enable tooltips for those sections.

@proy30 proy30 added the component: dashboard our browser based trame dashboard label Feb 11, 2025
@ax3l ax3l added component: documentation Docs, readme and manual component: space charge Space charge & potential solver component: distributions beam distributions component: CSR coherent synchrotron radiation models labels Feb 11, 2025
Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you! :)

@ax3l ax3l merged commit cdf408b into BLAST-ImpactX:development Feb 11, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: CSR coherent synchrotron radiation models component: dashboard our browser based trame dashboard component: distributions beam distributions component: documentation Docs, readme and manual component: space charge Space charge & potential solver
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dashboard] Tooltips
2 participants