Skip to content

Commit

Permalink
Tidy duplicate implementation of TCEP source
Browse files Browse the repository at this point in the history
  • Loading branch information
robinhasse committed Sep 13, 2024
1 parent 3e09553 commit 8fbc746
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '1418367'
ValidationKey: '1438488'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cff-version: 1.2.0
message: If you use this software, please cite it using the metadata from this file.
type: software
title: 'mredgebuildings: Prepare data to be used by the EDGE-Buildings model'
version: 0.7.1
date-released: '2024-09-11'
version: 0.7.2
date-released: '2024-09-13'
abstract: Prepare data to be used by the EDGE-Buildings model.
authors:
- family-names: Hasse
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: mredgebuildings
Title: Prepare data to be used by the EDGE-Buildings model
Version: 0.7.1
Date: 2024-09-11
Version: 0.7.2
Date: 2024-09-13
Authors@R: c(
person("Robin", "Hasse", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-1818-3186")),
Expand Down
4 changes: 1 addition & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export(calcHeatingCapacity)
export(calcHeatingSystem)
export(calcHouseholdSize)
export(calcIEAPFU)
export(calcIEAfloorspace)
export(calcLifetimeParams)
export(calcMatchingReference)
export(calcPFUDB)
Expand All @@ -29,7 +28,7 @@ export(calcSurface)
export(calcTCEP)
export(calcUEdemand)
export(calcUValue)
export(calcUvalues)
export(calcUValueSource)
export(convertCensusHub)
export(convertDaioglou)
export(convertDeetman2020)
Expand Down Expand Up @@ -64,7 +63,6 @@ export(readEurostatBuildings)
export(readGDL)
export(readHDDCDDtemp)
export(readHotmaps)
export(readIEAfloorspace)
export(readOdyssee)
export(readPFUDB)
export(readTCEP)
Expand Down
5 changes: 2 additions & 3 deletions R/calcFloorspacePast.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,11 @@ calcFloorspacePast <- function() {
unit = "million m2")

# IEA data: take only India
ind <- readSource("IEAfloorspace", convert = FALSE) %>%
ind <- readSource("TCEP", subtype = "floorspace", convert = FALSE) %>%
as.quitte() %>%
filter(.data[["region"]] == "India",
.data[["period"]] %in% c(2000, 2011),
.data[["subsector"]] == "Residential") %>%
select(-"subsector") %>%
.data[["variable"]] == "Residential") %>%
mutate(variable = "floor space",
value = .data[["value"]] * 1000, # billion m2 -> million m2
unit = "million m2",
Expand Down
17 changes: 0 additions & 17 deletions R/calcIEAfloorspace.R

This file was deleted.

24 changes: 24 additions & 0 deletions R/calcUValueSource.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#' Passes U-values read from source
#'
#' @author Falk Benke, Robin Hasse
#'
#' @param subtype source of U-values
#' @export

calcUValueSource <- function(subtype = c("EUBuildingsObservatory", "ETSAP")) {

subtype <- match.arg(subtype)

x <- if (subtype == "EUBuildingsObservatory") {
readSource("EUBuildingsObservatory", convert = FALSE)
} else {
readSource("ETSAP", convert = FALSE)
}

return(list(x = x,
min = 0,
isocountries = FALSE,
unit = "W/m2K",
description = paste("U-values as reported by", subtype)
))
}
29 changes: 0 additions & 29 deletions R/calcUvalues.R

This file was deleted.

8 changes: 3 additions & 5 deletions R/fullEDGEBUILDINGS.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ fullEDGEBUILDINGS <- function(rev = 0) {
calcOutput("TCEP", subtype = "floorspace", aggregate = FALSE, file = "f_floorspace_tcep.cs4r")
calcOutput("FEUE", file = "f_feue.cs4r")
calcOutput("FEUEefficiencies", file = "f_feue_efficiencies.cs4r")

calcOutput("IEAfloorspace", aggregate = FALSE, file = "f_iea_floorspace.cs4r")
calcOutput("Uvalues", subtype = "EUBuildingsObservatory", aggregate = FALSE, file = "f_uvalues_rescom.cs4r")
calcOutput("Uvalues", subtype = "ETSAP", aggregate = FALSE, file = "f_uvalues_etsap.cs4r")

calcOutput("EfficiencyRegression", aggregate = FALSE, file = "f_feue_efficiencyPars.cs4r")
calcOutput("UValueSource", subtype = "ETSAP", aggregate = FALSE, file = "f_uvalues_etsap.cs4r")
calcOutput("UValueSource", subtype = "EUBuildingsObservatory", aggregate = FALSE, file = "f_uvalues_rescom.cs4r")

}
33 changes: 0 additions & 33 deletions R/readIEAfloorspace.R

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prepare data to be used by the EDGE-Buildings model

R package **mredgebuildings**, version **0.7.1**
R package **mredgebuildings**, version **0.7.2**

[![CRAN status](https://www.r-pkg.org/badges/version/mredgebuildings)](https://cran.r-project.org/package=mredgebuildings) [![R build status](https://github.com/pik-piam/mredgebuildings/workflows/check/badge.svg)](https://github.com/pik-piam/mredgebuildings/actions) [![codecov](https://codecov.io/gh/pik-piam/mredgebuildings/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mredgebuildings) [![r-universe](https://pik-piam.r-universe.dev/badges/mredgebuildings)](https://pik-piam.r-universe.dev/builds)

Expand Down Expand Up @@ -38,7 +38,7 @@ In case of questions / problems please contact Robin Hasse <robin.hasse@pik-pots

To cite package **mredgebuildings** in publications use:

Hasse R, Führlich P, Levesque A, Tockhorn H (2024). _mredgebuildings: Prepare data to be used by the EDGE-Buildings model_. R package version 0.7.1, <https://github.com/pik-piam/mredgebuildings>.
Hasse R, Führlich P, Levesque A, Tockhorn H (2024). _mredgebuildings: Prepare data to be used by the EDGE-Buildings model_. R package version 0.7.2, <https://github.com/pik-piam/mredgebuildings>.

A BibTeX entry for LaTeX users is

Expand All @@ -47,7 +47,7 @@ A BibTeX entry for LaTeX users is
title = {mredgebuildings: Prepare data to be used by the EDGE-Buildings model},
author = {Robin Hasse and Pascal Führlich and Antoine Levesque and Hagen Tockhorn},
year = {2024},
note = {R package version 0.7.1},
note = {R package version 0.7.2},
url = {https://github.com/pik-piam/mredgebuildings},
}
```
11 changes: 0 additions & 11 deletions man/calcIEAfloorspace.Rd

This file was deleted.

17 changes: 17 additions & 0 deletions man/calcUValueSource.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions man/calcUvalues.Rd

This file was deleted.

30 changes: 0 additions & 30 deletions man/readIEAfloorspace.Rd

This file was deleted.

0 comments on commit 8fbc746

Please sign in to comment.