check_rw_output: Checks slots with yaml rules

Description Usage Arguments Details Value Examples

View source: R/check_rw_output.R

Description

check_rw_output() takes RiverWare output (csv or rdf) and uses logic written in yaml rule(s) to check the RiverWare output for errors. This function was created to be run within RiverWare using the Rplugin event with the available predefined arguments.

Usage

1
2
3
4
5
6
7
8
check_rw_output(
  scenarios,
  yaml_rule_files,
  scenario_dir,
  output_dir,
  yaml_dir,
  out_fl_nm = "verification_output"
)

Arguments

scenarios

A character vector of folder names inside the scenario_dir, which stores the scenario output.

yaml_rule_files

A vector of yaml files.

scenario_dir

Directory where scenarios are stored.

output_dir

Directory where summary and log files are saved.

yaml_dir

Directory where yaml files are stored.

out_fl_nm

The name of the output files, default to verification_output.

Details

The function needs the base directory of the scenarios, which is normally automatically output when running RiverWare models in RiverSMART. The scenario_dir contains subdirectories, each representing an individual scenario. These individual scenario directories are input to this function as a character vector, scenarios. The other directories necessary in this function are the location of the yaml file(s) yaml_dir, and desired output directory, output_dir.

Value

Writes passes and fails to summary verification file and outputs details to log_file.txt.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
scenarios <- c("MRM_Avg,ModelBase,RulesBase,Run-2019-10",
  "MRM_Avg,ModelBase,RulesBase,Run-2019-11")
yaml_rule_files <- c("check_lb_res.yaml", "check_ub_outflow.yaml")
scenario_dir <- "C:/User/Project/Scenario/"
output_dir <- "C:/User/Project/ScenarioSet/allScenarios/basicChecks"
yaml_dir <- "C:/User/Project/Code/"

## Not run: 
check_rw_output(scenarios, yaml_rule_files, scenario_dir, output_dir, yaml_dir)

## End(Not run)

BoulderCodeHub/RWcheck documentation built on Sept. 19, 2020, 1:35 p.m.