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

Add pyam.read_excel and pyam.read_csv functions #690

Open
danielhuppmann opened this issue Aug 21, 2022 · 0 comments
Open

Add pyam.read_excel and pyam.read_csv functions #690

danielhuppmann opened this issue Aug 21, 2022 · 0 comments

Comments

@danielhuppmann
Copy link
Member

Per a discussion by @l-welder and @coroa on Slack...

Description

pyam currently uses pyam.IamDataFrame(<file>) to read data from an xlsx or csv file, which is different from specific top-level functions implemented by pandas: pandas.read_excel() and pandas.read_csv().

To add to the confusion, pyam has a utility method read_file() which is exposed as a package top-level function but does not return an IamDataFrame.

Proposed solution

  • Refactor read_file() to make it an internal method to reduce confusion
  • Add classmethods pyam.read_excel and pyam.read_csv that initialize an IamDataFrame

For discussion

Should we add a deprecation-warning when initializing an IamDataFrame from file as pyam.IamDataFrame(<file>)? Or simply allow two parallel approaches going forward?

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

No branches or pull requests

1 participant