result_validation
result_validation
Regression checks on the results of a model run, which supplement the input checks of ribasim_nl.validation.
result_metrics summarizes a run in a few numbers: solver statistics, how well the simulated discharges match the measurements of the Observation nodes, see ribasim_nl.goodness_of_fit, and the discharges and levels at key points of the main water system. validate_results checks them against LIMITS. The limits are loose bounds around the results of a run of lhm_coupled, so that they catch large unintended regressions rather than the noise of small changes. Change them when a change of the results is intended, and explain why in the pull request.
Classes
| Name | Description |
|---|---|
| KeyLevel | A Basin of the main water system, of which the 1st and 99th percentile of the levels should be in a range. |
| Limit | Bounds of a metric, outside of which it has regressed. |
KeyLevel
result_validation.KeyLevel(node_id, name, low, high)A Basin of the main water system, of which the 1st and 99th percentile of the levels should be in a range.
Limit
result_validation.Limit(min=-np.inf, max=np.inf)Bounds of a metric, outside of which it has regressed.
Methods
| Name | Description |
|---|---|
| issue | Describe how a metric is out of bounds, if it is. |
issue
result_validation.Limit.issue(name, value)Describe how a metric is out of bounds, if it is.
Functions
| Name | Description |
|---|---|
| key_discharge_metrics | The KGE of the KEY_DISCHARGES in compare_observations, which is NaN if it is missing. |
| key_level_metrics | The 1st and 99th percentile of the levels of the KEY_LEVELS, by name. |
| observation_metrics | Summarize compare_observations in the number of compared Observations and their median efficiencies. |
| result_issues | Describe the metrics that are out of their limits, or missing. |
| result_metrics | Summarize the results of a model run in the metrics of LIMITS, also return compare_observations. |
| solver_metrics | Summarize the solver statistics of solver_stats.nc, with the computation time in hours. |
| validate_results | Check the metrics of result_metrics against their limits and report all regressions together. |
key_discharge_metrics
result_validation.key_discharge_metrics(comparison)The KGE of the KEY_DISCHARGES in compare_observations, which is NaN if it is missing.
key_level_metrics
result_validation.key_level_metrics(database, results_dir)The 1st and 99th percentile of the levels of the KEY_LEVELS, by name.
observation_metrics
result_validation.observation_metrics(comparison)Summarize compare_observations in the number of compared Observations and their median efficiencies.
result_issues
result_validation.result_issues(metrics, limits=LIMITS)Describe the metrics that are out of their limits, or missing.
result_metrics
result_validation.result_metrics(toml_path)Summarize the results of a model run in the metrics of LIMITS, also return compare_observations.
solver_metrics
result_validation.solver_metrics(solver_stats)Summarize the solver statistics of solver_stats.nc, with the computation time in hours.
validate_results
result_validation.validate_results(metrics, limits=LIMITS)Check the metrics of result_metrics against their limits and report all regressions together.