Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(v2.2.1) - Gymnasium compability #280

Merged
merged 23 commits into from
Feb 9, 2023
Merged

(v2.2.1) - Gymnasium compability #280

merged 23 commits into from
Feb 9, 2023

Conversation

AlejandroCN7
Copy link
Member

@AlejandroCN7 AlejandroCN7 commented Feb 8, 2023

Description

Migration from old version of gym to the newest version of gymnasium

Motivation and Context

All development of Gym has been moved to Gymnasium, a new package in the Farama Foundation that's maintained by the same team of developers who have maintained Gym for the past 18 months. We are not using the latest release of Gym (v0.26.2), then we can't switch to v0.27.0 of Gymnasium by simply replacing import gym with import gymnasium as gym with no additional steps, due to the format changes included. Gym will not be receiving any future updates or bug fixes, and no further changes will be made to the core API in Gymnasium.

Then, this PR aims to implement Sinergym compability directly with Gymnasium and to delete old Gym dependency.

  • I have raised an issue to propose this change (required for new features and bug fixes)

Why is this change required? What problem does it solve? Please, reference issue or issues opened previously.

Fixes #242

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (update in the documentation)
  • Improvement (of an existing feature)
  • Others

Checklist:

  • I've read the CONTRIBUTION guide (required)
  • My change requires a change to the documentation.
  • I have updated the tests.
  • I have updated the documentation accordingly.
  • I have reformatted the code using autopep8 second level aggressive.
  • I have reformatted the code using isort.
  • I have ensured cd docs && make spelling && make html pass (required if documentation has been updated.)
  • I have ensured pytest tests/ -vv pass. (required).
  • I have ensured pytype -d import-error sinergym/ pass. (required)

Changelog:

  • Changed gym requirement for latest version of gymnasium.
  • Updated imports to gymnasium as a gym.
  • Added seed and option parameters to reset method.
  • Updated reset method return with simulator info (obs and info).
  • Updated step return: done value is called terminated and added truncated flag too.
  • step method info is now constructed in simulator layed and updated in environment layer (instead of all construction in environment).
  • Weather variability included in reset option parameter: The Sinergym environment will have a default option if no option is specified.
  • Wrappers, controllers and env_checker to the new format.
  • Temporally disabled stable-baselines 3 from extra-requires and warning added in README.md.
  • Adapted all tests to gymnasium.
  • Updated notebooks.
  • Fixed render mode and spaces type in bounds in order to avoid warnings messages from gymnasium.
  • Updated scripts with gymnasium.

@AlejandroCN7 AlejandroCN7 merged commit 956089c into main Feb 9, 2023
@AlejandroCN7 AlejandroCN7 deleted the feat/issue-242 branch February 20, 2023 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[IMPROVEMENT]: Review the new version of OpenAI gym and evaluate integration with Sinergym.
1 participant