Documentation not clear: time series data import from pandas DataFrame
yiqiaowang-arch opened this issue · comments
When adding time series data while running calliope in python, I found the documentation for this is really fragmented and there's little description on how I can pass dataframe into the model. I have figured it out myself; but I would suggest that a clearer tutorial is favored for other users.
What I did for the preparation:
- for every time-series data entry in the yaml file, I need a specified name for that data;
- in model configuration, I need a pair of empty large bracket as a placeholder of my future input from python:
model:
name: 'building in plot 8'
calliope_version: 0.6.10
timeseries_data: {} # I think this is the most critical part, as it's not mentioned anywhere in the documentation.
subset_time: ['2050-01-01', '2050-01-02']
- In python, every time series data entry needs a separate dataframe, which should have the column name identical with the location name;
- Then I need to construct a dict, with keys equals to the previous specified name, and values as corresponding dataframe,
- finally, when setting up model, I need to pass
timeseries_dataframes=dict_of_dfs
:
model = calliope.Model(building_specific_config, timeseries_dataframes=dict_timeseries_df)
Issues about documentation:
- In Building a model - time series data: it only mentioned how to pass dict into model, but no information about how to setup model configuration that supports passing dataframe into it;
- In Running a model - Running interactively with Python: It also did not mention how to read dataframe from python, although this chapter was recommended when reading "Building a model - time series data";
- In Tutorials: this chapter is recommended when reading "Running a model - Running interactively with Python", but it still has no info about time series data from dataframe;
- In Configuration and defaults - Model configuration: timeseries_data is mentioned to replace timeseries_data_path, but I cannot find examples on how to set value to this key.
Agreed that we could be more explivit about this. However, I do think this section in the documentation is providing the information you have listed in your preparation steps. If you would like to extend that section with added information, please do submit a pull request! (you will need to point the pull request at the 0.6
branch)
You could also create your own jupyter notebook similar to those we have in our documentation going through the steps and submit that as pull request.