Fix __all__ in root __init__.py (#130)

This commit is contained in:
Mark Towers
2022-11-15 16:12:42 +00:00
committed by GitHub
parent 37b4c0b0a8
commit a13b9c40fe
2 changed files with 33 additions and 12 deletions

View File

@@ -1,8 +1,6 @@
"""Root __init__ of the gymnasium module setting the __all__ of gymnasium modules."""
"""Root `__init__` of the gymnasium module setting the `__all__` of gymnasium modules."""
# isort: skip_file
from gymnasium import error
from gymnasium.core import (
Env,
Wrapper,
@@ -10,15 +8,35 @@ from gymnasium.core import (
ActionWrapper,
RewardWrapper,
)
from gymnasium.spaces import Space
from gymnasium.envs import make, spec, register
from gymnasium import logger
from gymnasium import vector
from gymnasium import wrappers
from gymnasium.spaces.space import Space
from gymnasium.envs.registration import make, spec, register, registry
from gymnasium import envs, spaces, utils, vector, wrappers, error, logger
import os
import sys
__all__ = ["Env", "Space", "Wrapper", "make", "spec", "register"]
__all__ = [
# core classes
"Env",
"Wrapper",
"ObservationWrapper",
"ActionWrapper",
"RewardWrapper",
"Space",
# registration
"make",
"spec",
"register",
"registry",
# root files
"envs",
"spaces",
"utils",
"vector",
"wrappers",
"error",
"logger",
]
__version__ = "0.26.3"
# Initializing pygame initializes audio connections through SDL. SDL uses alsa by default on all Linux systems
@@ -38,6 +56,5 @@ try:
notice = notices.notices.get(__version__)
if notice:
print(notice, file=sys.stderr)
except Exception: # nosec
pass

View File

@@ -21,17 +21,21 @@ from gymnasium.spaces.tuple import Tuple
from gymnasium.spaces.utils import flatdim, flatten, flatten_space, unflatten
__all__ = [
# base space
"Space",
# fundamental spaces
"Box",
"Discrete",
"Text",
"Graph",
"GraphInstance",
"MultiDiscrete",
"MultiBinary",
# composite spaces
"Graph",
"GraphInstance",
"Tuple",
"Sequence",
"Dict",
# util functions (there are more utility functions in vector/utils/spaces.py)
"flatdim",
"flatten_space",
"flatten",