Temperature regulation optimization for hydropower operations
Project description
TempRegPy
Temperature-constrained hydropower dispatch optimization using Mixed-Integer Linear Programming (MILP).
Overview
TempRegPy optimizes hydropower release schedules to maximize energy revenue while maintaining downstream water temperatures within ecological limits. It uses selective withdrawal from thermally stratified reservoirs, market-based dispatch, and configurable operational constraints within a MILP framework solved via HiGHS (OR-Tools MathOpt).
Installation
uv pip install:
uv pip install tempregpy
Or with pip:
pip install tempregpy
For development:
git clone https://github.com/energy-modelling-hub/TempRegPy.git
cd TempRegPy
uv pip install -e ".[dev]"
Quick Start
Generate a synthetic configuration file:
python examples/generate_config.py
Run the optimizer:
python -m tempregpy run -c examples/config.xlsx
See examples/README.md for details on the synthetic test case.
Features
- MILP-based temperature-constrained hydropower dispatch
- Selective withdrawal from thermally stratified reservoirs
- Multiple bilinear term linearization methods (McCormick, triangles, polygons, sum-of-convex)
- Configurable ramping, cycling, and operating range constraints
- Market-based dispatch with locational marginal prices
- HiGHS solver via OR-Tools MathOpt (open-source)
- Excel-based configuration input
- CLI interface
Citation
If you use TempRegPy in your research, please cite:
@article{pavicevic2025tempregpy,
title={TempRegPy: An Open-Source MILP Framework for Temperature-Constrained Hydropower Dispatch with Application to Glen Canyon Dam},
author={Pavicevic, Matija and Usis, Maris Andris and Yu, Ao and Henriquez, Walter Antonio and Wilhite, Jerry and Ploussard, Quentin},
journal={Environmental Modelling \& Software},
year={2025},
doi={DOI_PLACEHOLDER}
}
License
MIT License. See LICENSE for details.
Developers guide (compile .exe file)
python -m venv ./env
./env/scripts/activate
pip install -r requirements2.txt
pyinstaller runwapasim.spec
RunWAPASim.exe can be found in the /dist folder
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tempregpy-0.3.0.post0.tar.gz.
File metadata
- Download URL: tempregpy-0.3.0.post0.tar.gz
- Upload date:
- Size: 38.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
277783506feb2d062916883d38b940ef74451bf22220734100794070c2fcbdca
|
|
| MD5 |
c8b3a6b0ea64891ce5338999b621b2a1
|
|
| BLAKE2b-256 |
5ca9ec67b17d8c97c52520409d3422cfc42ca99cf555018c896cd14c42dee9f1
|
Provenance
The following attestation bundles were made for tempregpy-0.3.0.post0.tar.gz:
Publisher:
ci.yml on energy-modelling-hub/TempRegPy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tempregpy-0.3.0.post0.tar.gz -
Subject digest:
277783506feb2d062916883d38b940ef74451bf22220734100794070c2fcbdca - Sigstore transparency entry: 976551703
- Sigstore integration time:
-
Permalink:
energy-modelling-hub/TempRegPy@2e57cf78e85b1b57fd065add6079ace912111df4 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/energy-modelling-hub
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@2e57cf78e85b1b57fd065add6079ace912111df4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tempregpy-0.3.0.post0-py3-none-any.whl.
File metadata
- Download URL: tempregpy-0.3.0.post0-py3-none-any.whl
- Upload date:
- Size: 27.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0083712fd9c1596b7f93bf7915e773b2acebc49900f986b27074e164bc211d43
|
|
| MD5 |
11cf970b32ed5eb3460bd920144a2f52
|
|
| BLAKE2b-256 |
2f466c6f4ad77edf000f26cf5beb1fa704d990fa7dcb0a69bf31fd8566386c2f
|
Provenance
The following attestation bundles were made for tempregpy-0.3.0.post0-py3-none-any.whl:
Publisher:
ci.yml on energy-modelling-hub/TempRegPy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tempregpy-0.3.0.post0-py3-none-any.whl -
Subject digest:
0083712fd9c1596b7f93bf7915e773b2acebc49900f986b27074e164bc211d43 - Sigstore transparency entry: 976551710
- Sigstore integration time:
-
Permalink:
energy-modelling-hub/TempRegPy@2e57cf78e85b1b57fd065add6079ace912111df4 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/energy-modelling-hub
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@2e57cf78e85b1b57fd065add6079ace912111df4 -
Trigger Event:
push
-
Statement type: