IAMconsortium / pyam

Analysis & visualization of energy & climate scenarios
https://pyam-iamc.readthedocs.io/
Apache License 2.0
236 stars 120 forks source link

Facilitate region-aggregation with inconsistent model scenario region time #792

Closed danielhuppmann closed 1 year ago

danielhuppmann commented 1 year ago

Please confirm that this PR has done the following:

Description of PR

This PR improves the handling of region-aggregation when variables and weights have an inconsistent index.

Now, if weights are missing, a ValueError is raised with (the head of) a list of missing rows. If variable data is missing, a warning is written to the log with (the head of) a list of missing rows.

closes #558

codecov[bot] commented 1 year ago

Codecov Report

Merging #792 (93e39a6) into main (f023ec3) will increase coverage by 0.1%. The diff coverage is 100.0%.

@@           Coverage Diff           @@
##            main    #792     +/-   ##
=======================================
+ Coverage   94.5%   94.7%   +0.1%     
=======================================
  Files         62      62             
  Lines       5966    5996     +30     
=======================================
+ Hits        5643    5681     +38     
+ Misses       323     315      -8     
Files Coverage Δ
pyam/aggregation.py 99.2% <100.0%> (+<0.1%) :arrow_up:
tests/test_feature_aggregate.py 99.0% <100.0%> (+0.1%) :arrow_up:
tests/test_feature_growth_rate.py 100.0% <100.0%> (ø)
tests/test_io.py 100.0% <100.0%> (ø)

... and 2 files with indirect coverage changes

danielhuppmann commented 1 year ago

I vaguely recall that @orichters expressed interest in a more flexible handling of the region-aggregation-with-weights...?

orichters commented 1 year ago

I vaguely recall that @orichters expressed interest in a more flexible handling of the region-aggregation-with-weights...?

I do not 😃. Maybe @Renato-Rodrigues, if it was someone from the REMIND team?

danielhuppmann commented 1 year ago

Right, this PR (together with #787) was a more structured second attempt at #754 to have a clean separation between clean-up and new features...