Environment variables#

Built from hydromodpy/core/runtime/env.py; the files that read each variable come from a scan of the code each time the site is built. Fix a wrong row there.

47 variables. tests/unit/architecture/test_surfaces.py fails when the code names a HMP_* variable that has no row in the registry, or when a row names a variable nothing reads.

For users#

Variables a person running HydroModPy may set.

Variable

When unset

What it does

Read in

HMP_BIN

bin/ under the cache folder

Folder of the solver binaries, read by every run and never written by one. hmp install-binaries fills it when it is set.

Dockerfile, hydromodpy/core/workspace/workspace.py, tools/docs/check_quickstart.py and 1 more; 8 test files

HMP_CACHE_HOME

the user cache folder of the platform

Root of the machine cache: solver binaries and the downloaded examples.

hydromodpy/core/state/portable.py, tools/docs/check_quickstart.py; 14 test files

HMP_EXAMPLES_SOURCE

the GitHub tag of the installed version

Replaces the whole prefix the example files are fetched from: a URL, a file:// URL or a local checkout. When it is set, --ref no longer applies.

.github/workflows/docs-get-started.yml, hydromodpy/project/examples/blobs.py, tools/docs/check_quickstart.py; 2 test files

HMP_IMAGE_DIGEST

unset, no digest sealed

Digest of the container image, as sha256: and 64 hex characters. The operator sets it when the container starts. A run inside the image seals it in provenance.json, and the server refuses to start without it.

.github/workflows/docker-build.yml, Dockerfile, hydromodpy/core/runtime/image.py; 4 test files

HMP_IMAGE_TAG

unset, not in an image

Tag of the container image. The Dockerfile sets it. Its presence tells HydroModPy that it runs inside the image.

.github/workflows/docker-build.yml, Dockerfile, hydromodpy/core/runtime/image.py; 4 test files

HMP_NO_PROGRESS

unset

Any non-empty value turns off the live progress display on the console.

hydromodpy/catchment/preprocess/catchment_capability.py, hydromodpy/core/console/progress.py, hydromodpy/data/request/job.py and 1 more; 4 test files

HMP_PROGRESS_FILE

unset, no file

Path of an NDJSON file. Each progress event is appended to it as one JSON line, for a supervisor that reads the file while the run goes on.

hydromodpy/core/console/ndjson.py

HMP_SCRATCH_ROOT

runs/<case>/.hmp/scratch/ and <project>/.hmp/scratch/ inside the project

Machine scratch root that replaces the scratch folders inside the project, for example $SLURM_TMPDIR on a cluster node. The solver of a run then works in <root>/<project>/<case>.a<attempt>/ and its preprocessing in <root>/<project>/<case>.p<pid>/. It is never an author key and never part of the config hash.

hydromodpy/core/state/scratch.py; 3 test files

HMP_SET_<key>

unset

hmp run reads each variable that starts with HMP_SET_ as a TOML override. The rest of the name is the key, in its own case, with __ for a dot: HMP_SET_simulation__run_id. The value is parsed as TOML. It wins over --set.

hydromodpy/core/toml_io/overrides.py

HMP_SILENCE_MF6_VERSION_MISMATCH

unset, the warning is shown

Any value other than empty, 0, false or no silences the warning shown when the MODFLOW 6 executable and libmf6 differ in major or minor version.

hydromodpy/solver/modflow_common/binaries.py

HMP_STATE_HOME

the user state folder of the platform

Root of the machine state, the folder of credentials.toml. The test suite points it at its scratch folder.

hydromodpy/core/state/portable.py; 9 test files

HMP_USER

USER or USERNAME, then the system user

Name of the person who acts, written in the audit trail.

hydromodpy/cli/auth.py; 1 test file

HMP_VERBOSITY

normal

Console verbosity: quiet, normal, verbose or debug. The command line reads --verbosity first, then this variable, then [workflow] verbosity.

hydromodpy/catchment/preprocess/catchment_capability.py, hydromodpy/core/logging.py, hydromodpy/data/request/job.py and 1 more; 4 test files

HMP_WORKSPACE

the workspace found above the current folder, then ~/hydromodpy

Workspace root of the catalog, project and run commands when the command line gives none.

hydromodpy/cli/commands/ls.py, hydromodpy/cli/refs.py, hydromodpy/core/workspace/config.py and 4 more; 17 test files

For debugging#

Variables that trace or keep intermediate files, or that HydroModPy sets itself.

Variable

When unset

What it does

Read in

HMP_ALLOW_LEGACY_NPY_VALIDATION

unset, refused

1 lets the loaders of the validation cases read results saved as legacy .npy files.

validation_cases/shared/loaders.py

HMP_DETERMINISTIC_FETCHED_AT

unset, the fetch time is written

1 writes no fetched_at in the provenance sidecar of a downloaded file, so the sidecar is the same bytes on every run.

hydromodpy/data/provenance/sidecars.py; 2 test files

HMP_KEEP_TRIAL_SCRATCH

unset, removed

Any value other than empty, 0, false or no keeps the solver folder of each calibration trial and the preprocessing tree of the session.

hydromodpy/calibration/runners/sandbox.py; 2 test files

HMP_LAUNCHED_CASE

unset, hmp run refreshes the index of the project after its run

Set by a launcher (local, or the scheduler) for each case it starts, never by hand. The worker then leaves the index to the launcher, which refreshes it after every case.

hydromodpy/project/launch/env.py; 1 test file

HMP_OUT_PATH

hydromodpy_validation_outputs in the system temporary folder

Output root of the validation cases and of the investigation scripts under tools/. The validation results land under <HMP_OUT_PATH>/validation.

validation_cases/numerical/transient/boussinesq_hillslope_recharge_pulse_overflow_1d/run_multi_solver_case.py, validation_cases/shared/cli.py, validation_cases/shared/runtime.py; 4 test files

HMP_PANDERA_STRICT

unset, a warning is logged

1, true, yes or on makes a failed pandera schema check of an ingested table raise instead of logging a warning.

hydromodpy/data/schemas/validation.py

HMP_THREADS_PER_CASE

unset, the native libraries choose their pool size

Threads one case may use, [sites.run] threads_per_case. Set by the launcher and by the array script for each case. The worker limits its native thread pools (threadpoolctl) and sets OMP_NUM_THREADS and its siblings for the processes it starts.

hydromodpy/project/launch/env.py; 1 test file

HMP_VALIDATION_RESULTS_FILE

unset, the snapshot committed in docs/source/theory/

A results file written by tools/docs/validation_results.py merge that a docs build reads instead of the committed snapshot, to show fresh local measures without changing a tracked file.

docs/source/_ext/hmp_validation.py

HMP_WHITEBOX_REDIRECT_NATIVE_STDIO

redirect outside pytest, not under pytest

Forces whether the native output of Whitebox is redirected at the file descriptor level. The test suite sets 0.

hydromodpy/catchment/delineation/whitebox_workflows_backend/raster.py; 2 test files

HMP_WHITEBOX_VERBOSE

unset, quiet

A true value (1, true, yes, on) turns on the verbose mode of Whitebox.

hydromodpy/catchment/delineation/whitebox_workflows_backend/raster.py; 2 test files

For the test suite#

Variables read by the tests and the validation cases.

Variable

When unset

What it does

Read in

HMP_COVERAGE

unset

Any non-empty value runs the subprocesses of the regression tests and of the validation cases under a coverage wrapper.

validation_cases/shared/runtime.py; 1 test file

HMP_MUTMUT_PYTHON

unset

The Python that has mutmut 3.8.0. The two real proofs of tests/unit/tools/test_ci_proof.py skip when it is unset.

tests/unit/tools/test_ci_proof.py

HMP_REPLAY_REPORT

unset, the frozen replay writes no report

A file path: the frozen MODFLOW 6 replay test writes there the class and the gaps it measured, before any assertion.

.github/workflows/ci-weekly.yml; 1 test file

HMP_REQUIRE_BINARIES

unset, a port test whose solver binary is absent is skipped

Set in CI or on a machine with the solver binaries: a port test whose solver binary is absent fails instead of skipping (tests/ports/conftest.py).

.github/workflows/main-ci.yml; 1 test file

HMP_REQUIRE_GMSH

unset, an engine that needs gmsh is skipped without it

Any non-empty value makes the mesh port tests, and the solver port tests whose mesh engine needs gmsh, fail instead of skipping when gmsh is missing or a built-in engine cannot be loaded.

.github/workflows/main-ci.yml; 2 test files

HMP_REQUIRE_SYBIL

unset, the page blocks are skipped without sybil

Any non-empty value makes the test of the Python blocks of Get started fail when sybil is not installed, instead of skipping.

.github/workflows/docs.yml; 1 test file

HMP_REQUIRE_WINDOWS

unset, a Windows test is skipped on another system

Any non-empty value makes a test marked windows fail instead of skipping, so the Windows job cannot go green without playing every Windows proof.

.github/workflows/ci-weekly.yml; 2 test files

HMP_RUN_HUBEAU_NETWORK_TESTS

unset, skipped

1 runs the integration tests that call the Hub’Eau water-quality API.

tests/integration/data_managers/test_loaders_api_wq_integration.py

HMP_RUN_IGN_ASSEMBLY_TESTS

unset, skipped

1 runs the integration test that downloads, extracts, merges and crops a real IGN DEM.

tests/integration/test_geoplateforme_dem_network.py

HMP_RUN_IGN_DOWNLOAD_TESTS

unset, skipped

1 runs the integration test that downloads one real IGN DEM archive.

tests/integration/test_geoplateforme_dem_network.py

HMP_RUN_IGN_NETWORK_TESTS

unset, skipped

1 runs the integration tests that call the IGN DEM service.

tests/integration/test_geoplateforme_dem_network.py

HMP_TEST_SCRATCH_OWNER

set by the first pytest process

Token of the pytest process that owns the scratch session. The workers and the subprocesses inherit it, so only the owner cleans the session.

tests/conftest.py

HMP_TEST_SCRATCH_ROOT

hydromodpy_tests in the system temporary folder

Scratch root of pytest and of the subprocesses it starts. Point it at a disk folder when the temporary folder is a small RAM disk.

.github/workflows/ci-weekly.yml, tools/ci/removal_proof.py, tools/dev/test.py; 3 test files

HMP_TEST_SESSION_SCRATCH_ROOT

a new folder under the scratch root

Scratch folder of one test session. Set by the test conftest and by python -m tools.dev test, inherited by the subprocesses.

tools/dev/test.py; 2 test files

HMP_VALIDATION_RESULTS

unset, nothing recorded

Directory where the validation tests write their measured values, thresholds, curves and outcomes, one part-*.json per pytest process. tools/docs/validation_results.py merges them into the Validation page.

.github/workflows/ci-nightly-petsc.yml, .github/workflows/ci-nightly.yml; 1 test file

For the documentation build#

Variables read by the build of this site.

Variable

When unset

What it does

Read in

HMP_CHROMIUM

unset, --chromium or the browser found on the PATH

Chromium executable of the browser probe of the built site (tools/docs/site_probe.py).

tools/docs/site_probe.py

HMP_DOCS_COMMIT

unset, GITHUB_SHA then git rev-parse HEAD

Commit the [source] links of the Python reference point to.

docs/source/_ext/hmp_api.py

HMP_DOCS_GOATCOUNTER_URL

unset, no tracking

GoatCounter count endpoint. When set, the pages count their views.

docs/source/_ext/hmp_directives.py

HMP_DOCS_QUIET

1

Read by docs/Makefile. 1 filters known noise from the build output, 0 shows the raw stream.

docs/Makefile

HMP_DOCS_REPO

https://github.com/HydroModPy/HydroModPy

Repository the [source] links of the Python reference point to.

docs/source/_ext/hmp_api.py

HMP_DOC_VERSION

main

Version folder the site is built for: canonical URL and version switcher. The deploy workflow sets it.

.github/workflows/docs-deploy-pages.yml, docs/source/conf.py

HMP_SKIP_CONTRACT_TABLES_GEN

unset, regenerated

1 skips the regeneration of the layer-matrix fragment at build time.

docs/source/conf.py

HMP_SKIP_DOC_DATA

unset, regenerated

1 reuses the _data/*.json files of the previous build, when they exist.

docs/source/_ext/hmp_params.py; 1 test file