Closed gidden closed 5 years ago
strongly in favour of the "User Experience" option, see https://github.com/IAMconsortium/pyam/pull/190#issuecomment-462260875
note that the IPCC notebooks at https://github.com/iiasa/ipcc_sr15_scenario_analysis all use pyam.IamDataFrame('<file>')
, so that would introduce an incompatibility going forward...
I'd be in favour of the user experience too and refactoring the back end so they all get sent to the same format_data
(or similar) pipeline which handles all the different possibilities
I think that having merged #199, we have implicitly decided on the way forward.
There are a number of functions which "construct" dataframes, e.g.,
concat()
andappend()
. How these work should be harmonized to a common data model.At the moment,
concat()
requires that all input bepyam.IamDataFrame
s.append()
on the other hand, can take any castable object such aspd.DataFrame
or even file names which are read in at execution time.The pros and cons deal with user experience vs. explicit interfaces using native datatypes. It is not clear which outweighs the other, so further comments from devs and users is appreciated.
So let us assume you have data in two files
a.csv
andb.csv
that you want to combine. The options would look as follows:User Experience
Explicit Interfaces
The trickiness here is that our constructor currently supports two primary castable types:
pd.DataFrame
s and files. If we choose "Explicit Interfaces", that would suggest that we no longer support reading files directly inpyam.IamDataFrame.__init__
.Thoughts? @znicholls @danielhuppmann others?