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

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

Closed
wants to merge 5 commits into from

Conversation

behnam-zakeri
Copy link
Contributor

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

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 self-assigned this May 29, 2024
@behnam-zakeri behnam-zakeri added enh New features or functionality timeslice labels May 29, 2024
@khaeru
Copy link
Member

khaeru commented May 31, 2024

@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
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
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