Cleanup, removal of unmaintained code (#836)
* add dtype to Box
* remove board_game, debugging, safety, parameter_tuning environments
* massive set of breaking changes
- remove python logging module
- _step, _reset, _seed, _close => non underscored method
- remove benchmark and scoring folder
* Improve render("human"), now resizable, closable window.
* get rid of default step and reset in wrappers, so it doesn’t silently fail for people with underscore methods
* CubeCrash unit test environment
* followup fixes
* MemorizeDigits unit test envrionment
* refactored spaces a bit
fixed indentation
disabled test_env_semantics
* fix unit tests
* fixes
* CubeCrash, MemorizeDigits tested
* gym backwards compatibility patch
* gym backwards compatibility, followup fixes
* changelist, add spaces to main namespaces
* undo_logger_setup for backwards compat
* remove configuration.py
2018-01-25 18:20:14 -08:00
|
|
|
from gym import envs, logger
|
2017-02-11 22:17:02 -08:00
|
|
|
import os
|
|
|
|
|
2019-08-09 15:16:44 -07:00
|
|
|
|
2021-07-29 15:39:42 -04:00
|
|
|
SKIP_MUJOCO_WARNING_MESSAGE = (
|
|
|
|
"Cannot run mujoco test (either license key not found or mujoco not"
|
|
|
|
"installed properly)."
|
|
|
|
)
|
2019-08-09 15:16:44 -07:00
|
|
|
|
|
|
|
|
2021-07-29 02:26:34 +02:00
|
|
|
skip_mujoco = not (os.environ.get("MUJOCO_KEY"))
|
2019-02-25 15:12:06 -08:00
|
|
|
if not skip_mujoco:
|
|
|
|
try:
|
|
|
|
import mujoco_py
|
|
|
|
except ImportError:
|
|
|
|
skip_mujoco = True
|
|
|
|
|
2021-07-29 02:26:34 +02:00
|
|
|
|
2017-02-11 22:17:02 -08:00
|
|
|
def should_skip_env_spec_for_tests(spec):
|
|
|
|
# We skip tests for envs that require dependencies or are otherwise
|
|
|
|
# troublesome to run frequently
|
2019-07-12 13:59:33 -04:00
|
|
|
ep = spec.entry_point
|
2017-02-11 22:17:02 -08:00
|
|
|
# Skip mujoco tests for pull request CI
|
2021-07-29 15:39:42 -04:00
|
|
|
if skip_mujoco and (
|
|
|
|
ep.startswith("gym.envs.mujoco") or ep.startswith("gym.envs.robotics:")
|
|
|
|
):
|
2017-02-11 22:17:02 -08:00
|
|
|
return True
|
2019-02-08 11:46:51 -08:00
|
|
|
try:
|
2021-09-22 17:11:21 -06:00
|
|
|
import gym.envs.atari
|
2019-02-08 11:46:51 -08:00
|
|
|
except ImportError:
|
2021-09-22 17:11:21 -06:00
|
|
|
if ep.startswith("gym.envs.atari"):
|
2019-02-08 11:46:51 -08:00
|
|
|
return True
|
|
|
|
try:
|
|
|
|
import Box2D
|
|
|
|
except ImportError:
|
2021-07-29 02:26:34 +02:00
|
|
|
if ep.startswith("gym.envs.box2d"):
|
2019-02-08 11:46:51 -08:00
|
|
|
return True
|
|
|
|
|
2021-07-29 02:26:34 +02:00
|
|
|
if (
|
|
|
|
"GoEnv" in ep
|
|
|
|
or "HexEnv" in ep
|
2021-07-29 15:39:42 -04:00
|
|
|
or (
|
2021-09-22 17:11:21 -06:00
|
|
|
ep.startswith("gym.envs.atari")
|
2021-07-29 15:39:42 -04:00
|
|
|
and not spec.id.startswith("Pong")
|
|
|
|
and not spec.id.startswith("Seaquest")
|
|
|
|
)
|
2017-02-11 22:17:02 -08:00
|
|
|
):
|
Cleanup, removal of unmaintained code (#836)
* add dtype to Box
* remove board_game, debugging, safety, parameter_tuning environments
* massive set of breaking changes
- remove python logging module
- _step, _reset, _seed, _close => non underscored method
- remove benchmark and scoring folder
* Improve render("human"), now resizable, closable window.
* get rid of default step and reset in wrappers, so it doesn’t silently fail for people with underscore methods
* CubeCrash unit test environment
* followup fixes
* MemorizeDigits unit test envrionment
* refactored spaces a bit
fixed indentation
disabled test_env_semantics
* fix unit tests
* fixes
* CubeCrash, MemorizeDigits tested
* gym backwards compatibility patch
* gym backwards compatibility, followup fixes
* changelist, add spaces to main namespaces
* undo_logger_setup for backwards compat
* remove configuration.py
2018-01-25 18:20:14 -08:00
|
|
|
logger.warn("Skipping tests for env {}".format(ep))
|
2017-02-11 22:17:02 -08:00
|
|
|
return True
|
|
|
|
return False
|
|
|
|
|
2021-07-29 02:26:34 +02:00
|
|
|
|
|
|
|
spec_list = [
|
|
|
|
spec
|
|
|
|
for spec in sorted(envs.registry.all(), key=lambda x: x.id)
|
|
|
|
if spec.entry_point is not None and not should_skip_env_spec_for_tests(spec)
|
|
|
|
]
|