cfd-solver-gui — Developer Onboarding
Table of Contents
1. What This Repo Is
cfd-solver-gui is a PySide6 desktop frontend for the companion Fortran
solver in ../cfd-solver. The GUI does not link against solver code directly:
it writes a Fortran namelist, launches the solver as an external process, and
reads back snapshot.dat / result.dat style outputs.
Keep these boundaries in mind from day one:
src/cfd_gui/namelist_io.pyis the GUI-side source of truth for solver parameters.- The solver CLI contract is fixed: the GUI launches the solver with one
positional argument, the path to a
.nmlfile. - Output files are a shared contract with the solver repo, not GUI-private implementation details.
If you touch namelist keys, scheme names, solver CLI behavior, or output-file
formats, inspect the matching code in ../cfd-solver before you finalize the
change.
2. 10-Minute Local Setup
Install the GUI in editable mode with the contributor toolchain:
pip install -e '.[dev]' pre-commit install
Run the app:
cfd-gui # or python -m cfd_gui
Run the main validation commands:
pytest pytest -m "not qt" ruff check src/ mypy src/ mkdocs build --strict
The docs build expects emacs to be available on your PATH so the Org files
can be exported during the MkDocs build.
If the solver binary is not already on your PATH, build it from
../cfd-solver and then point the GUI at the resulting euler_1d executable
through Solver → Set Solver Binary….
For live docs preview during writing, use:
mkdocs serve
3. Core Mental Model
There are three ideas worth memorizing early:
- Schema-driven UI. The parameter editor is generated from
SCHEMAinsrc/cfd_gui/namelist_io.py. Most parameter work starts there, not in widget code. - The solver is a subprocess. The GUI launches it through Qt process plumbing and reacts to structured events instead of embedding solver logic directly.
- Files are the contract.
input.nml,snapshot.dat,result.dat,run_manifest.json, andevents.jsonlform the durable boundary between the GUI and the compute run.
When a bug feels “UI-ish,” first ask which layer actually owns the behavior: schema, process control, file parsing, plotting, or the solver itself.
4. Where To Look First
src/cfd_gui/namelist_io.py— parameter schema, namelist parsing/writingsrc/cfd_gui/config_editor.py— schema-driven widget generationsrc/cfd_gui/main_window.py— main window actions, run flow, status/log UIsrc/cfd_gui/run_manager.py— durable run directory and worker orchestrationsrc/cfd_gui/run_worker.py— worker-side solver launch and event streamsrc/cfd_gui/snapshot_monitor.py— snapshot parsing and live-update logicsrc/cfd_gui/settings.py— solver binary discovery and persistent settingstests/— behavior contracts and regression coverage
For the GUI-heavy modules, start with the developer guide's architecture sections before reading class-by-class code.
5. Documentation Map
README.md— lean first-contact page: quick orientation, minimal install/run commands, and links to the real manualsdoc/onboarding.org— this contributor starting pointdoc/developer-guide.org— authoritative maintainer manual: architecture, module responsibilities, and change recipesdoc/user-guide.org— authoritative end-user manual: install, run, and UI behaviorAGENT_GUIDE.md— canonical contributor and agent workflow rules, documentation-maintenance policy, and validation commands
Treat the Org files in doc/ as the canonical narrative docs. Keep
README.md short and update it only when the first-contact quickstart needs
to change. The generated MkDocs site is derived output for browsing and API
reference, not a second place to maintain the same prose by hand.
6. Common Pitfalls
- Schema coupling: adding or renaming a solver parameter means updating both the GUI schema and the matching solver-side contract.
- CLI assumptions: do not change how the GUI launches the solver without
coordinating the GUI and
../cfd-solvertogether. - Output-format drift: parser changes for
snapshot.dat/result.datmust stay aligned with the solver's actual file format. - Qt test split: pure-Python tests and
@pytest.mark.qttests serve different purposes; use both tiers appropriately. - Narrative docs vs. summaries: update the Org sources first, then trim or
relink
README.mdif the change affects first-contact guidance. Do not hand-edit derived site output.
When in doubt, read AGENT_GUIDE.md first, then confirm the current behavior
in tests before changing the implementation.