IAMconsortium / pyam

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

Add a to_xarray converter #619

Closed coroa closed 5 months ago

coroa commented 2 years ago

Please confirm that this PR has done the following:

Adding to RELEASE_NOTES.md (remove section after adding to RELEASE_NOTES.md)

Please add a single line in the release notes similar to the following:

- (#XX)[http://link-to-pr.com] Added feature which does something

Description of PR

Add a simple utility method to convert a pyam dataframe into a xarray DataArray with a configurable set of stacked dimensions (so as not to add too many nan's).

This is a draft to get feedback on the judged utility of having something like this.

Possible points for improvement:

codecov[bot] commented 2 years ago

Codecov Report

Merging #619 (b0e3c4c) into main (21ada20) will decrease coverage by 0.2%. The diff coverage is 27.2%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #619     +/-   ##
=======================================
- Coverage   94.3%   94.1%   -0.3%     
=======================================
  Files         54      54             
  Lines       5444    5462     +18     
=======================================
+ Hits        5138    5142      +4     
- Misses       306     320     +14     
Impacted Files Coverage Δ
pyam/utils.py 88.6% <23.8%> (-3.3%) :arrow_down:
pyam/core.py 94.6% <100.0%> (+<0.1%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 21ada20...b0e3c4c. Read the comment docs.

gidden commented 5 months ago

Closing this for now for lack of work, @coroa can pick it up again if he'd like to