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 additional summation checks #467

Merged
merged 3 commits into from
Sep 22, 2023
Merged

Conversation

fbenke-pik
Copy link
Contributor

No description provided.

@fbenke-pik
Copy link
Contributor Author

fbenke-pik commented Sep 21, 2023

Currently, significant gaps for these additional summation checks make the convGDX2MIF test fail. Affected summations are FE|Industry|Steel|++|Primary, Emi|GHG, Emi|GHG 1, SE|Electricity, SE|Hydrogen, Carbon Management|Carbon Capture

@fschreyer @0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q

Is it expected that these summation checks still fail? If so, how should we go about this: ignore warning or fix them before merging this?

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q
Copy link
Member

Is there a way to get to the specific errors the test is encountering? All very fiddly.

I suspect this is basically remindmodel/remind#1399, fixed by remindmodel/remind#1404. If so, it is a bug in the gdxes, and we should replace them and keep the test.

Maybe we can triage the summation mismatches, marking some as "known and accepted/ignored", throwing a warning, and having others, newly introduced ones, throw an error.

@fbenke-pik
Copy link
Contributor Author

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q if you send me an updated gdx for testing, i can replace it and check, which of the errors remain.

@fbenke-pik
Copy link
Contributor Author

fbenke-pik commented Sep 21, 2023

Is it expected that these summation checks still fail? If so, how should we go about this: ignore warning or fix them before merging this?

Don't oppose this option in general, but for this specific case, all the failures were for checks added manually via summations file. So the most straightforward options to react are: fixing the failed checks or fixing/removing the check from the summations file.

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q
Copy link
Member

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q if you send me an updated gdx for testing, i can replace it and check, which of the errors remain.

remindmodel/remind#1404 triggered v3.2.1.dev122,
/p/projects/remind/modeltests/remind/output/SSP2EU-NPi-AMT_2023-09-15_22.09.42/fulldata.gdx is v3.2.1.dev119, so that should work.

@fbenke-pik
Copy link
Contributor Author

Ok, i replaced the gdx used for testing and the FE|Industry|Steel|++|Primary check no longer fails.

@fbenke-pik
Copy link
Contributor Author

fbenke-pik commented Sep 21, 2023

@fschreyer Gaps with an up-to-date gdx

### Analyzing provided data.
# Use ~/dev/pik-piam/remind2/inst/extdata/additional_summation_checks.csv to check if summation groups add up.
# Analyzing results of model REMIND

variable groups found in additional_summation_checks.csv                      

Carbon Management|Carbon Capture >                                            
   + Carbon Management|Storage                                             
   + Carbon Management|Usage                                               
Relative difference between 1.08% and 100%, absolute difference up to 300.02 Mt CO2/yr.

Emi|GHG <>                                                                    
   + Emi|GHG|Gross|Energy|Supply|Electricity                               
   + Emi|GHG|Gross|Energy|Supply|Non-electric                              
   + Emi|GHG|Energy|Demand|+|Buildings                                     
   + Emi|GHG|Gross|Energy|Demand|+|Industry                                
   + Emi|GHG|Energy|Demand|+|Transport                                     
   + Emi|GHG|Energy|Demand|+|CDR                                           
   + Emi|GHG|+++|Industrial Processes                                      
   + Emi|GHG|+++|Waste                                                     
   + Emi|GHG|+++|Agriculture                                               
   + Emi|GHG|+++|Land-Use Change                                           
   + Emi|CO2|CDR|BECCS                                                     
   + Emi|CO2|CDR|DACCS                                                     
   + Emi|CO2|CDR|Industry CCS|Synthetic Fuels                              
   + Emi|CO2|CDR|EW                                                        
   + Emi|CO2|+|Energy                                                      
Relative difference between -92.97% and 7.4%, absolute difference up to 39769.51 Mt CO2eq/yr.

Emi|GHG 1 <>                                                                  
   + Emi|CO2|+|Industrial Processes                                        
   + Emi|CO2|+|Land-Use Change                                             
   + Emi|GHG|+|CH4                                                         
   + Emi|GHG|+|N2O                                                         
   + Emi|GHG|+|F-Gases                                                     
   + Emi|CO2|+|non-BECCS CDR                                               
Relative difference between -7.4% and 92.97%, absolute difference up to 39769.51 Mt CO2eq/yr.

SE|Electricity >                                                              
   + SE|Input|Electricity|Hydrogen|Synthetic Fuels|+|Liquids               
   + SE|Input|Electricity|Hydrogen|Synthetic Fuels|+|Gases                 
   + SE|Input|Electricity|Hydrogen|direct FE H2                            
   + SE|Input|Electricity|Hydrogen|Electricity Storage                     
   + SE|Input|Electricity|Buildings                                        
   + SE|Input|Electricity|Industry                                         
   + SE|Input|Electricity|Transport                                        
   + SE|Input|Electricity|CDR                                              
   + SE|Input|Electricity|Self Consumption Energy System                   
Relative difference between 0.000136% and 6.5%, absolute difference up to 1.3 EJ/yr.

SE|Hydrogen >                                                                 
   + FE|Industry|+|Hydrogen                                                
   + FE|Buildings|+|Hydrogen                                               
   + FE|Transport|+|Hydrogen                                               
   + FE|CDR|+|Hydrogen                                                     
   + SE|Input|Hydrogen|Electricity|+|Normal Turbines                       
   + SE|Input|Hydrogen|Electricity|+|Forced VRE Turbines                   
   + SE|Input|Hydrogen|Synthetic Fuels|+|Liquids                           
   + SE|Input|Hydrogen|Synthetic Fuels|+|Gases                             
Relative difference between 0.123% and 81.11%, absolute difference up to 0.0316 EJ/yr.

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q
Copy link
Member

Gaps with an up-to-date gdx

Excellent!
Now we know more about the quality of our post-processing.
Commit these additional checks, update the gdxes test-convGDX2mif.R pulls, add an issue for each failing summation and assign people to them.

@fbenke-pik
Copy link
Contributor Author

Commit these additional checks,

I will do that, as soon as @fschreyer confirms that the summations as committed here are correct and the problem is indeed with the data/reporting

update the gdxes test-convGDX2mif.R pulls

This has been done. I replaced the gdx pulled from RSE server as part of the test. No code change necessary.

add an issue for each failing summation and assign people to them.

That would be sth. @fschreyer has to do, as I would not know the responsibilities,

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q
Copy link
Member

@fschreyer is not in today, so I set up #469, #470, #471, #472, #473. They can be triaged and assigned when he is back.

@fbenke-pik fbenke-pik marked this pull request as ready for review September 22, 2023 09:35
@fbenke-pik fbenke-pik merged commit 135e96c into pik-piam:master Sep 22, 2023
2 checks passed
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.

2 participants