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?
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
read_file()
to make it an internal method to reduce confusionpyam.read_excel
andpyam.read_csv
that initialize an IamDataFrameFor 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?