diff --git a/DESCRIPTION b/DESCRIPTION index a004ffb1e9774ffaa2900ac511b224ad7b5b1551..9a8c48dee1cb4e2fbdf81bb62bcb4bd164a2d2e8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: airGR Type: Package Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling -Version: 1.2.7.7 -Date: 2019-03-04 +Version: 1.2.7.8 +Date: 2019-03-06 Authors@R: c( person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), person("Charles", "Perrin", role = c("aut", "ths"), comment = c(ORCID = "0000-0001-8552-1881")), diff --git a/NEWS.rmd b/NEWS.rmd index 2d514bcc1bc5d3e9d64709caa0a30f1ff80c4c94..f913f1dbed2b718df31d133004bc494757aade39 100644 --- a/NEWS.rmd +++ b/NEWS.rmd @@ -13,7 +13,7 @@ output: -### 1.2.7.7 Release Notes (2019-03-04) +### 1.2.7.8 Release Notes (2019-03-06) @@ -38,6 +38,8 @@ output: - <code>CreateRunOptions()</code> now presents a <code>warnings</code> argument to replace the verbose action (the <code>verbose</code> argument is keep to print messages). +- <code>Calibration()</code> function now returns an error message if <code>FUN_CALIB</code> is not a function + #### Major user-visible changes diff --git a/R/Calibration.R b/R/Calibration.R index f0d4aff1f4c1b6061e795f38a0fa7d460be190c1..162fd7d7b9a076c1fad7c9fd5f9dbdbd7b07f2a0 100644 --- a/R/Calibration.R +++ b/R/Calibration.R @@ -1,4 +1,9 @@ -Calibration <- function(InputsModel, RunOptions, InputsCrit, CalibOptions, FUN_MOD, FUN_CRIT, FUN_CALIB = Calibration_Michel, FUN_TRANSFO = NULL, verbose = TRUE) { +Calibration <- function(InputsModel, RunOptions, InputsCrit, CalibOptions, + FUN_MOD, FUN_CRIT, FUN_CALIB = Calibration_Michel, FUN_TRANSFO = NULL, + verbose = TRUE) { + if (! is.function(FUN_CALIB)) { + stop("'FUN_CALIB' must be a function") + } return(FUN_CALIB(InputsModel, RunOptions, InputsCrit, CalibOptions, FUN_MOD, FUN_CRIT, FUN_TRANSFO, verbose = verbose)) }