|
14 | 14 | ##' @param sensitivity.analysis Whether or not to perform a sensitivity analysis. Can also take |
15 | 15 | ##' a sensitivity setting object as input. Default: FALSE (logical or list) |
16 | 16 | ##' @param notes Additional notes that the user need to specify for the submitted workflow. Default: NULL |
| 17 | +##' @param workflow_list_mods List of additional changes to be applied to the |
| 18 | +##' workflow list. Passed to [utils::modifyList()]. Default = `list() (no changes)`. |
17 | 19 | ##' @return Response obtained from the `POST /api/workflows/` endpoint |
18 | 20 | ##' @author Tezan Sahu, Alexey Shiklomanov |
19 | 21 | ##' @export |
|
27 | 29 | ##' end_date="2003-12-31", inputs=list(met=list(id=99000000003))) |
28 | 30 |
|
29 | 31 | submit.workflow <- function(server, model_id, site_id, pfts, start_date, end_date, inputs, meta.analysis = list(), |
30 | | - ensemble_size=1, sensitivity_variable = "NPP", sensitivity.analysis = FALSE, notes = NULL) { |
| 32 | + ensemble_size=1, sensitivity_variable = "NPP", sensitivity.analysis = FALSE, notes = NULL, |
| 33 | + workflow_list_mods = list()) { |
31 | 34 | # Prepare the workflow based on the parameters set by user |
32 | 35 | workflow <- list() |
33 | 36 | workflow$pfts <- lapply(pfts, function(x) list(name = x)) |
@@ -80,6 +83,9 @@ submit.workflow <- function(server, model_id, site_id, pfts, start_date, end_dat |
80 | 83 | workflow$info$notes <- notes |
81 | 84 | } |
82 | 85 |
|
| 86 | + # Apply any additional user changes (if any) |
| 87 | + workflow <- modifyList(workflow, workflow_list_mods) |
| 88 | + |
83 | 89 | # Submit the prepared workflow to the PEcAn API in XML format |
84 | 90 | # NOTE: Use XML here because JSON doesn't like duplicate tags (which we use |
85 | 91 | # for PFTs, among other things). |
|
0 commit comments