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

readIEA() drop all data for USSR #43

Open
0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q opened this issue Feb 4, 2022 · 9 comments
Open

readIEA() drop all data for USSR #43

0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q opened this issue Feb 4, 2022 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q
Copy link
Member

data$COUNTRY <- toolCountry2isocode(data$COUNTRY, warn = FALSE) # nolint

@fbenke-pik
Copy link
Contributor

fbenke-pik commented Feb 7, 2022

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q Just to be sure, you want to have the USSR (aka "SUN") data removed altogether for readSource("IEA", subtype = "EnergyBalances"), right? Or do you want it to be disaggregated into SUN countries?

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q
Copy link
Member Author

It is being dropped right now. I always assumed there was no data from the USSR in the IEA balances, because I always looked at the output of this function before. That was my mistake.
I would very much like to use disaggregated data for the USSR prior to 1990.

@fbenke-pik
Copy link
Contributor

fbenke-pik commented Feb 8, 2022

Ok, thanks for clarification. I had a closer look. There is a madrat function toolISOhistorical applied that should take care of resolving data of regions that no longer exist like USSR. Problem is, the function uses as weight the values of the "transition year", in the case of USSR 1991. Since this is NA in the sources, the historical data just gets 0s as weights and is effectively removed.

I can think of two ways to fix this and would like @LaviniaBaumstark to pick one, as she is the author of toolISOhistorical.

  1. Disaggregate USSR outside the madrat helper toolISOhistorical manually
  2. Enhance madrat helper toolISOhistorical to accept an optional weight

@LaviniaBaumstark
Copy link
Member

  1. sounds good, but maybe also
  2. adjust toolISOhistorical to use optional other year for transition year

@fbenke-pik
Copy link
Contributor

  1. wont help here, because it has to be a transition year after the end of the extinct region (so you have values for all the countries the region is dissolved into). looks like data for all years after 1991 is 0 or NA for the data I want to take care of

@fbenke-pik
Copy link
Contributor

besides, 3) can already be achieved by changing the transition year passed with the argument "mapping"

@fbenke-pik
Copy link
Contributor

fbenke-pik commented Feb 8, 2022

I finished implementation. @0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q

since the magclass object is really big, any idea how i can test locally before submitting the PRs for review? i.e. any variables you care about in particular for which i should check if the disaggregation worked?

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q
Copy link
Member Author

Don't.

sbatch --wrap "Rscript -e \"devtools::load_all(<your mrcommons branch>); saveRDS(mrcommons:::readIEA(subtype = 'EnergyBalances'), 'readIEA_EnergyBalanaces.rds')" --output=log.txt --qos=priority

Then look at the results at leisure.

@fbenke-pik
Copy link
Contributor

Should be solved by PR #44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants