diff --git a/DESCRIPTION b/DESCRIPTION index 06997b20..33f7e461 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: antaresRead Type: Package Title: Import, Manipulate and Explore the Results of an 'Antares' Simulation -Version: 2.6.2 +Version: 2.6.1 Authors@R: c( person("Tatiana", "Vargas", email = "tatiana.vargas@rte-france.com", role = c("aut", "cre")), person("Jalal-Edine", "ZAWAM", role = "aut"), @@ -14,6 +14,7 @@ Authors@R: c( person("Assil", "Mansouri", role = "ctb"), person("Clement", "Berthet", role = "ctb"), person("Kamel", "Kemiha", role = "ctb"), + person("Abdallah", "Mahoudi", role = "ctb"), person("RTE", role = "cph") ) Description: Import, manipulate and explore results generated by 'Antares', a diff --git a/NEWS.md b/NEWS.md index 7d6a3faf..8b572cde 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,13 +1,5 @@ > Copyright © 2016 RTE Réseau de transport d’électricité -# antaresRead 2.6.2 (devlopment) - -BUGFIXES : - -* `readAntares()` : - - returns the right column names for details-timeStep.txt and details-res-timeStep.txt - - # antaresRead 2.6.1 (devlopment) BUGFIXES : @@ -16,6 +8,10 @@ BUGFIXES : - returns an API exception if the requested study ID is incorrect - `simulation` the simulation parameter works with negative values within the limit of the number of simulations * correction in `readClusterDesc()` calls to add "opts" +* `readAntares()` : + - returns the right column names for details-timeStep.txt and details-res-timeStep.txt +* Correction in `.formatlist()`, read N-level list instead of 2. + # antaresRead 2.6.0 diff --git a/R/readIniFile.R b/R/readIniFile.R index 0c94d228..eda11d69 100644 --- a/R/readIniFile.R +++ b/R/readIniFile.R @@ -69,11 +69,11 @@ readIniFile <- function(file, stringsAsFactors = FALSE) { pairs <- X[seq(starts[i], ends[i])] pairs <- pairs[pairs != ""] pairs <- strsplit(pairs, "=") - + key <- lapply(pairs, `[`, 1) key <- unlist(key) key <- trimws(key) - + value <- lapply(pairs, `[`, 2) value <- as.list(trimws(unlist(value))) value <- lapply(value, function(x) { @@ -83,7 +83,7 @@ readIniFile <- function(file, stringsAsFactors = FALSE) { utils::type.convert(x, as.is = TRUE) } }) - + L[[i]] <- value names(L[[i]]) <- key } @@ -131,15 +131,17 @@ readIniAPI <- function(study_id, path, host, token = NULL) { if(is.name(x[index_list])) return(x) else{ - elements <- unlist(x[index_list], use.names = FALSE) - if(class(elements)%in%"character"){ - elements <- paste("'", elements, "'", sep="", collapse=",") - elements <- paste0("[", elements, "]") - }else{ - elements <- paste0(elements, collapse= ",") - elements <- paste0("[", elements, "]") + for (sub_list in index_list){ + elements <- unlist(x[sub_list], use.names = FALSE) + if(class(elements)%in%"character"){ + elements <- paste("'", elements, "'", sep="", collapse=",") + elements <- paste0("[", elements, "]") + }else{ + elements <- paste0(elements, collapse= ",") + elements <- paste0("[", elements, "]") + } + x[sub_list] <- elements } - x[index_list] <- elements x } })