Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize an IamDataFrame from pd.DataFrame with formatting specs #199

Merged
merged 31 commits into from
Feb 22, 2019

Conversation

danielhuppmann
Copy link
Member

@danielhuppmann danielhuppmann commented Feb 20, 2019

Please confirm that this PR has done the following:

  • Tests Added
  • Documentation Added
  • Description in RELEASE_NOTES.md Added

Description of PR

This PR allows initialising an IamDataFrame from a file or pd.DataFrame and filling out missing required columns efficiently.

See the unit tests in tests/test_cast_to_iamc.py for possible use cases.

gidden and others added 29 commits February 18, 2019 08:21
@danielhuppmann
Copy link
Member Author

@znicholls, this PR tries to make it easier to initialize an IamDataFrame which doesn't quite have the right format, for example when you have a pd.DataFrame in a scen-file format with values in multiple columns and the column name being the identifier. See also the discussion here #193 (comment).

Can you check whether that works with your thinking for the ScmDataFrame?

@coveralls
Copy link

coveralls commented Feb 20, 2019

Coverage Status

Coverage increased (+0.3%) to 84.508% when pulling d20bc4a on danielhuppmann:pd-to-pyam-concat into a6ac0c5 on IAMconsortium:master.

Copy link
Collaborator

@znicholls znicholls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice changes @danielhuppmann ! That extra flexibility is very cool.

The IamDataFrame format is suitably sane that whatever you do it's going to be easy for us to cast from ScmDataFrame to an IamDataFrame. I think no matter what, the awkward 'model' name clash is here to stay so we just put that in the 'not perfect but ok' basket (unless model became 'iam' in an IamDataFrame but that sort of backwards compatibility breaking change seems unnecessary right now).

@znicholls
Copy link
Collaborator

will leave final review and merge to @gidden nice tweak @danielhuppmann

pyam/core.py Outdated Show resolved Hide resolved
pyam/utils.py Show resolved Hide resolved
pyam/utils.py Outdated Show resolved Hide resolved
@gidden
Copy link
Member

gidden commented Feb 21, 2019

ok, small changes requested. looks great!

@gidden gidden merged commit fcb81fe into IAMconsortium:master Feb 22, 2019
@gidden
Copy link
Member

gidden commented Feb 22, 2019

thanks @danielhuppmann !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants