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

add Price|Carbon|Imported for ELEVATE #490

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

orichters
Copy link
Contributor

  • add Price|Carbon|Imported for ELEVATE
  • make sure it is backwards-compatible
  • make sure data missing but listed in int2ext for global aggregation is not leading to fails anymore

@orichters orichters force-pushed the PriceCarbonImport branch 4 times, most recently from 0e3863c to 95aa02e Compare December 6, 2023 10:04
@@ -1015,7 +1032,9 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL,
map <- data.frame(region=getRegions(out),world="GLO",stringsAsFactors=FALSE)
tmp_GLO <- new.magpie("GLO",getYears(out),getNames(out),fill=0)

for (i2e in names(int2ext)){
int2ext <- int2ext[intersect(names(int2ext), getNames(out))] # select only data that exists

Choose a reason for hiding this comment

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

not familiar with this. would be great if @pweigmann could check this

Copy link
Contributor

Choose a reason for hiding this comment

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

looks good!

@@ -1015,7 +1032,9 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL,
map <- data.frame(region=getRegions(out),world="GLO",stringsAsFactors=FALSE)
tmp_GLO <- new.magpie("GLO",getYears(out),getNames(out),fill=0)

for (i2e in names(int2ext)){
int2ext <- int2ext[intersect(names(int2ext), getNames(out))] # select only data that exists
Copy link
Contributor

Choose a reason for hiding this comment

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

looks good!

@orichters
Copy link
Contributor Author

Fixed another error. If none of the if clauses evaluates to TRUE, it runs setNames(0) and that fails because this is not a magclass object. Now, initalize with 0 * pm_taxCO2eq and this works both on newer Elevate gdx files as old NGFS files.

@orichters orichters merged commit cbddfe9 into pik-piam:master Dec 6, 2023
4 checks passed
@orichters orichters deleted the PriceCarbonImport branch January 31, 2024 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants