IAMconsortium / pyam

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

Implement default values for the data-operation functions #529

Open danielhuppmann opened 3 years ago

danielhuppmann commented 3 years ago

Based on the discussion initiated by @pjuergens at #524, this issue takes one of the further improvements discussed in that issue:

The initial solution implemented in #527 implicitly assumes None if a value for a specific index on a but not on b (or vice-versa). For illustration, model_a|scen_b is dropped in the unit tests, see https://github.com/IAMconsortium/pyam/blob/63bbea845284f1127e04b1d55aa830b567cd1e0a/tests/test_ops.py#L10

As an additional feature, it would be helpful to (optionally) set a default value in the data-ops functions if a value is defined in one argument but not another.

danielhuppmann commented 3 years ago

Update: there is now a fillna option, but this not work with pint.Quantity instances.