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

[Feature] Make robohive_env_suite an iterator #110

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 46 additions & 43 deletions robohive/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,55 +10,58 @@
# RoboHive version
__version__ = "0.6.0"

def _robohive_env_suite():
# Register RoboHive Envs
_current_gym_envs = gym.envs.registration.registry.env_specs.keys()
_current_gym_envs = set(_current_gym_envs)
robohive_env_suite = set()

# Register RoboHive Envs
_current_gym_envs = gym.envs.registration.registry.env_specs.keys()
_current_gym_envs = set(_current_gym_envs)
robohive_env_suite = set()
# Register Arms Suite
import robohive.envs.arms # noqa
robohive_arm_suite = set(gym.envs.registration.registry.env_specs.keys())-robohive_env_suite-_current_gym_envs
robohive_arm_suite = set(sorted(robohive_arm_suite))
robohive_env_suite = robohive_env_suite | robohive_arm_suite

# Register Arms Suite
import robohive.envs.arms # noqa
robohive_arm_suite = set(gym.envs.registration.registry.env_specs.keys())-robohive_env_suite-_current_gym_envs
robohive_arm_suite = set(sorted(robohive_arm_suite))
robohive_env_suite = robohive_env_suite | robohive_arm_suite
# Register Myo Suite
import robohive.envs.myo # noqa
import robohive.envs.myo.myochallenge # noqa
robohive_myo_suite = set(gym.envs.registration.registry.env_specs.keys())-robohive_env_suite-_current_gym_envs
robohive_env_suite = robohive_env_suite | robohive_myo_suite
robohive_myo_suite = sorted(robohive_myo_suite)

# Register Myo Suite
import robohive.envs.myo # noqa
import robohive.envs.myo.myochallenge # noqa
robohive_myo_suite = set(gym.envs.registration.registry.env_specs.keys())-robohive_env_suite-_current_gym_envs
robohive_env_suite = robohive_env_suite | robohive_myo_suite
robohive_myo_suite = sorted(robohive_myo_suite)
# Register FM suite
import robohive.envs.fm # noqa
robohive_fm_suite = set(gym.envs.registration.registry.env_specs.keys())-robohive_env_suite-_current_gym_envs
robohive_env_suite = robohive_env_suite | robohive_fm_suite
robohive_fm_suite = sorted(robohive_fm_suite)

# Register FM suite
import robohive.envs.fm # noqa
robohive_fm_suite = set(gym.envs.registration.registry.env_specs.keys())-robohive_env_suite-_current_gym_envs
robohive_env_suite = robohive_env_suite | robohive_fm_suite
robohive_fm_suite = sorted(robohive_fm_suite)
# Register Hands Suite
import robohive.envs.hands # noqa
# import robohive.envs.tcdm # noqa # WIP
robohive_hand_suite = set(gym.envs.registration.registry.env_specs.keys())-robohive_env_suite-_current_gym_envs
robohive_env_suite = robohive_env_suite | robohive_hand_suite
robohive_hand_suite = sorted(robohive_hand_suite)

# Register Hands Suite
import robohive.envs.hands # noqa
# import robohive.envs.tcdm # noqa # WIP
robohive_hand_suite = set(gym.envs.registration.registry.env_specs.keys())-robohive_env_suite-_current_gym_envs
robohive_env_suite = robohive_env_suite | robohive_hand_suite
robohive_hand_suite = sorted(robohive_hand_suite)
# Register Claw suite
import robohive.envs.claws # noqa
robohive_claw_suite = set(gym.envs.registration.registry.env_specs.keys())-robohive_env_suite-_current_gym_envs
robohive_env_suite = robohive_env_suite | robohive_claw_suite
robohive_claw_suite = sorted(robohive_claw_suite)

# Register Claw suite
import robohive.envs.claws # noqa
robohive_claw_suite = set(gym.envs.registration.registry.env_specs.keys())-robohive_env_suite-_current_gym_envs
robohive_env_suite = robohive_env_suite | robohive_claw_suite
robohive_claw_suite = sorted(robohive_claw_suite)
# Register Multi-task Suite
import robohive.envs.multi_task # noqa
robohive_multitask_suite = set(gym.envs.registration.registry.env_specs.keys())-robohive_env_suite-_current_gym_envs
robohive_env_suite = robohive_env_suite | robohive_multitask_suite
robohive_multitask_suite = sorted(robohive_multitask_suite)

# Register Multi-task Suite
import robohive.envs.multi_task # noqa
robohive_multitask_suite = set(gym.envs.registration.registry.env_specs.keys())-robohive_env_suite-_current_gym_envs
robohive_env_suite = robohive_env_suite | robohive_multitask_suite
robohive_multitask_suite = sorted(robohive_multitask_suite)
# Register Locomotion Suite
import robohive.envs.quadrupeds # noqa
robohive_quad_suite = set(gym.envs.registration.registry.env_specs.keys())-robohive_env_suite-_current_gym_envs
robohive_env_suite = robohive_env_suite | robohive_quad_suite
robohive_quad_suite = sorted(robohive_quad_suite)

# Register Locomotion Suite
import robohive.envs.quadrupeds # noqa
robohive_quad_suite = set(gym.envs.registration.registry.env_specs.keys())-robohive_env_suite-_current_gym_envs
robohive_env_suite = robohive_env_suite | robohive_quad_suite
robohive_quad_suite = sorted(robohive_quad_suite)
# All RoboHive Envs
robohive_env_suite = sorted(robohive_env_suite)
yield from robohive_env_suite

# All RoboHive Envs
robohive_env_suite = sorted(robohive_env_suite)
robohive_env_suite = _robohive_env_suite