Skip to content

visualdynamics.gui.ask

ask

File dialogs for the one-call workflows.

The scripted entry points take paths. When one is left out, this is where the question gets asked — a dialog rather than a refusal, so visualdynamics.random_vibration_report() on its own is a working thing to type (Brandon, 2026-09-22).

It lives in gui/ because Qt does, and the workflows reach it by a function-local import: project.py stays Qt-free, and a script that passes every path never loads a widget toolkit at all.

Functions:

Name Description
for_runs

Controller runs to work up, chosen by the user. Empty if none.

for_geometry

One geometry, or None when the user cancels.

Functions:

for_runs

for_runs(title: str = 'Select the runs to report on') -> list[str]

Controller runs to work up, chosen by the user. Empty if none.

Several at once on purpose: a test campaign is a folder of runs and the answer to each is its own report.

Source code in src/visualdynamics/gui/ask.py
def for_runs(title: str = 'Select the runs to report on') -> list[str]:
    """Controller runs to work up, chosen by the user. Empty if none.

    Several at once on purpose: a test campaign is a folder of runs and
    the answer to each is its own report.
    """
    from PySide6.QtWidgets import QFileDialog

    _application()
    paths, _ = QFileDialog.getOpenFileNames(None, title, '', RUN_FILTER)
    return [str(p) for p in paths]

for_geometry

for_geometry(title: str = 'Select a geometry (Cancel for none)') -> str | None

One geometry, or None when the user cancels.

Cancel is an answer, not a failure: a report without a geometry is a report, and its sections stand down on their own.

Source code in src/visualdynamics/gui/ask.py
def for_geometry(title: str = 'Select a geometry (Cancel for none)'
                 ) -> str | None:
    """One geometry, or None when the user cancels.

    Cancel is an answer, not a failure: a report without a geometry is
    a report, and its sections stand down on their own.
    """
    from PySide6.QtWidgets import QFileDialog

    _application()
    path, _ = QFileDialog.getOpenFileName(None, title, '', GEOMETRY_FILTER)
    return str(path) or None