IAMconsortium / pyam

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

`map_regions()` to `downscale_regions()` #225

Open gidden opened 5 years ago

gidden commented 5 years ago

With aggregate_regions() doing the work to upscale (many-to-one) regional data, map_regions() should be deprecated and a new downscale_regions() should be added. The function signature should look something like:

def downscale_regions(mapping, proxy=None)

By default, it should copy regional data into subregions. If provided a proxy (i.e., another variable), then it should do a pattern scaling to that variable, which must be supplied at the "sub regional" resolution.

danielhuppmann commented 5 years ago

Summarizing discussion in #207 - rather than deprecate map_regions(), the function should be refactored to parse the given mapping and call aggregate_region() or downscale_region() iteratively as required.

This allows to distinguish the sanity-checking of the mapping (e.g., is a particular order required aggregating from country to region to world) from the data manipulation operation.

danielhuppmann commented 4 years ago

there is now a dedicated downscale_region() function, but no work has been done on deprecating/refactoring the map_regions() function