hmp.check()#
- Command line
hmp check,hmp run - Returns
Diagnostic - Defined in
hydromodpy/project/api.py
-
check(
)[source]#source,*,base=None,partial=True,inputs=False,overlays=(),set=None,environment=None,
Check a configuration, a draft or a file, and return every diagnostic it holds.
A mapping is checked as it stands, as a form being filled would be, against the
baseits relative paths are read from: a mapping without one is refused, asload()refuses it. A path is read ashmp runreads it: thebase_configchain, the project root, the name of the workflow. A[sites]project is expanded case by case, and each issue comes back at the key it reaches. A calibration with nothing to fix and nothing to fill is also read by its preflight.- Parameters:
source (str | PathLike[str] | Mapping[str, Any]) – A path to a TOML file, or the document as a mapping of sections.
base (str | PathLike[str] | None) – The folder relative paths are read from. A mapping needs it.
partial (bool) – True reports a required key not written yet as
to_fill, which stops nothing. False reports it as anerror, whathmp runrefuses.inputs (bool) – True also reads the header of each input file the document names, and downloads nothing.
overlays (Sequence[str | PathLike[str]]) – TOML files merged over a file, then dotted paths and their values, as
hmp run --overlayand--set. A mapping refuses both.set (Mapping[str, Any] | None) – TOML files merged over a file, then dotted paths and their values, as
hmp run --overlayand--set. A mapping refuses both.environment (Environment | None) – The bounds an input header may be read within. The default is the bounds of a bare
Environment.
- Returns:
list of Diagnostic – Empty when the document loads and every rule passes. A diagnostic of a file carries
line_number.- Raises:
TypeError – When source is neither a mapping nor a path.
- Return type:
Keyword arguments and command-line flags#
The twin command is hmp check.
| Keyword | Default | Command-line flag | Accepted by |
|---|---|---|---|
base | None | no flag | every form |
partial | True | --partial | every form |
inputs | False | --inputs | every form |
overlays | () | no flag | every form |
set | None | no flag | every form |
environment | None | no flag | every form |
Flags of hmp check with no keyword: --lang. To get their effect from Python, build the configuration object with the values you want, or write them in the TOML file.