Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix side effects from antaresRead function (readClusterDesc, ...) #178

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading