[sites]#
The catchments of a project and the recipes run on each of them.
sites[table] · optional · 39 user keys, 3 dev or expert- Start a file:
hmp config template --modules sites(download it), thenhmp check file.toml. Minimal file
Connections found in the code (1)
- The code says
site.name:...: no bind line names the site; write [sites.bind] "site.name" = "<column>".
# table = "sites.csv"Site table, one row per catchment: CSV, Parquet or GeoPackage, relative to the project root. example value
- Path
sites.table- More
Its columns are free and reach the config through [sites.bind]. Unset, the plan reads data/sites/catalog.csv of the workspace, whose columns are fixed and need no bind.
- Accepted
- path
- Example
"sites.csv"
# recipes_table = "recipes.csv"Recipe table, one row per recipe: a CSV with a mandatory 'recipe' column; its other columns are bound by [sites.bind] like the site table. example value
- Path
sites.recipes_table- More
A column present in both tables is refused.
- See
- sites.bind
- Accepted
- path
- Example
"recipes.csv"
# enabled = "enabled"Boolean column of the site table; unset, every row is a site of the plan. example value
- Path
sites.enabled- Accepted
- string
- Example
"enabled"
# include = []Site names the plan keeps; empty, every site.
- Path
sites.include- Accepted
- list of string
# exclude = []Site names the plan leaves out.
- Path
sites.exclude- Accepted
- list of string
# overrides = "site_overrides/"Folder of per-site overlays, relative to the project root: <folder>/<site>.toml is applied to every case of that site when it exists. example value
- Path
sites.overrides- Accepted
- path
- Example
"site_overrides/"
# bind = {}Config keys filled from table columns: a quoted dotted path, the grammar of hmp run --set without index, mapped to a column, or to a list of columns for a list key.
- Path
sites.bind- More
The cell is read by the type of the target field; an empty cell leaves the key unbound.
- Accepted
- table { key = string or list of string }
- Example
{ geographic.catchment.x_outlet = "x_outlet" }
[sites]
# table = "sites.csv"
# recipes_table = "recipes.csv"
# enabled = "enabled"
# include = []
# exclude = []
# overrides = "site_overrides/"
# bind = {}sites.table table not set “sites.csv” Site table, one row per catchment: CSV, Parquet or GeoPackage, relative to the project root. Its columns are free and reach the config through [sites.bind]. Unset, the plan reads data/sites/catalog.csv of the workspace, whose columns are fixed and need no bind. sites.recipes_table recipes_table not set “recipes.csv” Recipe table, one row per recipe: a CSV with a mandatory ‘recipe’ column; its other columns are bound by [sites.bind] like the site table. A column present in both tables is refused. sites.enabled enabled not set “enabled” Boolean column of the site table; unset, every row is a site of the plan. sites.include include [] Site names the plan keeps; empty, every site. sites.exclude exclude [] Site names the plan leaves out. sites.overrides overrides not set “site_overrides/” Folder of per-site overlays, relative to the project root: <folder>/<site>.toml is applied to every case of that site when it exists. sites.bind bind {} { geographic.catchment.x_outlet = “x_outlet” } Config keys filled from table columns: a quoted dotted path, the grammar of hmp run –set without index, mapped to a column, or to a list of columns for a list key. The cell is read by the type of the target field; an empty cell leaves the key unbound.
[sites.recipes.<name>]#
A recipe written inline: a TOML file and the keys it sets on top of it.
One table per name you choose: [sites.recipes.<name>]. The name is free text.
file = "project.toml"TOML file the recipe starts from, relative to the project root. required example value
- Path
sites.recipes.<name>.file- More
The resolved file is the case before the keys of 'set' are applied.
- Accepted
- path
- Example
"project.toml"
# set = {}Keys this recipe writes on top of its file, as quoted dotted paths ("flow.param.K.field.value" = 2e-5), the grammar of hmp run --set, without index.
- Path
sites.recipes.<name>.set- More
They are the recipe's own keys: they win over the site table and the site overlays.
- See
- flow.param.K.field.value"
- Accepted
- table { key = any value }
- Example
{ flow.param.K.field.value = 2e-05 }
[sites.recipes.<name>]
file = "project.toml"
# set = {}sites.recipes.<name>.file file “project.toml” TOML file the recipe starts from, relative to the project root. The resolved file is the case before the keys of ‘set’ are applied. sites.recipes.<name>.set set {} { flow.param.K.field.value = 2e-05 } Keys this recipe writes on top of its file, as quoted dotted paths (“flow.param.K.field.value” = 2e-5), the grammar of hmp run –set, without index. They are the recipe’s own keys: they win over the site table and the site overlays.
[sites.design]#
Points of an experiment plan, drawn when the plan is expanded.
# method = "sobol"Design that places the points in the box of the parameters. sobol: scrambled Sobol sequence, nested: doubling n keeps the first points; lhs: Latin hypercube, one point per stratum, grown by independent lots; grid: regular grid, its size is the product of points_per_dim.
- Path
sites.design.method- More
Each point becomes a recipe: p0001, p0002 for sobol and grid, b1p0001 for the first point of the first lot of lhs.
- Accepted
- string
- Example
"sobol"
# n = 64Number of points. example value
- Path
sites.design.n- More
Required for sobol and lhs, refused for grid whose size is the product of options.points_per_dim. For lhs a list gives the size of each lot: [60, 60] adds a second lot of 60 points to a first one already run, and the first lot does not move. A sobol size that is not a power of two warns, its balance holds for powers of two.
- Accepted
- integer or list of integer
- Example
64,[60, 60]
# seed = 1Seed of the draw, required for sobol and lhs. - >= 0 example value
- Path
sites.design.seed- More
Without it every expansion would draw other points, give other solution keys to the same case names and run everything again.
- Accepted
- integer
- Valid range
- >= 0 (refused outside)
- Unit
- -
- Example
1
# recipe = "base"Recipe of [sites.recipes] that the points replace, and whose file and set they start from. example value
- Path
sites.design.recipe- More
Required if the project declares several recipes. The other recipes run once per site as before.
- See
- sites.recipes
- Accepted
- string
- Example
"base"
# options = {}Options of the method: optimization (random-cd or lloyd) for lhs, points_per_dim for grid.
- Path
sites.design.options- More
The number of points is n, never an option.
- Accepted
- table { key = any value }
- Example
{ optimization = "random-cd" }
[sites.design]
# method = "sobol"
# n = 64
# seed = 1
# recipe = "base"
# options = {}sites.design.method method “sobol” “sobol” Design that places the points in the box of the parameters. sobol: scrambled Sobol sequence, nested: doubling n keeps the first points; lhs: Latin hypercube, one point per stratum, grown by independent lots; grid: regular grid, its size is the product of points_per_dim. Each point becomes a recipe: p0001, p0002 for sobol and grid, b1p0001 for the first point of the first lot of lhs. sites.design.n n not set 64 [60, 60] - Number of points. Required for sobol and lhs, refused for grid whose size is the product of options.points_per_dim. For lhs a list gives the size of each lot: [60, 60] adds a second lot of 60 points to a first one already run, and the first lot does not move. A sobol size that is not a power of two warns, its balance holds for powers of two. sites.design.seed seed not set 1 - Seed of the draw, required for sobol and lhs. Without it every expansion would draw other points, give other solution keys to the same case names and run everything again. sites.design.recipe recipe not set “base” Recipe of [sites.recipes] that the points replace, and whose file and set they start from. Required if the project declares several recipes. The other recipes run once per site as before. sites.design.options options {} { optimization = “random-cd” } Options of the method: optimization (random-cd or lloyd) for lhs, points_per_dim for grid. The number of points is n, never an option.
[sites.design.parameters.<name>]#
User declaration for one calibrated parameter.
One table per name you choose: [sites.design.parameters.<name>]. The name is free text.
# bounds = ‹list of number›[low, high] physical bounds, in 'units' when the file writes it, else in the unit the target declares. exactly 2 items
- Path
sites.design.parameters.<name>.bounds- More
Falls back to what the field annotates when the file omits it, which most fields deliberately leave unset because a range belongs to the site.
- Accepted
- list of number
- Valid range
- exactly 2 items (refused outside)
# search_space = "identity"Space the search walks the parameter in.
- Path
sites.design.parameters.<name>.search_space- More
'log' for strictly-positive quantities spanning orders of magnitude. Unset, the target's own field decides: a hydraulic conductivity declares 'log' where it is defined, so a file states this only to depart from it.
- Values
"identity": Searches the value as written."log": Searches the logarithm of the value: for a positive quantity that spans orders of magnitude."logit": Searches log(x / (1 - x)): for a share strictly between 0 and 1. Both bounds must lie inside (0, 1).
- Accepted
- "identity" | "log" | "logit"
- Was
calibration.parameters.transform
# sampling = "uniform"Distribution, between the bounds, that starting points, random draws and Bayesian samplers take values from.
- Path
sites.design.parameters.<name>.sampling- Values
"uniform": Every value between the bounds is equally likely."log_uniform": Every decade between the bounds is equally likely."normal": A normal law centred between the bounds, with a standard deviation of a sixth of their span, cut at the bounds.
- Accepted
- "uniform" | "log_uniform" | "normal"
- Was
calibration.parameters.prior
# path = ‹string›Dotted TOML path of the value to move, such as 'flow.param.K.field.value'.
- Path
sites.design.parameters.<name>.path- More
Optional, and the way out rather than the way in: when omitted, the section name is resolved against the project catalogue ('hmp config targets' lists it). Write one to reach a value the catalogue does not carry, or to settle a name two targets answer to. A path written here wins without a lookup. When the catalogue carries it, the parameter inherits the field's space and draw like a named one; when it does not, nothing is inherited and the sample is written as it is drawn.
- Accepted
- string
# target = ‹string›Readable alias for 'path'.
- Path
sites.design.parameters.<name>.target- More
Setting both is refused.
- Accepted
- string
# mode = "replace"'replace' writes the sampled value as-is; 'scale' multiplies the base TOML value at the target path by the sample.
- Path
sites.design.parameters.<name>.mode- Values
"replace""scale"
- Accepted
- "replace" | "scale"
# units = "m/s"Unit the bounds are written in, such as 'm/s'. example value
- Path
sites.design.parameters.<name>.units- More
For a parameter the catalogue resolves, bounds in another unit of the same quantity are converted when the file loads into the unit the target is read in, and the search draws, writes and reports its samples in that unit ('hmp config targets' lists it). A unit of another quantity is refused. Unset, the unit of the target applies. With mode = 'scale' the bounds are factors without a unit, and writing one is refused. For a path outside the catalogue it is the unit the bounds are checked against the physical range in.
- Accepted
- string
- Example
"m/s"
[sites.design.parameters.<name>] # bounds = <list of number> # search_space = "identity" # sampling = "uniform" # path = <string> # target = <string> # mode = "replace" # units = "m/s"
sites.design.parameters.<name>.bounds bounds not set [low, high] physical bounds, in ‘units’ when the file writes it, else in the unit the target declares. Falls back to what the field annotates when the file omits it, which most fields deliberately leave unset because a range belongs to the site. sites.design.parameters.<name>.search_space search_space “identity” identity log logit identity Searches the value as written. log Searches the logarithm of the value: for a positive quantity that spans orders of magnitude. logit Searches log(x / (1 - x)): for a share strictly between 0 and 1. Both bounds must lie inside (0, 1). Space the search walks the parameter in. ‘log’ for strictly-positive quantities spanning orders of magnitude. Unset, the target’s own field decides: a hydraulic conductivity declares ‘log’ where it is defined, so a file states this only to depart from it. sites.design.parameters.<name>.sampling sampling “uniform” uniform log_uniform normal uniform Every value between the bounds is equally likely. log_uniform Every decade between the bounds is equally likely. normal A normal law centred between the bounds, with a standard deviation of a sixth of their span, cut at the bounds. Distribution, between the bounds, that starting points, random draws and Bayesian samplers take values from. sites.design.parameters.<name>.path path not set Dotted TOML path of the value to move, such as ‘flow.param.K.field.value’. Optional, and the way out rather than the way in: when omitted, the section name is resolved against the project catalogue (‘hmp config targets’ lists it). Write one to reach a value the catalogue does not carry, or to settle a name two targets answer to. A path written here wins without a lookup. When the catalogue carries it, the parameter inherits the field’s space and draw like a named one; when it does not, nothing is inherited and the sample is written as it is drawn. sites.design.parameters.<name>.target target not set Readable alias for ‘path’. Setting both is refused. sites.design.parameters.<name>.mode mode “replace” replace scale ‘replace’ writes the sampled value as-is; ‘scale’ multiplies the base TOML value at the target path by the sample. sites.design.parameters.<name>.units units not set “m/s” Unit the bounds are written in, such as ‘m/s’. For a parameter the catalogue resolves, bounds in another unit of the same quantity are converted when the file loads into the unit the target is read in, and the search draws, writes and reports its samples in that unit (‘hmp config targets’ lists it). A unit of another quantity is refused. Unset, the unit of the target applies. With mode = ‘scale’ the bounds are factors without a unit, and writing one is refused. For a path outside the catalogue it is the unit the bounds are checked against the physical range in.
[sites.run]#
How the cases of a [sites] project are run side by side.
# parallel = 8Total budget of solves that run side by side. - >= 1
- Path
sites.run.parallel- More
A case whose [calibration] parallel is 5 takes 5 of it. The default is 8 because the throughput levelled off from 8 runs side by side on 22 cores, each run holding up to 1.2 GiB. Above 16 the launcher refuses without --force (16 runs held 14 GiB), and above 8 for a campaign that holds a calibration.
- Accepted
- integer
- Valid range
- >= 1 (refused outside)
- Unit
- -
- Example
8
# on_error = "warn"What a failed case does to the launch.
- Path
sites.run.on_error- Values
"warn": The failure is recorded and the other cases go on."raise": The launch stops at the first failed case.
- Accepted
- "warn" | "raise"
# threads_per_case = 1Threads one case may use, applied by the case process itself to its numerical libraries and its child processes. - >= 1 dev
- Path
sites.run.threads_per_case- More
Shown by --dry-run. The default is 1: one run already kept about 1.8 cores busy, and parallel times threads_per_case above the cores is refused without --force.
- Accepted
- integer
- Valid range
- >= 1 (refused outside)
- Unit
- -
# keep_attempts = 1Earlier attempts of a case kept under runs/<case>/attempts/ when a fresh attempt starts. - >= 0 dev
- Path
sites.run.keep_attempts- More
Shown by --dry-run.
- Accepted
- integer
- Valid range
- >= 0 (refused outside)
- Unit
- -
# prepare_parallel = 2Cases prepared side by side before the solves: the geography and the data of each case. - >= 1 dev
- Path
sites.run.prepare_parallel- More
Two cases of one site are never prepared together, since they write the same data files. Above 8 the launcher refuses without --force: 16 runs writing the data cache at once lost a write.
- Accepted
- integer
- Valid range
- >= 1 (refused outside)
- Unit
- -
[sites.run] # parallel = 8 # on_error = "warn"
sites.run.parallel parallel 8 8 - Total budget of solves that run side by side. A case whose [calibration] parallel is 5 takes 5 of it. The default is 8 because the throughput levelled off from 8 runs side by side on 22 cores, each run holding up to 1.2 GiB. Above 16 the launcher refuses without –force (16 runs held 14 GiB), and above 8 for a campaign that holds a calibration. sites.run.on_error on_error “warn” warn raise warn The failure is recorded and the other cases go on. raise The launch stops at the first failed case. What a failed case does to the launch. sites.run.threads_per_case threads_per_case 1 - Threads one case may use, applied by the case process itself to its numerical libraries and its child processes. Shown by –dry-run. The default is 1: one run already kept about 1.8 cores busy, and parallel times threads_per_case above the cores is refused without –force. sites.run.keep_attempts keep_attempts 1 - Earlier attempts of a case kept under runs/<case>/attempts/ when a fresh attempt starts. Shown by –dry-run. sites.run.prepare_parallel prepare_parallel 2 - Cases prepared side by side before the solves: the geography and the data of each case. Two cases of one site are never prepared together, since they write the same data files. Above 8 the launcher refuses without –force: 16 runs writing the data cache at once lost a write.
[sites.summary]#
What summary/ of a [sites] project tabulates and draws.
# metrics = ["nse"]Metrics of each case put in the summary tables, scored by the metric rule.
- Path
sites.summary.metrics- Accepted
- list of string
- Example
["nse", "kge"]
# rank_by = "nse"Metric that ranks the cases of a site to pick its best one, by the direction of the metric.
- Path
sites.summary.rank_by- More
The nse is always a column of the tables; any other one must be in metrics. The order of metrics does not choose it.
- Accepted
- string
- Example
"kge"
# parameters = []Parameters of each case put in the summary tables, calibrated or set.
- Path
sites.summary.parameters- Accepted
- list of string
- Example
["K", "Sy"]
# figures = []Cohort figures drawn under summary/figures/<figure>_<variable>.png: map, distribution.
- Path
sites.summary.figures- Accepted
- list of string
- Example
["map", "distribution"]
# variable = []Metric or parameter, or a list of them, the cohort figures map and distribute.
- Path
sites.summary.variable- Accepted
- list of string
- Example
["K", "nse"]
# best = "calibrated"Which case of a site the by-site table keeps as its best.
- Path
sites.summary.best- Values
"calibrated": The best calibrated case of the site, scored in its calibration window or out of it (evaluated)."any": The best case of the site, calibrated or not.
- Accepted
- "calibrated" | "any"
# columns = []Extra columns read from the manifest.json of each run, as dotted paths without index (checks.budget_pct, metrics.nse).
- Path
sites.summary.columns- Accepted
- list of string
- Example
["checks.budget_pct", "checks.converged"]
[sites.summary] # metrics = ["nse"] # rank_by = "nse" # parameters = [] # figures = [] # variable = [] # best = "calibrated" # columns = []
sites.summary.metrics metrics [“nse”] [“nse”, “kge”] Metrics of each case put in the summary tables, scored by the metric rule. sites.summary.rank_by rank_by “nse” “kge” Metric that ranks the cases of a site to pick its best one, by the direction of the metric. The nse is always a column of the tables; any other one must be in metrics. The order of metrics does not choose it. sites.summary.parameters parameters [] [“K”, “Sy”] Parameters of each case put in the summary tables, calibrated or set. sites.summary.figures figures [] [“map”, “distribution”] Cohort figures drawn under summary/figures/<figure>_<variable>.png: map, distribution. sites.summary.variable variable [] [“K”, “nse”] Metric or parameter, or a list of them, the cohort figures map and distribute. sites.summary.best best “calibrated” calibrated any calibrated The best calibrated case of the site, scored in its calibration window or out of it (evaluated). any The best case of the site, calibrated or not. Which case of a site the by-site table keeps as its best. sites.summary.columns columns [] [“checks.budget_pct”, “checks.converged”] Extra columns read from the manifest.json of each run, as dotted paths without index (checks.budget_pct, metrics.nse).
[[sites.summary.window]]#
One window the runs are scored on again after the fact, one [[sites.summary.window]].
Repeat the table: one [[sites.summary.window]] block per item.
name = "dry-summers"Name of the window, the window_name column of summary/scores.parquet. required example value
- Path
sites.summary.window.name- Accepted
- string
- Example
"dry-summers"
# start = "2016-01-01"First day of the window, an ISO date. example value
- Path
sites.summary.window.start- More
Unset, the start of each run.
- Accepted
- string
- Example
"2016-01-01"
# end = "2018-12-31"Last day of the window, an ISO date. example value
- Path
sites.summary.window.end- More
Unset, the end of each run.
- Accepted
- string
- Example
"2018-12-31"
# months = [6, 7, 8, 9]Calendar months kept, 1 to 12. example value
- Path
sites.summary.window.months- More
Unset, every month.
- Accepted
- list of integer
- Example
[6, 7, 8, 9]
[[sites.summary.window]] name = "dry-summers" # start = "2016-01-01" # end = "2018-12-31" # months = [6, 7, 8, 9]
sites.summary.window.name name “dry-summers” Name of the window, the window_name column of summary/scores.parquet. sites.summary.window.start start not set “2016-01-01” First day of the window, an ISO date. Unset, the start of each run. sites.summary.window.end end not set “2018-12-31” Last day of the window, an ISO date. Unset, the end of each run. sites.summary.window.months months not set [6, 7, 8, 9] Calendar months kept, 1 to 12. Unset, every month.
[[sites.export]]#
One export of a [sites] project, the vocabulary of [[export]].
Repeat the table: one [[sites.export]] block per item.
Connections found in the code (1)
- Same name
[[export]]The exports written at the end of a run, one [[export]] block per request, in the order of the file.
# table = ‹"by_site" | "by_case" | "catalog"›Summary table to export.
- Path
sites.export.table- More
Write table or runs, not both.
- Values
"by_site": One row per site, its best case."by_case": One row per case."catalog": The site table the plan resolved.
- Accepted
- "by_site" | "by_case" | "catalog"
# runs = ‹"best"›Runs whose variables are exported: the best case of each site.
- Path
sites.export.runs- Values
"best"no explanation
- Accepted
- "best"
# variable = []Variable, or a list of them, exported from each run, with runs = 'best'.
- Path
sites.export.variable- Accepted
- list of string
- Example
["discharge"]
# format = "csv"File format of the export, csv unless another is named.
- Path
sites.export.format- Accepted
- string
- Example
"csv"
# file = ‹string›For a table, the file name under summary/exports/ (unset: <table>.<format>); for runs = 'best', the folder of the series (unset: best).
- Path
sites.export.file- Accepted
- string
[[sites.export]] # table = <"by_site" | "by_case" | "catalog"> # runs = <"best"> # variable = [] # format = "csv" # file = <string>
sites.export.table table not set by_site by_case catalog by_site One row per site, its best case. by_case One row per case. catalog The site table the plan resolved. Summary table to export. Write table or runs, not both. sites.export.runs runs not set best Runs whose variables are exported: the best case of each site. sites.export.variable variable [] [“discharge”] Variable, or a list of them, exported from each run, with runs = ‘best’. sites.export.format format “csv” “csv” File format of the export, csv unless another is named. sites.export.file file not set For a table, the file name under summary/exports/ (unset: <table>.<format>); for runs = ‘best’, the folder of the series (unset: best).