Skip to content

Add a module for implementing (sub-annual) time slices#197

Closed
behnam-zakeri wants to merge 5 commits into
iiasa:mainfrom
behnam-zakeri:add_timeslice
Closed

Add a module for implementing (sub-annual) time slices#197
behnam-zakeri wants to merge 5 commits into
iiasa:mainfrom
behnam-zakeri:add_timeslice

Conversation

@behnam-zakeri

@behnam-zakeri behnam-zakeri commented May 29, 2024

Copy link
Copy Markdown
Contributor

This PR introduces an algorithm for adding sub-annual time slices to a MESSAGEix scenario. This includes:

  • Read the data from an input data (currently only Excel) file
  • Configure the data of time slices for MESSAGEix sets (time slice names, duration, temporal level, temporal hierarchy).
  • Identify technologies that must be represented at the time slice level.
  • Add time slices to relevant parameters, e.g., "output", "input", "capacity_factor", "var_cost" etc., for relevant technologies.
  • Solve the modified scenario.

How to review

There is a data file for the test case of Westeros baseline scenario. The reviewer can run the example code at the bottom of add_timeslice.py module. This can be done once for 2 and another time for 4 time slices, by changing the input parameter n_time. The results should show:

  • ACT and demand for the respective time slices in each run.
  • for 2 time slices, the results should be the same as "Westeros_seasonality.ipynb" tutorial.

PR checklist

  • Continuous integration checks all ✅
  • Add or expand tests; coverage checks both ✅
  • Add, expand, or update documentation.
  • Update doc/whatsnew.

@behnam-zakeri behnam-zakeri changed the title Add a module for implementing (sub-annual) time slices in a MESSAGEix scenario Add a module for implementing (sub-annual) time slices May 29, 2024
@behnam-zakeri behnam-zakeri requested a review from glatterf42 May 29, 2024 20:34
@behnam-zakeri behnam-zakeri self-assigned this May 29, 2024
@behnam-zakeri behnam-zakeri added enh New features or functionality timeslice labels May 29, 2024
@khaeru

khaeru commented May 31, 2024

Copy link
Copy Markdown
Member

@behnam-zakeri —many thanks for this contribution!

As a first reaction, can you explain your thinking for contributing this code to message-ix-models rather than message_ix?

At a glance, the code seems to be sufficiently generic that it could apply to any MESSAGEix models, not only the ones in the MESSAGEix-GLOBIOM family. I say this because, for instance, the example in the if __name__ == "__main__": block applies the code to the Westeros model.

@behnam-zakeri

Copy link
Copy Markdown
Contributor Author

@khaeru thanks for the point. Yes, indeed, this workflow can be applied to any MESSAGEix model. I agree this can be brought to message_ix as a tool.

@glatterf42

Copy link
Copy Markdown
Member

Superseded by iiasa/message_ix#852, closing for now.

@glatterf42 glatterf42 closed this Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enh New features or functionality timeslice

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants