Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Residential and commercial floor space. #352

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '32781942'
ValidationKey: '32906160'
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
- 'Warning: namespace ''.*'' is not available and has been replaced'
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: 'mrremind: MadRat REMIND Input Data Package'
version: 0.167.4
date-released: '2023-08-14'
version: 0.168.0
date-released: '2023-08-18'
abstract: The mrremind packages contains data preprocessing for the REMIND model.
authors:
- family-names: Baumstark
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: mrremind
Title: MadRat REMIND Input Data Package
Version: 0.167.4
Date: 2023-08-14
Version: 0.168.0
Date: 2023-08-18
Authors@R: c(
person("Lavinia", "Baumstark", , "[email protected]", role = c("aut", "cre")),
person("Renato", "Rodrigues", role = "aut"),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export(calcEDGAR7Fgases)
export(calcEEAGHGProjections)
export(calcEmber)
export(calcEmissionFactorsFeedstocks)
export(calcFloorspace)
export(calcHRE)
export(calcIEA_ETP)
export(calcIEA_EVOutlook)
Expand Down
30 changes: 24 additions & 6 deletions R/calcFloorspace.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
#' Floor space in buildings
#'
#' Residential, commercial and total floor space from EDGE-B. Set
#'
#' @author Antoine Levesque, Robin Hasse
#'
#' @param onlyTotal boolean, only give total instead of sub-sectoral floor space
#' @return MAgPIE object with buildings floor space
#'
#' @importFrom madrat readSource
#' @importFrom magclass collapseNames
#' @export
#'
calcFloorspace <- function(onlyTotal = FALSE) {

calcFloorspace <- function() {

data <- readSource("EDGE", subtype = "Floorspace")
data <- collapseNames(data[,,"buildings"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Barging in here without being asked: this has the (undesired) side effect of cutting all REMIND versions without remindmodel/remind#1197 off from new input data.
All project branches (SDP, Tokyo stuff, I don't know) that for whatever reason don't merge the REMIND changes will not be able to produce new input data, even if they need some because they did change something on their end.
I don't know which project needs new input data, and the REMIND changes are quite isolated and can easily be cherry-picked (I think), but it would be to put this behind a subtype parameter to allow them to toggle this.
If fullREMIND() would produce two files from this data, one with and one without the collapsed dimension, projects could go on using input data without intervention.

Copy link
Contributor Author

@robinhasse robinhasse Jan 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the point and adding this is no effort. On the other hand, using newer input data will be impossible in many occasions. We just broke this option with the introduction of a new scenario that is now part of the input data and will give you a Domain violation Error with any REMIND version that is more than one week old.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, wasn't aware of that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So after some discussion some time ago also with @LaviniaBaumstark, I decided to create a new file f36_floorspace.cs4r with the sub-sectoral floor space and keep the old p36_floorspace.cs4r for a while. Once input data eith the new file is available, I will adapt REMIND and remind 2 to make use of it. This PR can be merged with no side-effects and compatibility issues expected.


return(list(x=data,weight=NULL, unit = "million m2", description = "Buildings floorspace"))
data <- readSource("EDGE", subtype = "Floorspace")

if (onlyTotal) {
data <- collapseNames(data[, , "buildings"])
}

return(list(x = data,
weight = NULL,
unit = "million m2",
description = "Buildings floor space"))
}
3 changes: 2 additions & 1 deletion R/fullREMIND.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ fullREMIND <- function(rev = 0) {
calcOutput("FEdemand", subtype = "ES", round = 6, file = "f29_esdemand.cs4r")
calcOutput("ChemicalFeedstocksShare", round = 2, file = "p37_chemicals_feedstock_share.cs4r")
calcOutput("EnergyEffPaths", round = 6, file = "f29_efficiency_growth.cs4r")
calcOutput("Floorspace", round = 6, file = "p36_floorspace_scen.cs4r")
calcOutput("Floorspace", onlyTotal = TRUE, round = 1, file = "p36_floorspace_scen.cs4r")
calcOutput("Floorspace", round = 1, file = "f36_floorspace_scen.cs4r")
calcOutput("WeightNash", round = 6, file = "p80_eoWeights_fix.cs4r")
calcOutput("IntertempElastSubst", round = 6, file = "pm_ies.cs4r")
calcOutput("TimePref", round = 6, file = "p23_prtp.cs4r")
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MadRat REMIND Input Data Package

R package **mrremind**, version **0.167.4**
R package **mrremind**, version **0.168.0**

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

Expand Down Expand Up @@ -39,7 +39,7 @@ In case of questions / problems please contact Lavinia Baumstark <lavinia@pik-po

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

Baumstark L, Rodrigues R, Levesque A, Oeser J, Bertram C, Mouratiadou I, Malik A, Schreyer F, Soergel B, Rottoli M, Mishra A, Dirnaichner A, Pehl M, Giannousakis A, Klein D, Strefler J, Feldhaus L, Brecha R, Rauner S, Dietrich J, Bi S, Benke F, Weigmann P, Richters O, Hasse R, Fuchs S, Mandaroux R (2023). _mrremind: MadRat REMIND Input Data Package_. R package version 0.167.4, <https://github.com/pik-piam/mrremind>.
Baumstark L, Rodrigues R, Levesque A, Oeser J, Bertram C, Mouratiadou I, Malik A, Schreyer F, Soergel B, Rottoli M, Mishra A, Dirnaichner A, Pehl M, Giannousakis A, Klein D, Strefler J, Feldhaus L, Brecha R, Rauner S, Dietrich J, Bi S, Benke F, Weigmann P, Richters O, Hasse R, Fuchs S, Mandaroux R (2023). _mrremind: MadRat REMIND Input Data Package_. R package version 0.168.0, <https://github.com/pik-piam/mrremind>.

A BibTeX entry for LaTeX users is

Expand All @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is
title = {mrremind: MadRat REMIND Input Data Package},
author = {Lavinia Baumstark and Renato Rodrigues and Antoine Levesque and Julian Oeser and Christoph Bertram and Ioanna Mouratiadou and Aman Malik and Felix Schreyer and Bjoern Soergel and Marianna Rottoli and Abhijeet Mishra and Alois Dirnaichner and Michaja Pehl and Anastasis Giannousakis and David Klein and Jessica Strefler and Lukas Feldhaus and Regina Brecha and Sebastian Rauner and Jan Philipp Dietrich and Stephen Bi and Falk Benke and Pascal Weigmann and Oliver Richters and Robin Hasse and Sophie Fuchs and Rahel Mandaroux},
year = {2023},
note = {R package version 0.167.4},
note = {R package version 0.168.0},
url = {https://github.com/pik-piam/mrremind},
}
```
20 changes: 20 additions & 0 deletions man/calcFloorspace.Rd

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

Loading