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

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

Open
yiqiaowang-arch opened this issue Dec 4, 2023 · 1 comment

Comments

@yiqiaowang-arch
Copy link

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']
  1. In python, every time series data entry needs a separate dataframe, which should have the column name identical with the location name;
  2. Then I need to construct a dict, with keys equals to the previous specified name, and values as corresponding dataframe,
  3. 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.
@brynpickering
Copy link
Member

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.

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

2 participants