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

Migrate from OpenAI Gym to Farama Foundation Gymnasium #8

Merged
merged 17 commits into from
May 13, 2024

Conversation

StephenOman
Copy link
Collaborator

Breaking Changes

Migration from OpenAI Gym to the Farama Foundation Gymnasium introduces breaking modifications to some API calls.

For details, see v21 to v26 Migration Guide on the Farama Foundation website.

Main changes:

  • Seeding can only take place on reset()
  • reset() also allows options to be passed into the environment
  • reset() returns additional information
  • step() returns an additional value to indicate if the episode was truncated as the fourth item in the tuple
  • render() no longer accepts the rendering mode as a parameter. Instead, rendering mode should be initialised when the environment is created in gym.make()

This PR also includes documentation changes and some minor bug fixes.

@StephenOman
Copy link
Collaborator Author

When this is released, a small change is needed to test_package.yml:31:

python -c 'import nle; import gymnasium as gym; e = gym.make("NetHack-v0"); e.reset(); e.step(0)'

Copy link
Owner

@heiner heiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I have not tested this but the changes LGTM.

Once this landed and we updated the other test, we should also bump the version (to 0.9.3, or if you're daring to 1.0?) and then do a release to PyPI.

doc/nle/source/getting_started.rst Outdated Show resolved Hide resolved
doc/nle/source/getting_started.rst Show resolved Hide resolved
nle/tests/test_db.py Show resolved Hide resolved
@StephenOman
Copy link
Collaborator Author

Once this landed and we updated the other test, we should also bump the version (to 0.9.3, or if you're daring to 1.0?) and then do a release to PyPI.

I definitely vote for a major version change since there are breaking changes in the API. Given the change to new repo etc., 1.0.0 is perfect.

@heiner
Copy link
Owner

heiner commented May 12, 2024

1.0.0 sgtm.

@StephenOman StephenOman merged commit 867c649 into main May 13, 2024
16 checks passed
@StephenOman StephenOman deleted the gymnasium-migration branch May 13, 2024 20:02
@StephenOman StephenOman added enhancement New feature or request and removed enhancement New feature or request labels Jun 15, 2024
@StephenOman StephenOman added the breaking change Change that breaks backward compatibility label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Change that breaks backward compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants