gym-anm
A framework to design Reinforcement Learning environments that model Active Network Management (ANM) tasks in electricity distribution networks.
Science Score: 39.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 8 DOI reference(s) in README -
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.7%) to scientific vocabulary
Keywords
Repository
A framework to design Reinforcement Learning environments that model Active Network Management (ANM) tasks in electricity distribution networks.
Basic Info
- Host: GitHub
- Owner: robinhenry
- License: mit
- Language: Python
- Default Branch: main
- Homepage: https://gym-anm.readthedocs.io/en/latest/
- Size: 7 MB
Statistics
- Stars: 160
- Watchers: 5
- Forks: 35
- Open Issues: 0
- Releases: 9
Topics
Metadata Files
README.md
Gym-ANM
gym-anm is a framework for designing reinforcement learning (RL) environments that model Active Network
Management (ANM) tasks in electricity distribution networks. It is built on top of the
Gymnasium toolkit.
The gym-anm framework was designed with one goal in mind: bridge the gap between research in RL and in
the management of power systems. We attempt to do this by providing RL researchers with an easy-to-work-with
library of environments that model decision-making tasks in power grids.
Papers: * Gym-ANM: Reinforcement Learning Environments for Active Network Management Tasks in Electricity Distribution Systems * Gym-ANM: Open-source software to leverage reinforcement learning for power system management in research and education
Key features
- Very little background in electricity systems modelling it required. This makes
gym-anman ideal starting point for RL students and researchers looking to enter the field. - The environments (tasks) generated by
gym-anmfollow the Gymnasium framework, with which a large part of the RL community is already familiar. - The flexibility of
gym-anm, with its different customizable components, makes it a suitable framework to model a wide range of ANM tasks, from simple ones that can be used for educational purposes, to complex ones designed to conduct advanced research.
Documentation
Documentation is provided online at https://gym-anm.readthedocs.io/en/latest/.
Installation
Requirements
gym-anm requires Python 3.10+ and can run on Linux, MaxOS, and Windows. Some rendering features may not work properly
on Windows (not tested).
If you need Python 3.8 or 3.9, you can use gym-anm < 2.0.
We recommend installing gym-anm in a Python environment (e.g., virtualenv
or conda).
Using pip
Using pip (preferably after activating your virtual environment):
pip install gym-anm
Building from source
Alternatively, you can build gym-anm directly from source:
git clone https://github.com/robinhenry/gym-anm.git
cd gym-anm
pip install -e .
Example
The following code snippet illustrates how gym-anm environments can be used. In this example,
actions are randomly sampled from the action space of the environment ANM6Easy-v0. For more information
about the agent-environment interface, see the official Gymnasium documentation.
```
import gymnasium as gym
import time
def run(): env = gym.make('gym_anm:ANM6Easy-v0') o = env.reset()
for i in range(100): a = env.action_space.sample() o, r, done, info = env.step(a) env.render() time.sleep(0.5) # otherwise the rendering is too fast for the human eye.
env.close()
if name == 'main':
run()
```
The above code would render the environment in your default web browser as shown in the image below:

Additional example scripts can be found in examples/.
Testing the installation
All unit tests in gym-anm can be ran from the project root directory with:
python -m pytest tests
Contributing
Contributions are always welcome! Please read the contribution guidelines first.
Citing the project
All publications derived from the use of gym-anm should cite the following two 2021 papers:
@article{HENRY2021100092,
title = {Gym-ANM: Reinforcement learning environments for active network management tasks in electricity distribution systems},
journal = {Energy and AI},
volume = {5},
pages = {100092},
year = {2021},
issn = {2666-5468},
doi = {https://doi.org/10.1016/j.egyai.2021.100092},
author = {Robin Henry and Damien Ernst},
}
@article{HENRY2021100092,
title = {Gym-ANM: Open-source software to leverage reinforcement learning for power system management in research and education},
journal = {Software Impacts},
volume = {9},
pages = {100092},
year = {2021},
issn = {2665-9638},
doi = {https://doi.org/10.1016/j.simpa.2021.100092},
author = {Robin Henry and Damien Ernst}
}
Maintainers
gym-anm is currently maintained by Robin Henry.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Owner
- Name: Robin Henry
- Login: robinhenry
- Kind: user
- Location: Oxford, UK
- Company: Habitat Energy
- Repositories: 13
- Profile: https://github.com/robinhenry
Research engineer interested in disruptive technology. Currently Data Scientist @ Habitat Energy.
GitHub Events
Total
- Release event: 1
- Watch event: 25
- Delete event: 1
- Push event: 21
- Pull request event: 5
- Fork event: 3
- Create event: 4
Last Year
- Release event: 1
- Watch event: 25
- Delete event: 1
- Push event: 21
- Pull request event: 5
- Fork event: 3
- Create event: 4
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Robin Henry | r****2@g****m | 230 |
| robin henry | r****y@v****e | 4 |
| Satya Prakash Dash | s****h@g****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 10
- Total pull requests: 11
- Average time to close issues: 3 months
- Average time to close pull requests: 2 days
- Total issue authors: 7
- Total pull request authors: 2
- Average comments per issue: 1.5
- Average comments per pull request: 0.0
- Merged pull requests: 10
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 2
- Average time to close issues: N/A
- Average time to close pull requests: 6 days
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- Kim-369 (2)
- sifatron (2)
- sprakashdash (1)
- robinhenry (1)
- pablo-ta (1)
- diegofz (1)
- lordmuck2020 (1)
Pull Request Authors
- robinhenry (12)
- halduaij (1)
- sprakashdash (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 81 last-month
- Total dependent packages: 1
- Total dependent repositories: 3
- Total versions: 11
- Total maintainers: 1
pypi.org: gym-anm
A framework to build Reinforcement Learning environments for Active Network Management tasks in electricity networks.
- Homepage: https://github.com/robinhenry/gym-anm
- Documentation: https://gym-anm.readthedocs.io/en/latest/
- License: MIT
-
Latest release: 2.0.1
published over 1 year ago
Rankings
Maintainers (1)
Dependencies
- abatilo/actions-poetry v2 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- codecov/codecov-action v3 composite
- abatilo/actions-poetry v2.0.0 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- attrs 22.1.0 develop
- black 22.10.0 develop
- click 8.1.3 develop
- colorama 0.4.6 develop
- coverage 6.5.0 develop
- exceptiongroup 1.0.4 develop
- iniconfig 1.1.1 develop
- mypy 0.981 develop
- mypy-extensions 0.4.3 develop
- packaging 21.3 develop
- pathspec 0.10.2 develop
- platformdirs 2.5.4 develop
- pluggy 1.0.0 develop
- pyparsing 3.0.9 develop
- pytest 7.2.0 develop
- pytest-cov 3.0.0 develop
- tomli 2.0.1 develop
- typing-extensions 4.4.0 develop
- certifi 2022.9.24
- charset-normalizer 2.1.1
- cloudpickle 2.2.0
- cvxpy 1.2.2
- ecos 2.0.10
- gym 0.26.2
- gym-notices 0.0.8
- idna 3.4
- importlib-metadata 5.1.0
- numpy 1.23.5
- osqp 0.6.2.post8
- pandas 1.5.2
- python-dateutil 2.8.2
- pytz 2022.6
- qdldl 0.1.5.post2
- requests 2.28.1
- scipy 1.9.3
- scs 3.2.2
- six 1.16.0
- urllib3 1.26.13
- websocket-client 0.56.0
- websocket-server 0.4
- zipp 3.11.0
- cvxpy ^1.2.2
- gym ^0.26.2
- numpy ^1.23.5
- pandas ^1.5.2
- python ^3.8
- requests ^2.28.1
- websocket-client 0.56.0
- websocket-server 0.4
- actions/stale v5 composite
- gym ==0.26.2