thunder4d.gui
Graphical interface (optional: uv add "thunder4d[gui]"), see Graphical interface. Importing
thunder4d.gui and thunder4d.gui.registry does not import Qt.
- thunder4d.gui.main(argv=None)[source]
Entry point of the
thunder4d-guicommand (thunder4d-gui [input.json]). Returns 1, with the install command, when PySide6 is missing.
Registries
- thunder4d.gui.registry.PANELS
- thunder4d.gui.registry.PLOTS
- thunder4d.gui.registry.METRICS
Ordered collections of specs, indexed by key:
register(spec, replace=False),unregister(key), iteration byorderthen registration order.
- class thunder4d.gui.registry.PanelSpec(key, title, factory, order=100.0, tooltip='')[source]
A tab of the main window;
factory(session)returns its widget. The session holds the current input (config, signalconfig_changed) and results (results,results_changed);session.show_panel(key)brings another tab to the front. A panel with acan_close()method is asked before the window closes.
- class thunder4d.gui.registry.PlotSpec(key, title, draw, requires=(), order=100.0, group='', per_pass=False, data=None)[source]
A figure of the results viewer.
draw(results, fig, options)fills a matplotlibFigure;options["index"]is the selected record whenper_pass. Offered only when every key ofrequiresis in the results.data(results, options)returns the arrays written by Export data (default: therequiresarrays).
Results and background tasks
- class thunder4d.gui.results.Results(data, path=None)
The arrays of a saved run, by key (a
dict), withpath,grid()(the simulation grid, rebuilt on the CPU) andcache(derived quantities).load_results(path)reads a.npz.
- class thunder4d.gui.worker.Task(work)
work(task)run on a background thread (aQThread). Signals:output(each printed line),progress(task.report(value)),succeeded(result),failed(traceback),cancelled.task.cancel()makes the nexttask.check()raiseCancelled.