Skip to content

Commit

Permalink
Switch over from gym to gymnasium (#20)
Browse files Browse the repository at this point in the history
* from gym to gymnasium in code

* update readme

* update seeding, reset, and render modes

* from old to new reset/step API

* update custom env example

* all examples updated

* update documentation

* update poetry lockk

* run black

* fix dcopf tests

* update github action checks

* test with only python 3.11

* test with only python 3.13

* bump up numpy and pandas

* np.Inf to np.inf, reset all python test versions in github actions

* poetry 1.4 to 1.8 in ci_release

* update required python version + status badge

* add seed to reset() in docs example

---------

Co-authored-by: Robin Henry <[email protected]>
  • Loading branch information
robinhenry and Robin Henry authored Nov 14, 2024
1 parent 0e02c33 commit ddf832e
Show file tree
Hide file tree
Showing 27 changed files with 736 additions and 967 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
strategy:
max-parallel: 6
matrix:
python-version: ["3.8", "3.10"]
poetry-version: ["1.4"]
python-version: ["3.10", "3.11", "3.13"]
poetry-version: ["1.8"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
poetry-version: ["1.4"]
python-version: ["3.11"]
poetry-version: ["1.8"]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
[![Downloads](https://pepy.tech/badge/gym-anm)](https://pepy.tech/project/gym-anm)
[![Documentation Status](https://readthedocs.org/projects/ansicolortags/badge/?version=latest)](https://gym-anm.readthedocs.io/en/latest/)
[![codecov](https://codecov.io/gh/robinhenry/gym-anm/branch/master/graph/badge.svg?token=7JSMJPPIQ7)](https://codecov.io/gh/robinhenry/gym-anm)
[![Checks](https://github.com/robinhenry/gym-anm/actions/workflows/ci_checks.yml/badge.svg)](https://github.com/robinhenry/gym-anm/actions/workflows/ci_checks.yml)
[![Checks](https://github.com/robinhenry/gym-anm/actions/workflows/ci_checks.yml/badge.svg?branch=main)](https://github.com/robinhenry/gym-anm/actions/workflows/ci_checks.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

`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
[OpenAI Gym](https://github.com/openai/gym) toolkit.
[Gymnasium](https://github.com/Farama-Foundation/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
Expand All @@ -20,7 +20,7 @@ library of environments that model decision-making tasks in power grids.
## Key features
* Very little background in electricity systems modelling it required. This makes `gym-anm` an ideal starting point
for RL students and researchers looking to enter the field.
* The environments (tasks) generated by `gym-anm` follow the [OpenAI Gym](https://github.com/openai/gym)
* The environments (tasks) generated by `gym-anm` follow the [Gymnasium](https://github.com/Farama-Foundation/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
Expand All @@ -32,9 +32,11 @@ Documentation is provided online at [https://gym-anm.readthedocs.io/en/latest/](
## Installation

### Requirements
`gym-anm` requires Python 3.8+ and can run on Linux, MaxOS, and Windows. Some rendering features may not work properly
`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](https://virtualenv.pypa.io/en/latest/)
or [conda](https://conda.io/en/latest/#)).

Expand All @@ -55,9 +57,9 @@ 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 [OpenAI Gym documentation](https://github.com/openai/gym).
about the agent-environment interface, see the official [Gymnasium documentation](https://github.com/Farama-Foundation/Gymnasium).
```
import gym
import gymnasium as gym
import time
def run():
Expand All @@ -76,7 +78,7 @@ if __name__ == '__main__':
run()
```
The above code would render the environment in your default web browser as shown in the image below:
![alt text](https://github.com/robinhenry/gym-anm/blob/master/docs/source/images/anm6-easy-example.png?raw=true)
![alt text](https://github.com/robinhenry/gym-anm/blob/main/docs/source/images/anm6-easy-example.png?raw=true)

Additional example scripts can be found in [examples/](examples).

Expand Down Expand Up @@ -117,7 +119,7 @@ All publications derived from the use of `gym-anm` should cite the following two
```

## Maintainers
`gym-anm` is currently maintained by [Robin Henry](https://www.robinxhenry.com/).
`gym-anm` is currently maintained by [Robin Henry](https://github.com/robinhenry).

## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Key features
------------
* Very little background in electricity systems modelling is required. This makes :code:`gym-anm` an ideal starting point
for RL students and researchers looking to enter the field.
* The environments (tasks) generated by :code:`gym-anm` follow the `OpenAI Gym <https://github.com/openai/gym>`_
* The environments (tasks) generated by :code:`gym-anm` follow the `Gymnasium <https://gymnasium.farama.org/>`_
framework, with which a large part of the RL community is already familiar.
* The flexibility of :code:`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
Expand Down
4 changes: 1 addition & 3 deletions docs/source/topics/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ About
=====

The design of :code:`gym-anm` started as a summer undergraduate project conducted by
`Robin Henry <https://www.robinxhenry.com/>`_ at the University of Liège (ULiège), Belgium, under the supervision of
`Robin Henry <https://www.linkedin.com/in/rhenry012/>`_ at the University of Liège (ULiège), Belgium, under the supervision of
`Prof. Damien Ernst <http://blogs.ulg.ac.be/damien-ernst/>`_ in 2019.

It remained a side project until its first version was released in March 2021.
37 changes: 0 additions & 37 deletions docs/source/topics/archive/action_space.rst

This file was deleted.

61 changes: 0 additions & 61 deletions docs/source/topics/archive/background.rst

This file was deleted.

65 changes: 0 additions & 65 deletions docs/source/topics/archive/rewards.rst

This file was deleted.

27 changes: 0 additions & 27 deletions docs/source/topics/archive/state_space.rst

This file was deleted.

Loading

0 comments on commit ddf832e

Please sign in to comment.