From 8979d098b400cf9e6d77465c7a503f67378f9895 Mon Sep 17 00:00:00 2001 From: berthetclement Date: Tue, 4 Jun 2024 10:42:14 +0200 Subject: [PATCH] update --- R/readInputClusters.R | 6 +++--- tests/testthat/test-readInputClusters.R | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/R/readInputClusters.R b/R/readInputClusters.R index 9491c2fd..185f0fc3 100644 --- a/R/readInputClusters.R +++ b/R/readInputClusters.R @@ -89,7 +89,7 @@ readInputThermal <- function(areas = "all", res <- list() # Object the function will return - # ThermalAvailabilities processing + # ThermalAvailabilities processing (/series) if (thermalAvailabilities){ thermalTS <- as.data.table(ldply(clusters, function(cl) { areas <- allAreasClusters_filtered[cluster == cl]$area @@ -119,7 +119,7 @@ readInputThermal <- function(areas = "all", if (nrow(thermalTS) > 0) res$thermalAvailabilities <- thermalTS } - # thermalModulation processing + # thermalModulation processing (/prepro/.../.../modulation.txt) if (thermalModulation){ thermalMod <- as.data.table(ldply(areas, .importThermalModulation, opts = opts, timeStep = timeStep)) thermalMod <- thermalMod[cluster %in% clusters] @@ -128,7 +128,7 @@ readInputThermal <- function(areas = "all", if (nrow(thermalMod) > 0) res$thermalModulation <- thermalMod } - # thermalData processing + # thermalData processing (/prepro/.../.../data.txt) if (thermalData){ thermalDat <- as.data.table(ldply(areas, .importThermalData, opts = opts, timeStep = timeStep)) thermalDat <- thermalDat[cluster %in% clusters] diff --git a/tests/testthat/test-readInputClusters.R b/tests/testthat/test-readInputClusters.R index 5f596cf5..30a968c4 100644 --- a/tests/testthat/test-readInputClusters.R +++ b/tests/testthat/test-readInputClusters.R @@ -9,6 +9,7 @@ sapply(studyPathS, function(studyPath){ if(!isH5Opts(opts)){ test_that("Thermal availabilities importation works", { + # read /series files (default) input <- readInputThermal(clusters = "peak_must_run_partial", showProgress = FALSE) expect_is(input, "antaresDataTable") expect_gt(nrow(input), 0) @@ -24,7 +25,7 @@ sapply(studyPathS, function(studyPath){ }) test_that("Thermal data importation works", { - input <- readInputThermal(clusters = "peak_must_run_partial", thermalModulation = TRUE, showProgress = FALSE) + input <- readInputThermal(clusters = "peak_must_run_partial", thermalData = TRUE, showProgress = FALSE, timeStep = 'daily') expect_is(input, "antaresDataList") expect_is(input$thermalModulation, "antaresDataTable") expect_gt(nrow(input$thermalModulation), 0) @@ -48,3 +49,17 @@ sapply(studyPathS, function(studyPath){ } }) + +# >= v870 ---- +## RES ---- +test_that("test reading TS RES", { + + # read latest version study + path_study_test <- grep(pattern = "87", x = studyPathSV8, value = TRUE) + setSimulationPath(path_study_test, simulation = "input") + + toto= readInputRES(clusters = "at_res_1") + + toto = readInputThermal(clusters = "at_gas") + +})