Skip to content

Commit

Permalink
add commentary and fix value as a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Nekmek7 committed May 29, 2024
1 parent 48d6ddc commit 1035fab
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions R/readInputClusters.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ readInputThermal <- function(areas = "all",
}

allAreasClusters <- readClusterDesc(opts = opts)[, c("area", "cluster")]

#To compare with area and cluster selected
allAreasClusters$lower_area <- tolower(allAreasClusters$area)
allAreasClusters$lower_cluster <- tolower(allAreasClusters$cluster)

Expand All @@ -67,6 +69,7 @@ readInputThermal <- function(areas = "all",
stop(paste0("the following areas are not available:", diff_areas))
}
}
# All areas selected with corresponding clusters
allAreasClusters_filtered_area <- allAreasClusters[area %in% areas]

if (identical(clusters, "all")) {
Expand All @@ -78,7 +81,10 @@ readInputThermal <- function(areas = "all",
stop(paste0("the following clusters are not available:", diff_clusters))
}
}
# Couple areas/clusters of interest.
allAreasClusters_filtered <- allAreasClusters_filtered_area[cluster %in% clusters]

# To loop
clusters <- unique(allAreasClusters_filtered$cluster)

res <- list() # Object the function will return
Expand All @@ -93,8 +99,7 @@ readInputThermal <- function(areas = "all",
inputTimeStep = "hourly", type = "matrix")

if (is.null(mid)){
# seq vs :, stocker dans une variable
nb_rows_ts <- 8736
nb_rows_ts <- opts$timeIdMax
timeId_value <- seq(1,nb_rows_ts)
tsId_value <- replicate(nb_rows_ts,1)
ThermalAvailabilities_value <- replicate(nb_rows_ts,0)
Expand Down

0 comments on commit 1035fab

Please sign in to comment.