diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 33f49b89..870f216e 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -49,10 +49,6 @@ jobs: shell: Rscript {0} run: lucode2:::validkey(stopIfInvalid = TRUE) - - name: Verify that lucode2::buildLibrary was successful - shell: Rscript {0} - run: lucode2:::isVersionUpdated() - - name: Checks shell: Rscript {0} run: | diff --git a/R/calcFE.R b/R/calcFE.R index 1415f137..bfdf04c8 100644 --- a/R/calcFE.R +++ b/R/calcFE.R @@ -27,7 +27,8 @@ calcFE <- function(source = "IEA", scenario_proj = "SSP2", ieaVersion = "default colnames(map) <- gsub("io", "names_in", colnames(map)) # Give description - descript <- "IEA Final Energy Data based on 2022 version of IEA Energy Balances" + ieaYear <- if (ieaVersion == "default") 2022 else 2023 + descript <- paste0("IEA Final Energy Data based on ", ieaYear, " version of IEA Energy Balances") #------ PROCESS DATA ------------------------------------------ # select data that have names diff --git a/R/calcIO.R b/R/calcIO.R index 07626369..ac14d9b8 100644 --- a/R/calcIO.R +++ b/R/calcIO.R @@ -83,6 +83,7 @@ calcIO <- function(subtype = c("input", "output", "output_biomass", "trade", } ieaSubtype <- if (ieaVersion == "default") "EnergyBalances" else "EnergyBalances-latest" + ieaYear <- if (ieaVersion == "default") 2022 else 2023 # read in data and convert from ktoe to EJ data <- readSource("IEA", subtype = ieaSubtype) * 4.1868e-5 @@ -177,7 +178,8 @@ calcIO <- function(subtype = c("input", "output", "output_biomass", "trade", # In order to split the REMIND technology biotr between biotr and biotrmod, # We use the traditional biomass split for EDGE buildings and divide by the total quantity of FE biomass - edgeBio <- calcOutput("IOEdgeBuildings", subtype = "output_EDGE_buildings", ieaVersion = ieaVersion, aggregate = FALSE) + edgeBio <- calcOutput("IOEdgeBuildings", subtype = "output_EDGE_buildings", + ieaVersion = ieaVersion, aggregate = FALSE) feBio <- calcOutput("IO", subtype = "output_biomass", ieaVersion = ieaVersion, aggregate = FALSE) shareBiotrad <- edgeBio[, , "biotrad"] / (feBio[, , "sesobio.fesob.tdbiosob"] + feBio[, , "sesobio.fesoi.tdbiosoi"]) shareBiotrad[is.na(shareBiotrad)] <- 0 @@ -237,5 +239,5 @@ calcIO <- function(subtype = c("input", "output", "output_biomass", "trade", } return(list(x = reminditems, weight = NULL, unit = "EJ", - description = "IEA SE Output Data based on 2022 edition of IEA World Energy Balances")) + description = paste0("IEA SE Output Data based on ", ieaYear, " edition of IEA World Energy Balances"))) } diff --git a/R/calcPE.R b/R/calcPE.R index ec8b18a2..d347cb72 100644 --- a/R/calcPE.R +++ b/R/calcPE.R @@ -29,10 +29,14 @@ calcPE <- function(subtype = "IEA", ieaVersion = "default") { getNames(x) <- paste0(getNames(x), " (EJ/yr)") # add loss to electricity - x[, , "PE|Coal|Electricity (EJ/yr)"] <- x[, , "PE|Coal|Electricity (EJ/yr)"] + x[, , "PE|Coal|Electricity|Loss (EJ/yr)"] - x[, , "PE|Biomass|Electricity (EJ/yr)"] <- x[, , "PE|Biomass|Electricity (EJ/yr)"] + x[, , "PE|Biomass|Electricity|Loss (EJ/yr)"] - x[, , "PE|Gas|Electricity (EJ/yr)"] <- x[, , "PE|Gas|Electricity (EJ/yr)"] + x[, , "PE|Gas|Electricity|Loss (EJ/yr)"] - x <- x[, , c("PE|Coal|Electricity|Loss (EJ/yr)", "PE|Biomass|Electricity|Loss (EJ/yr)", "PE|Gas|Electricity|Loss (EJ/yr)"), invert = TRUE] + x[, , "PE|Coal|Electricity (EJ/yr)"] <- x[, , "PE|Coal|Electricity (EJ/yr)"] + + x[, , "PE|Coal|Electricity|Loss (EJ/yr)"] + x[, , "PE|Biomass|Electricity (EJ/yr)"] <- x[, , "PE|Biomass|Electricity (EJ/yr)"] + + x[, , "PE|Biomass|Electricity|Loss (EJ/yr)"] + x[, , "PE|Gas|Electricity (EJ/yr)"] <- x[, , "PE|Gas|Electricity (EJ/yr)"] + + x[, , "PE|Gas|Electricity|Loss (EJ/yr)"] + x <- x[, , c("PE|Coal|Electricity|Loss (EJ/yr)", "PE|Biomass|Electricity|Loss (EJ/yr)", + "PE|Gas|Electricity|Loss (EJ/yr)"), invert = TRUE] # add more variables x <- mbind(x, setNames(dimSums(x[, , "PE|", pmatch = TRUE], dim = 3), "PE (EJ/yr)")) @@ -41,9 +45,11 @@ calcPE <- function(subtype = "IEA", ieaVersion = "default") { x <- mbind(x, setNames(dimSums(x[, , "PE|Gas", pmatch = TRUE], dim = 3), "PE|Gas (EJ/yr)")) x <- mbind(x, setNames(dimSums(x[, , "PE|Biomass", pmatch = TRUE], dim = 3), "PE|Biomass (EJ/yr)")) + ieaYear <- if (ieaVersion == "default") 2022 else 2023 return(list(x = x, weight = NULL, unit = "EJ", - description = "IEA Primary Energy Data based on 2022 version of IEA Energy Balances")) + description = paste0("IEA Primary Energy Data based on ", ieaYear, + " version of IEA Energy Balances"))) } else if (subtype == "IEA_WEO") {