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

mujoco_py_env: Only raise an exception if MuJocoPyEnv class is actually used #1060

Merged
merged 1 commit into from
May 22, 2024

Conversation

traversaro
Copy link
Contributor

@traversaro traversaro commented May 21, 2024

Description

Before #934 just running from gymnasium.envs.mujoco import MuJocoPyEnv did not resulted in a error.DependencyNotInstalled exception, but the expection was only raised when MuJocoPyEnv.__init__ constructor was called.

Instead after #934 just calling from gymnasium.envs.mujoco.mujoco_py_env import MuJocoPyEnv results in a error.DependencyNotInstalled exception, that I guess create an hard error during test collection.

This result in an hard error when collecting tests in conda-forge/gymnasium-feedstock#36, where mujoco_py is not available. Note that there is a similar change in #934 related to mujoco module itself, but that is less problematic as it a maintained library, differently from mujoco_py.

Type of change

Please delete options that are not relevant.

  • Documentation only change (no code changed)
  • 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 not work as expected)
  • This change requires a documentation update

Screenshots

Not relevant.

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@traversaro
Copy link
Contributor Author

Sorry, I did the modifications online and I did not run pre-commit, I will fix it.

@traversaro
Copy link
Contributor Author

Sorry, I did the modifications online and I did not run pre-commit, I will fix it.

Fixed.

@pseudo-rnd-thoughts pseudo-rnd-thoughts merged commit 596bdcc into Farama-Foundation:main May 22, 2024
9 checks passed
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.

None yet

3 participants