pypsa-eur icon indicating copy to clipboard operation
pypsa-eur copied to clipboard

feat: refactors temporal aggregation as a separate rule

Open tgilon opened this issue 1 month ago • 1 comments

Closes # (if applicable).

Changes proposed in this Pull Request

This PR introduces a new distinct rule to apply the time aggregation on the time-varying network data. To achieve this:

  • It refactors the temporal aggregation of a sector-coupled model as a separate rule,
  • It renames previous temporal_aggregation as build_snapshot_weightings, and
  • It introduces a new rule temporal_aggregation after prepare_sector_network that effectively applies the aggregation.

The benefit of doing this is that it makes the prepared network more explicit at hourly resolution.

Checklist

  • [x] I tested my contribution locally and it works as intended.
  • [x] Code and workflow changes are sufficiently documented.
  • [x] ~~Changed dependencies are added to pixi.toml (using pixi add <dependency-name>).~~
  • [x] ~~Changes in configuration options are added in config/config.default.yaml.~~
  • [x] ~~Changes in configuration options are documented in doc/configtables/*.csv.~~
  • [x] ~~Sources of newly added data are documented in doc/data_sources.rst.~~
  • [x] A release note doc/release_notes.rst is added.

tgilon avatar Nov 21 '25 12:11 tgilon

This PR would not be compatible with the approach proposed in #1838. @FabianHofmann presented this today and to me it looks like #1838 would be preferable (without having reviewed the code in detail yet) as it elegantly unifies overnight, myopic, and perfect foresight code.

I would give that PR priority. One could always export the hourly model for reference as additional output. I will keep it open for now but close if #1838 gets merged.

fneum avatar Dec 10 '25 19:12 fneum