Command and Developer Surfaces¶
pyGOTM keeps the user surface intentionally small. User commands run models or run the official Frechet validation suite. Developer module commands support report regeneration and execution optimization work.
User Surface¶
Python API¶
Use pygotm.driver.GotmDriver for programmatic single-column runs:
from pygotm.driver import GotmDriver
ds = GotmDriver("path/to/gotm.yaml").run()
ds.to_netcdf("result.nc")
GotmDriver(config).run(...) accepts:
max_stepsOptional integer limit on integration steps.
Noneruns the full configured simulation.output_pathOptional NetCDF path. When set, pyGOTM writes the returned dataset to this file.
outputBoolean.
Truewrites the normal dense output dataset.Falseruns the compiled loop and returns an empty dataset with coordinates only. This mode is mainly useful for internal performance checks.
Command Line¶
pygotm run runs one GOTM YAML file and writes one NetCDF output:
conda run -n pygotm pygotm run path/to/gotm.yaml --output result.nc
Options:
CONFIG_PATHRequired positional path to a GOTM-compatible YAML file.
--output, -o PATHRequired NetCDF output path.
--max-steps NOptional integer limit on integration steps.
--progress {none,json,plain}Emit run-progress events to stderr.
jsonis the stable machine-readable mode; hydro-only runs currently reportprogress_mode: "indeterminate"during integration because the compiled hydro loop runs as one call.--debugShow tracebacks for developer debugging. Without this flag, known errors are reported as concise stderr messages with documented exit codes.
pygotm version prints human-readable runtime versions. pygotm version
--json emits manifest-shaped keys, including pygotm_version,
pygotm_git_commit, dependency versions, and platform.
pygotm schema emits machine-readable schema records:
conda run -n pygotm pygotm schema config --json
conda run -n pygotm pygotm schema output --json --config path/to/gotm.yaml
conda run -n pygotm pygotm schema netcdf-attrs --json
pygotm cite emits curated bibliography records:
conda run -n pygotm pygotm cite --all
conda run -n pygotm pygotm cite --for-config path/to/gotm.yaml --json
conda run -n pygotm pygotm cite --for-output result.nc --json
pygotm serve starts the warm stdin/stdout JSON-RPC daemon. RPC responses
are written only to stdout; progress events and diagnostics go to stderr.
pygotm validate runs the official Frechet parity suite and writes HTML
reports, a lightweight JSON summary, and per-variable JSON results:
conda run -n pygotm pygotm validate --cases couette,channel
The default case set is couette,channel,entrainment. The current default
set exits successfully. --all completes all 22 cases but exits nonzero
until the known full-suite PARTIAL PARITY cases are resolved; see
Test Cases.
Validation runs serially by default. --all only selects the 22-case set;
it does not enable Dask or open a dashboard. To run the full suite through a
local Dask cluster and print the dashboard URL, request more than one worker:
conda run -n pygotm pygotm validate --all --workers 4 --dashboard-port 8787
The dashboard URL is shown only when --workers is greater than 1 and
more than one case is selected. Serial runs and single-case runs do not create
a Dask cluster.
Options:
--cases NAMESComma-separated case names or case/input-yaml-base specs. Defaults to
couette,channel,entrainment. Use this option for a single case too, for example--cases couette.--allRun all 22 GOTM reference cases. Current full-suite validation is expected to complete but return a failure exit status because 7 of 22 cases remain non-PASS.
--group {all,default,non-stim}Run a named case group.
--exclude NAMESComma-separated case names to remove from the selected set.
--device ARCHExecution backend label. The current Numba validation backend is
cpu.--workers NValidation worker count. Default:
1. Values greater than1run cases through a local Dask cluster.--dashboard-port PORTDask dashboard port used only when
--workersis greater than1. Default:8787.--output-dir DIRDirectory for generated NetCDF runs and local validation artifacts. Default:
validation.--report-dir DIRDirectory for generated report HTML and JSON. Default:
<output-dir>/report.--no-runSkip simulation and compare existing NetCDF files under
DIR/runs.--no-warmupSkip Numba warm-up before simulation runs.
--debug-turbulenceWrite per-time turbulence comparison dumps under each run directory.
Developer Surface¶
Frechet validation module command¶
python -m pygotm.validation.run_validation is the developer equivalent of
pygotm validate. It accepts the same options listed above and is the
canonical command used by quality gates and optimization acceptance checks:
conda run -n pygotm python -m pygotm.validation.run_validation \
--cases couette,channel,entrainment
The same serial/Dask rule applies to the module command. Use --workers to
request Dask explicitly:
conda run -n pygotm python -m pygotm.validation.run_validation \
--all --workers 4 --dashboard-port 8787
Report regeneration¶
python -m pygotm.validation.render_report rebuilds HTML reports from
existing NetCDF outputs without rerunning simulations:
conda run -n pygotm python -m pygotm.validation.render_report --all
Options:
--cases NAMESComma-separated cases or case/input-yaml-base specs. Defaults to
couette,channel,entrainment.--allRender all reference cases.
--group {all,default,non-stim}Render a named case group.
--exclude NAMESComma-separated case names to omit.
--workers NReport worker count. Default:
1. Values greater than1render cases through a local Dask cluster.--dashboard-port PORTDask dashboard port used only when
--workersis greater than1. Default:8787.--output-dir DIRDirectory containing
runs/and receiving report HTML. Default:validation.
Execution benchmark¶
python -m pygotm.execution.benchmark is developer-only timing tooling for
optimization work. It does not validate scientific parity; run Frechet
validation separately for acceptance.
conda run -n pygotm python -m pygotm.execution.benchmark \
--cases couette,channel --output-dir validation/benchmark-runs/dev
Options:
--cases NAMESComma-separated reference case names to benchmark. Default:
couette,channel.--max-steps NOptional integer limit on integration steps.
--output-dir DIROptional directory for one aggregate
results.jsonbenchmark artifact.--no-outputDisable dense output buffer conversion for hydro-only timing.
--no-warmupSkip Numba warm-up before the benchmark run.
Surface Boundary¶
The public CLI intentionally does not expose benchmarking. Benchmarks are
developer execution tooling, while pygotm validate is the only user-facing
validation path and always uses the Frechet validation suite.