Closed jkikstra closed 2 years ago
This seems like a total sum across all regions (including world) is equal to 0.
The reason this function is called is because some models report global-only emissions in World, which do not exist in a specific region. Therefore they need to be harmonized separately.
Is it possible to assess if 0-only emissions are in the data set to be harmonized?
Hi @gidden thanks for having a look!
Yes, I know what it does, but could not figure out why the error comes up in the case of supplying it with data that has only the 'World' region to start with. Perhaps it comes from changes in the pandas
package?
It should not be possible that 0-only emissions are provided to harmonization, and this was also not the case in my test case.
In my commit I've put in a check that will, for the model part, only do subtract_regions_from_world() if there are actually other regions in the model data. It's a bit patchy, but perhaps catches one problem that might occur?
Hi Jarmo - if there is only world data, maybe the best way is to do the check before going into _harmonize_regions()
?
Hi Matt - yes that would be better. However, it seems to me that there is a bit of rewiring required to make that work.
Right now it seems that there are two options, determined by the .yaml input boolean global_harmonization_only
.
_harmonize_regions
: this will harmonize regions and also gases at a lower detail, but does not have a catch for if there is only world data_harmonize_global_total
: this will harmonize only global regions, but also only total gases for many, rather than just the most detailed data available. Hence, this will crash if for instance only 'Emissions|CO2|Energy and Industrial Processes' is supplied.So probably a third function, or an extra boolean, should be added that does something like "harmonize_global" (so not gas totals), which is what we do for the climate assessment.
ping on this @jkikstra - if this is no longer need for ar6 pipeline can you close please?
with a simple input file, this line gives
ZeroDivisionError: division by zero
at:@gidden can you check?