Skip to content

Commit

Permalink
update setSimulationPath()/setSimulationPath() with new parameter 've…
Browse files Browse the repository at this point in the history
…rbose' + doc + test + newsmd (#274)
  • Loading branch information
berthetclement authored Feb 10, 2025
1 parent ffcf378 commit 4c45d14
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

# antaresRead 2.8.0.9000
(cf. Antares v9 changelog)
(cf. Antares v9 changelog)

NEW FEATURES:

* `setSimulationPath()` / `setSimulationPathAPI()` have a new parameter `'verbose'` (default to `FALSE`) to manage diagnostic messages

BUGFIXES :

Expand Down
2 changes: 2 additions & 0 deletions R/setSimulationPath.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
#' \item{firstWeekday}{First day of the week.}
#' \item{districtsDef}{data.table containing the specification of the districts.}
#' \item{energyCosts}{list containing the cost of spilled and unsupplied energy.}
#' \item{verbose}{`logical` default to FALSE, put to TRUE to manage diagnostic messages}
#'
#' @seealso
#' \code{\link{simOptions}}, \code{\link{readAntares}}, \code{\link{readLayout}},
Expand Down Expand Up @@ -221,6 +222,7 @@ setSimulationPath <- function(path, simulation = NULL) {
res$districtsDef <- .readDistrictsDef(res$inputPath, res$areaList)
res$energyCosts <- .readEnergyCosts(res$inputPath)
res$typeLoad <- "txt"
res$verbose <- FALSE
class(res) <- c("simOptions")

options(antares=res)
Expand Down
3 changes: 3 additions & 0 deletions R/setSimulationPathAPI.R
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ setSimulationPathAPI <- function(host, study_id, token, simulation = NULL,

# timer for api commande execute
res$sleep <- 0.5

# param "verbose" similar to disk mode
res$verbose <- FALSE

class(res) <- c("simOptions")

Expand Down
1 change: 1 addition & 0 deletions man/setSimulationPath.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion tests/testthat/test-setSimulationPath.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ trueOpts <- list(
"b - psp in", "b - psp out", "c - hub", "hub - psp in-2",
"hub - psp out-2"),
areasWithClusters = c("a", "b", "c", "psp in", "psp in-2", "psp out", "psp out-2"),
districtsDef = data.table(district = as.factor("a and b"), area = as.factor(c("a", "b")))
districtsDef = data.table(district = as.factor("a and b"), area = as.factor(c("a", "b"))),
verbose = FALSE
)

test_that("setSimulationPath reads correct values", {
Expand Down

0 comments on commit 4c45d14

Please sign in to comment.