Files
Gymnasium/gym/__init__.py
Mark Towers 1c62d3c6ad Add Pydocstyle to CI (#2785)
* Added pydocstyle to pre-commit

* Added docstrings for tests and updated the tests for autoreset

* Add pydocstyle exclude folder to allow slowly adding new docstrings

* Add docstrings for setup.py and gym/__init__.py, core.py, error.py and logger.py

* Check that all unwrapped environment are of a particular wrapper type

* Reverted back to import gym.spaces.Space to gym.spaces

* Fixed the __init__.py docstring

* Fixed autoreset autoreset test

* Updated gym __init__.py top docstring

* Remove unnecessary import

* Removed "unused error" and make APIerror deprecated at gym 1.0

* Add pydocstyle description to CONTRIBUTING.md

* Added docstrings section to CONTRIBUTING.md

* Added :meth: and :attr: keywords to docstrings

* Added :meth: and :attr: keywords to docstrings

* Update the step docstring placing the return type in the as a note.

* Updated step return type to include each element

* Update maths notation to reward range

* Fixed infinity maths notation
2022-05-10 10:35:45 -04:00

44 lines
1.1 KiB
Python

"""Root __init__ of the gym module setting the __all__ of gym modules."""
# isort: skip_file
from gym import error
from gym.version import VERSION as __version__
from gym.core import (
Env,
Wrapper,
ObservationWrapper,
ActionWrapper,
RewardWrapper,
)
from gym.spaces import Space
from gym.envs import make, spec, register
from gym import logger
from gym import vector
from gym import wrappers
import os
import sys
__all__ = ["Env", "Space", "Wrapper", "make", "spec", "register"]
# Initializing pygame initializes audio connections through SDL. SDL uses alsa by default on all Linux systems
# SDL connecting to alsa frequently create these giant lists of warnings every time you import an environment using
# pygame
# DSP is far more benign (and should probably be the default in SDL anyways)
if sys.platform.startswith("linux"):
os.environ["SDL_AUDIODRIVER"] = "dsp"
os.environ["PYGAME_HIDE_SUPPORT_PROMPT"] = "hide"
try:
import gym_notices.notices as notices
# print version warning if necessary
notice = notices.notices.get(__version__)
if notice:
print(notice, file=sys.stderr)
except Exception: # nosec
pass