Skip to content

Commit

Permalink
fix side effects from antaresRead function (readClusterDesc, ...) (#178)
Browse files Browse the repository at this point in the history
* fix side effects from antaresRead function (readClusterDesc, ...)

* update newsmd
  • Loading branch information
berthetclement authored Jul 12, 2024
1 parent 6c165de commit e01e841
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ NEW FEATURES (Antares v8.8) :
BUGFIXES :

* `createBindingConstraint()` in API mode (for study <v870) created with "hourly" timeStep all the time
* side effects with `readClusterDesc()` / `readClusterResDesc()` / `readClusterSTDesc()`


# antaresEditObject 0.7.0
Expand Down
2 changes: 1 addition & 1 deletion R/removeArea.R
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ checkRemovedArea <- function(area, all_files = TRUE, opts = antaresRead::simOpti
# Cluster
bc_not_remove_cluster <- character(0)
clusters <- readClusterDesc(opts = opts)
clusters_area <- clusters[clusters$area == name, c("area", "cluster")]
clusters_area <- clusters[clusters$area == name,]
if (nrow(clusters_area) > 0) {
bc_not_remove_cluster <- detect_pattern_in_binding_constraint(pattern = paste0(clusters_area$area, ".", clusters_area$cluster), opts = opts)
}
Expand Down
15 changes: 0 additions & 15 deletions tests/testthat/test-createCluster.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,6 @@ test_that("Create cluster with pollutants params (new feature v8.6)",{

createArea(name = "test")

test_that("Create cluster default call (new feature v8.6)",{
# default call now create without pollutants
createCluster(area = getAreas()[1],
cluster_name = "cluster_default",
overwrite = TRUE)

res_cluster <- antaresRead::readClusterDesc()

pollutants_names <- names(antaresEditObject::list_pollutants_values())

# check default values
testthat::expect_false(all(
pollutants_names %in% names(res_cluster)))
})

test_that("Create cluster with bad parameter pollutant",{
bad_pollutants_param <- "not_a_list"

Expand Down

0 comments on commit e01e841

Please sign in to comment.