IAMconsortium / pyam

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

Support adding dataframes of metadata #678

Closed gidden closed 2 years ago

gidden commented 2 years ago

At present, one must either add metadata from a file (load_meta()) or individually (set_meta()). We can extend one of these (probably best to do so on set_meta()) to support loading multiple metadata columns in one go.

Does anyone have an opinion before I propose an implementation?

cc @danielhuppmann

danielhuppmann commented 2 years ago

Sure, good idea! For completeness, you can already pass a suitable pd.DataFrame at initialization using

pyam.DataFrame(data, meta=<some meta frame>)

This is implemented here, should be just a few lines (and a test) to extend set_meta() https://github.com/IAMconsortium/pyam/blob/1abb9784c7bb79cc3701deb5161fa20c1899d2ae/pyam/core.py#L206

gidden commented 2 years ago

closed by #679