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 edbef061..65c2bdfd 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) : 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/docs/articles/Antares_new_features_v860.html b/docs/articles/Antares_new_features_v860.html index 0f931fc2..13be0475 100644 --- a/docs/articles/Antares_new_features_v860.html +++ b/docs/articles/Antares_new_features_v860.html @@ -182,7 +182,7 @@
Now you can see information in simulation options.
+Now you can see informations in simulation options.
opts <- simOptions()
opts$areasWithSTClusters
@@ -328,18 +328,18 @@ Remove st-storageThermal pollutants parameters
Antares version 8.6.0 now provide pollutants parameters for thermal clusters. You can see the documentation on thermal clusters here.
-You have global list
of pollutants given by function list_polluants_values()
(nh3, nox, pm2_5, pm5, pm10, nmvoc, so2, op1, op2, op3, op4, op5, co2). By default, parameters are set to NULL, you can initialize all parameters with value or customize parameters.
+You have global list
of pollutants given by function list_pollutants_values()
. By default, parameters are set to NULL, you can initialize all parameters with value or customize parameters.
# create cluster with pollutants
# pollutants
-all_param_pollutants <- list_polluants_values(multi_values = 0.25)
+all_param_pollutants <- list_pollutants_values(multi_values = 0.25)
createCluster(area = "fr",
cluster_name = "test_pollutant",
unitcount = 1L,
marginal_cost = 50,
- list_polluants = all_param_pollutants,
+ list_pollutants = all_param_pollutants,
time_series = matrix(rep(c(0, 8000), each = 24*364), ncol = 2),
prepro_modulation = matrix(rep(c(1, 1, 1, 0), each = 24*365), ncol = 4)
)
@@ -355,22 +355,19 @@ Thermal pollutants parameters
# editing
-edit_param_pollutants <- list_polluants_values()[c("nh3", "nox", "pm2_5")]
-edit_param_pollutants$nh3 <- 0.3
-edit_param_pollutants$nox <- 0.4
-edit_param_pollutants$pm2_5 <- 0.5
+edit_param_pollutants <- list_pollutants_values(multi_values = 0.3)[1:3]
editCluster(area = "fr",
cluster_name = "test_pollutant",
unitcount = 2L,
- list_polluants = edit_param_pollutants)
+ list_pollutants = edit_param_pollutants)
# read parameters
param_th_cluster <- readClusterDesc()
rmarkdown::paged_table(param_th_cluster)
Values checks :
Checks depends of values of parameters in hydro.ini
file.
After creating study, .txt
files containing time series are empty. We will describe steps to edit mingen.txt
.
Initial values :
diff --git a/docs/news/index.html b/docs/news/index.html index dcde40ba..bcf19122 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -82,7 +82,7 @@Breaking c
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) :
activateST()
Activate “st-storage” in an Antares study.createClusterST()
, editClusterST()
, removeClusterST()
(“st-storage” family of functions for a study in “input” mode)unitcount
, you'll have to use unitcount = 1L
.
-list
named with specific polluants (only for Antares version >= 860)
list
named with specific pollutants (only for Antares version >= 860)
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 ) :
list( "nh3"= 0.25, "nox"= 0.45, "pm2_5"= 0.25, "pm5"= 0.25, "pm10"= 0.25, "nmvoc"= 0.25, "so2"= 0.25, "op1"= 0.25, "op2"= 0.25, "op3"= 0.25, "op4"= 0.25, "op5"= NULL, "co2"= NULL)
unitcount
, you'll have to use unitcount = 1L
.
-list
named with specific polluants (only for Antares version >= 860)
list
named with specific pollutants (only for Antares version >= 860)
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 ) :
list( "nh3"= 0.25, "nox"= 0.45, "pm2_5"= 0.25, "pm5"= 0.25, "pm10"= 0.25, "nmvoc"= 0.25, "so2"= 0.25, "op1"= 0.25, "op2"= 0.25, "op3"= 0.25, "op4"= 0.25, "op5"= NULL, "co2"= NULL)
Get the type of control to execute between mingen data and maxpower data
Output polluants list for thermal clusters
Output pollutants list for thermal clusters
Output polluants list for thermal clusters
Output pollutants list for thermal clusters
R/createCluster.R
+ list_pollutants_values.Rd
Output pollutants list for thermal clusters
+list_pollutants_values(multi_values = NULL)
put values to init list values, default as NULL
a named list
+list_pollutants_values()
+#> $nh3
+#> NULL
+#>
+#> $nox
+#> NULL
+#>
+#> $pm2_5
+#> NULL
+#>
+#> $pm5
+#> NULL
+#>
+#> $pm10
+#> NULL
+#>
+#> $nmvoc
+#> NULL
+#>
+#> $so2
+#> NULL
+#>
+#> $op1
+#> NULL
+#>
+#> $op2
+#> NULL
+#>
+#> $op3
+#> NULL
+#>
+#> $op4
+#> NULL
+#>
+#> $op5
+#> NULL
+#>
+#> $co2
+#> NULL
+#>
+
R/createClusterST.R
storage_values_default.Rd
Output polluants list for thermal clusters
+Output pollutants list for thermal clusters