diff --git a/NAMESPACE b/NAMESPACE index 32482d05..d135f18a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -51,7 +51,7 @@ export(getPlaylist) export(getVariantCommands) export(is_antares_v7) export(is_antares_v820) -export(list_polluants_values) +export(list_pollutants_values) export(mockSimulationAPI) export(nodalOptimizationOptions) export(propertiesLinkOptions) diff --git a/NEWS.md b/NEWS.md index 89986c5d..ac1f4cb6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,7 +6,7 @@ * `createArea()` integrate "st-storage". * `removeArea()` integrate "st-storage". * `writeInputTS()` integrate "mingen" data and dependency between "mod.txt" and "mingen.txt" data. -* `createCluster()` / `editCluster()` have new parameter `list_polluants` for list of pollutants. +* `createCluster()` / `editCluster()` have new parameter `list_pollutants` for list of pollutants. NEW FEATURES (Antares v8.6) : @@ -40,6 +40,8 @@ BUGFIXES : * `writeInputTS()` works with argument `type = "tsLink"` * `createLink()` and `editLink()` write the appropriate time series in _direct.txt and _indirect.txt files even if the areas `from` and `to` given as arguments are not sorted +### DOC : +* A new article presenting v8.6 features is available on the package's online documentation. # antaresEditObject 0.5.1 diff --git a/R/createCluster.R b/R/createCluster.R index 13dbd219..6deb3998 100644 --- a/R/createCluster.R +++ b/R/createCluster.R @@ -13,7 +13,7 @@ #' @param ... Parameters to write in the Ini file. Careful! #' Some parameters must be set as `integers` to avoid warnings in Antares, for example, #' to set `unitcount`, you'll have to use `unitcount = 1L`. -#' @param list_polluants `list` named with specific polluants (only for Antares version >= 860) +#' @param list_pollutants `list` named with specific pollutants (only for Antares version >= 860) #' @param time_series the "ready-made" 8760-hour time-series available for simulation purposes. #' @param prepro_data Pre-process data, a `data.frame` or `matrix`, #' default is a matrix with 365 rows and 6 columns. @@ -36,7 +36,7 @@ #' @importFrom data.table setcolorder year yday month setnames #' #' @note -#' Parameter `list_polluants` is only available for Antares studies >= v8.6.0. +#' Parameter `list_pollutants` is only available for Antares studies >= v8.6.0. #' #' You must provide named `list` (numerical values or NULL ) : #' @@ -156,7 +156,7 @@ createCluster <- function(area, cluster_name, group = "Other", ..., - list_polluants = list_polluants_values(), + list_pollutants = list_pollutants_values(), time_series = NULL, prepro_data = NULL, prepro_modulation = NULL, @@ -167,25 +167,25 @@ createCluster <- function(area, assertthat::assert_that(inherits(opts, "simOptions")) # static name of list parameters of pulluants - name_list_param_poll <- names(list_polluants_values()) + name_list_param_poll <- names(list_pollutants_values()) # check v860 # check list pulluants parameters if(opts$antaresVersion >= 860){ - if(!is.null(list_polluants) & !assert_that(inherits(list_polluants, "list"))) - stop("Parameter 'list_polluants' must be a 'list'") + if(!is.null(list_pollutants) & !assert_that(inherits(list_pollutants, "list"))) + stop("Parameter 'list_pollutants' must be a 'list'") - if(!all(names(list_polluants) %in% name_list_param_poll)) - stop(append("Parameter 'list_polluants' must be named with the following elements: ", + if(!all(names(list_pollutants) %in% name_list_param_poll)) + stop(append("Parameter 'list_pollutants' must be named with the following elements: ", paste0(name_list_param_poll, collapse= ", "))) # check if all elements are NULL => replace by NULL # API (only) can't create with NULL values - all_null <- lapply(list_polluants, is.null) + all_null <- lapply(list_pollutants, is.null) all_null <- all(unlist(all_null)) if(all_null) - list_polluants <- NULL + list_pollutants <- NULL } @@ -212,7 +212,7 @@ createCluster <- function(area, cluster_name = cluster_name, group = group, ..., - list_polluants = list_polluants, + list_pollutants = list_pollutants, time_series = time_series, prepro_data = prepro_data, prepro_modulation = prepro_modulation, @@ -270,7 +270,7 @@ createClusterRES <- function(area, .createCluster <- function(area, cluster_name, ..., - list_polluants = NULL, + list_pollutants = NULL, time_series = NULL, prepro_data = NULL, prepro_modulation = NULL, @@ -302,9 +302,9 @@ createClusterRES <- function(area, cluster_name <- paste(area, cluster_name, sep = "_") params_cluster$name <- cluster_name - # v860 polluants + # v860 pollutants if(opts$antaresVersion >= 860) - params_cluster <- append(params_cluster, list_polluants) + params_cluster <- append(params_cluster, list_pollutants) # API block if (is_api_study(opts)) { @@ -463,7 +463,7 @@ createClusterRES <- function(area, # ) -#' Output polluants list for thermal clusters +#' Output pollutants list for thermal clusters #' #' @param multi_values put values to init list values, default as `NULL` #' @@ -471,8 +471,8 @@ createClusterRES <- function(area, #' @export #' #' @examples -#' list_polluants_values() -list_polluants_values <- function(multi_values = NULL) { +#' list_pollutants_values() +list_pollutants_values <- function(multi_values = NULL) { list("nh3"= multi_values, "nox"= multi_values, "pm2_5"= multi_values, diff --git a/R/createClusterST.R b/R/createClusterST.R index 2a8dfdfb..c8cb48f8 100644 --- a/R/createClusterST.R +++ b/R/createClusterST.R @@ -317,7 +317,7 @@ createClusterST <- function(area, } } -#' Output polluants list for thermal clusters +#' Output pollutants list for thermal clusters #' #' #' @return a named list diff --git a/R/editCluster.R b/R/editCluster.R index 0a3c0465..a287bcef 100644 --- a/R/editCluster.R +++ b/R/editCluster.R @@ -12,7 +12,7 @@ #' @seealso [createCluster()] or [createClusterRES()] to create new clusters, [removeCluster()] or [removeClusterRES()] to remove clusters. #' #' @note -#' Parameter `list_polluants` is only available for Antares studies >= v8.6.0. +#' Parameter `list_pollutants` is only available for Antares studies >= v8.6.0. #' #' You must provide named `list` (numerical values or NULL ) : #' @@ -44,7 +44,7 @@ editCluster <- function(area, cluster_name, ..., - list_polluants = NULL, + list_pollutants = NULL, time_series = NULL, prepro_data = NULL, prepro_modulation = NULL, @@ -54,7 +54,7 @@ editCluster <- function(area, area = area, cluster_name = cluster_name, ..., - list_polluants = list_polluants, + list_pollutants = list_pollutants, time_series = time_series, prepro_data = prepro_data, prepro_modulation = prepro_modulation, @@ -90,7 +90,7 @@ editClusterRES <- function(area, .editCluster <- function(area, cluster_name, ..., - list_polluants = NULL, + list_pollutants = NULL, time_series = NULL, prepro_data = NULL, prepro_modulation = NULL, @@ -108,9 +108,9 @@ editClusterRES <- function(area, if (add_prefix) cluster_name <- paste(area, cluster_name, sep = "_") - # v860 polluants + # v860 pollutants if(opts$antaresVersion >= 860) - params_cluster <- append(params_cluster, list_polluants) + params_cluster <- append(params_cluster, list_pollutants) # Handle case sensitivity in name of clusters API clusters <- names(readIni(file.path("input", cluster_type, "clusters", area, "list"), diff --git a/antaresEditObject.Rproj b/antaresEditObject.Rproj index 64746011..eaa6b818 100644 --- a/antaresEditObject.Rproj +++ b/antaresEditObject.Rproj @@ -15,5 +15,4 @@ LaTeX: pdfLaTeX BuildType: Package PackageUseDevtools: Yes PackageInstallArgs: --no-multiarch --with-keep.source -PackageCheckArgs: --no-manual PackageRoxygenize: rd,collate,namespace diff --git a/docs/404.html b/docs/404.html index 502668b1..f9125c81 100644 --- a/docs/404.html +++ b/docs/404.html @@ -32,7 +32,7 @@ antaresEditObject - 0.5.1 + 0.6.0 @@ -52,6 +52,9 @@