calliope-project / calliope

A multi-scale energy systems modelling framework
https://www.callio.pe
Apache License 2.0
287 stars 93 forks source link

Documentation not clear: time series data import from pandas DataFrame #522

Open yiqiaowang-arch opened 10 months ago

yiqiaowang-arch commented 10 months ago

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:

  1. for every time-series data entry in the yaml file, I need a specified name for that data;
  2. 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']
  3. In python, every time series data entry needs a separate dataframe, which should have the column name identical with the location name;
  4. Then I need to construct a dict, with keys equals to the previous specified name, and values as corresponding dataframe,
  5. 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:

brynpickering commented 9 months ago

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.