EPyT-Control
A Python package for implementing and evaluating control algorithms & strategies in smart water networks.
https://github.com/waterfutures/epyt-control
Category: Natural Resources
Sub Category: Water Supply and Quality
Keywords
control epanet epanet-python-toolkit hydraulics python reinforcement-learning simulation water water-distribution-networks water-quality
Last synced: about 4 hours ago
JSON representation
Repository metadata
A Python package for implementing and evaluating control algorithms & strategies in smart water networks.
- Host: GitHub
- URL: https://github.com/waterfutures/epyt-control
- Owner: WaterFutures
- License: mit
- Created: 2024-11-26T09:27:05.000Z (over 1 year ago)
- Default Branch: dev
- Last Pushed: 2026-03-17T06:55:01.000Z (7 days ago)
- Last Synced: 2026-03-17T21:59:47.166Z (6 days ago)
- Topics: control, epanet, epanet-python-toolkit, hydraulics, python, reinforcement-learning, simulation, water, water-distribution-networks, water-quality
- Language: Python
- Homepage: https://epyt-control.readthedocs.io/en/stable
- Size: 547 KB
- Stars: 13
- Watchers: 4
- Forks: 6
- Open Issues: 0
- Releases: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.cff
README.md
EPyT-Control -- EPANET Python Toolkit - Control
EPyT-Control is a Python package building on top of EPyT-Flow
for implementing and evaluating control algorithms & strategies in water distribution networks (WDNs).
Besides related control tasks such as state estimation and event diagnosis, a special focus of this
Python package is Reinforcement Learning for data-driven control in WDNs and therefore it provides
full compatibility with the
Stable-Baselines3 package.
Unique Features
Unique features of EPyT-Control are the following:
- Support of hydraulic and (advanced) water quality simulation (i.e. EPANET and EPANET-MSX are supported)
- Compatibility with Gymnasium and integration of Stable-Baselines3
- Wide variety of pre-defined actions (e.g. pump state actions, pump speed actons, valve state actions, species injection actions, etc.)
- Implementation of classic control aglorithms such as PID and LQR controllers
- Signal processing methods such as state estimation (e.g. Kalman filters) and event diagnosis
- Neural surrogate models for state transition
- High- and low-level interface
- Object-orientated design that is easy to extend and customize
Installation
EPyT-Control supports Python 3.10 - 3.14
PyPI
pip install epyt-control
Git
Download or clone the repository:
git clone https://github.com/WaterFutures/EPyT-Control.git
cd EPyT-Control
Install all requirements as listed in REQUIREMENTS.txt:
pip install -r REQUIREMENTS.txt
Install the toolbox:
pip install .
Quick Example
Interface of Environments
Basic example demonstrating the environments' interface:
# Define/Specify MyEnv
# ....
# Load hypothetical environment "MyEnv"
with MyEnv() as env:
# Show the observation space
print(f"Observation space: {env.observation_space}")
# Run 1000 iterations -- assuming that autorest=True
obs, info = env.reset()
for _ in range(1000):
# Sample and apply a random action from the action space.
# TODO: Replace with some smart RL/control method
action = env.action_space.sample()
obs, reward, terminated, _, _ = env.step(action)
# Show action and observed reward
print(action, reward)
Applying Reinforcement Learning to a given Environment
Simple example of using Stable-Baselines3 for learning a policy to control the chlorine injection in a given environment called SimpleChlorineInjectionEnv:
from stable_baselines3 import PPO
from gymnasium.wrappers import NormalizeObservation
# Define/Specify SimpleChlorineInjectionEnv
# ....
# Load chlorine injection environment
with SimpleChlorineInjectionEnv() as env:
# Wrap environment
env = NormalizeObservation(env)
# Apply a simple policy learner
# You might want to add more wrappers (e.g. normalizing inputs, rewards, etc.) and logging here
# Also, inceasing the number of time steps might help as well
model = PPO("MlpPolicy", env, verbose=1)
model.learn(total_timesteps=1000)
model.save("my_model_clinject.zip") # Save policy
Documentation
Documentation is available on readthedocs: https://epyt-control.readthedocs.io/en/stable/
License
MIT license -- see LICENSE
How to Cite?
If you use this software, please cite it as follows:
@misc{github:epytcontrol,
author = {André Artelt},
title = {{EPyT-Control -- EPANET Python Toolkit - Control}},
year = {2025},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {https://github.com/WaterFutures/EPyT-Control}
}
How to get Support?
If you come across any bug or need assistance please feel free to open a new
issue
if non of the existing issues answers your questions.
How to Contribute?
Contributions (e.g. creating issues, pull-requests, etc.) are welcome --
please make sure to read the code of conduct and
follow the developers' guidelines.
Citation (CITATION.cff)
cff-version: 1.2.0
authors:
- family-names: Artelt
given-names: André
orcid: "https://orcid.org/0000-0002-2426-3126"
contact:
- family-names: Artelt
given-names: André
orcid: "https://orcid.org/0000-0002-2426-3126"
message: "If you use this software, please cite it using these metadata."
title: "EPyT-Control -- EPANET Python Toolkit - Control"
keywords:
- python
- simulation
- water
- epanet
- epanet-python-toolkit
- control
- reinforcement learning
license: MIT
repository-code: "https://github.com/WaterFutures/EPyT-Control"
Owner metadata
- Name: ERC Synergy Grant Water Futures
- Login: WaterFutures
- Email:
- Kind: organization
- Description: Repository for the ERC SyG Water Futures Team
- Website: www.waterfutures.eu
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/149570313?v=4
- Repositories: 1
- Last ynced at: 2024-01-31T13:34:11.822Z
- Profile URL: https://github.com/WaterFutures
GitHub Events
Total
- Release event: 6
- Delete event: 1
- Member event: 1
- Fork event: 4
- Watch event: 7
- Push event: 61
- Public event: 1
- Create event: 5
Last Year
- Release event: 3
- Delete event: 1
- Member event: 1
- Fork event: 1
- Watch event: 6
- Push event: 36
- Create event: 2
Committers metadata
Last synced: 3 days ago
Total Commits: 108
Total Committers: 3
Avg Commits per committer: 36.0
Development Distribution Score (DDS): 0.028
Commits in past year: 44
Committers in past year: 3
Avg Commits per committer in past year: 14.667
Development Distribution Score (DDS) in past year: 0.068
| Name | Commits | |
|---|---|---|
| André Artelt | a****t@t****e | 105 |
| Paul Stahlhofen | p****n@t****e | 2 |
| Alissa | a****r@u****e | 1 |
Committer domains:
Package metadata
- Total packages: 1
-
Total downloads:
- pypi: 56 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 7
- Total maintainers: 1
pypi.org: epyt-control
EPyT-Control -- EPANET Python Toolkit - Control
- Homepage: https://github.com/WaterFutures/EPyT-Control
- Documentation: https://epyt-control.readthedocs.io/en/stable/
- Licenses: MIT
- Latest release: 0.6.0 (published about 2 months ago)
- Last Synced: 2026-03-01T02:33:09.690Z (23 days ago)
- Versions: 7
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 56 Last month
-
Rankings:
- Dependent packages count: 9.689%
- Average: 32.121%
- Dependent repos count: 54.553%
- Maintainers (1)
Dependencies
- ipykernel >=6.29.3
- nbsphinx >=0.9.3
- sphinx >=7.2.6
- sphinx-rtd-theme >=2.0.0
Score: 7.706612913964197