Skip to contents

The goal here is to make scripting easier, and be able to change single simple parameters (e.g. directory) from command line or in other workflows.

  • Needs lists with top-level ewr and aggregation items. Those should then be lists with items named as in function arguments for prep_run_save_ewrs() and read_and_agg(), respectively.

Usage

run_hydrobot_params(
  yamlpath = NULL,
  passed_args = NULL,
  list_args = NULL,
  defaults = system.file("yml/default_params.yml", package = "HydroBOT")
)

Arguments

yamlpath

character, path to yaml file of parameters. Only needs to contain values for parameters for which we wish to modify defaults. If we want to be able to auto-run off the saved param metadata, the names of the spatial agg levels need to match the objects, e.g. basin: basin

passed_args

character, in yaml format, e.g. ""scenario_dir: 'project_dir/hydrographs'". Possible to pass more than one, but complicated to get the yaml right. Suggest in that case modifying the params.yml

list_args

list of arguments. Typically would come in from parameterised quarto notebook, which pre-parses yaml into a list, but could also be list(ewr = list(arg1 = x), aggregation = list(arg1 = y))

defaults

character, path to default set of yaml parameters, so the yamlpath file and passed_args only need to include those that are modified

Value

runs HydroBOT, returns NULL invisibly, or the aggregated output if the params have aggReturn: TRUE