Skip to content

Upgrade to Gymnasium interface #6203

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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

alexander-zap
Copy link

Proposed change(s)

I adjusted the Unity Gym Wrapper to support the gymnasium interface (gymnasium>=0.25).

This includes:

  • returning terminated, truncated on step
  • returning info on reset
  • accept seed and options on reset
  • not accept mode on render

Also I relaxed the dependencies for pettingzoo, numpy and Python for mlagents_env.
They didn't seem required and, at least personally for me, are blocking the usage of mlagents_env independently (e.g., if wishing to connect to other training frameworks).

Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)

This also could be helpful for: #5890

Types of change(s)

  • Bug fix
  • [ X ] New feature
  • Code refactor
  • [ X ] Breaking change
  • [ X ] Documentation update
  • Other (please describe)

Checklist

  • Added tests that prove my fix is effective or that my feature works
  • Updated the changelog (if applicable)
  • Updated the documentation (if applicable)
  • Updated the migration guide (if applicable)

Other comments

a_zap added 3 commits May 28, 2025 17:29
- added dependency to gymnasium instead of gym
- adjusted Unity gym interface to return `truncated` on step
- adjusted Unity gym interface to accept `seed` and `options` on reset (not used)
- adjusted Unity gym interface to not accept `mode` on reset (not used anyway)
- relaxed dependencies to numpy, pettingzoo and Python version
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


a_zap seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@alexander-zap
Copy link
Author

#5890

@alexander-zap
Copy link
Author

@elliottower Since this feature should partially solve your issue, is there anything I missed?

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.

2 participants