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

Minigrid Setup #326

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
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
18 changes: 12 additions & 6 deletions hive/envs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
from hive.envs.base import BaseEnv, ParallelEnv
from hive.envs.env_spec import EnvSpec
from hive.envs.gym_env import GymEnv

try:
from hive.envs.minigrid import MiniGridEnv
except ImportError:
MiniGridEnv = None
from minigrid import (
FlatObsWrapper,
FullyObsWrapper,
ImgObsWrapper,
RGBImgObsWrapper,
RGBImgPartialObsWrapper,
)
Comment on lines +4 to +10
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update with changes from dev branch and move these changes to gym/gym_wrappers.py, inside of a try block?
Like:

try:
   importing and registering minigrid wrappers
except:
   ...


try:
from hive.envs.atari import AtariEnv
Expand All @@ -28,7 +30,11 @@
BaseEnv,
{
"GymEnv": GymEnv,
"MiniGridEnv": MiniGridEnv,
"minigrid.FullyObsWrapper": FullyObsWrapper,
"minigrid.FlatObsWrapper": FlatObsWrapper,
"minigrid.ImgObsWrapper": ImgObsWrapper,
"minigrid.RGBImgObsWrapper": RGBImgObsWrapper,
"minigrid.RGBImgPartialObsWrapper": RGBImgPartialObsWrapper,
Comment on lines +33 to +37
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be registered as gymwrappers and not environments

"MarlGridEnv": MarlGridEnv,
"AtariEnv": AtariEnv,
"PettingZooEnv": PettingZooEnv,
Expand Down
1 change: 0 additions & 1 deletion hive/envs/minigrid/__init__.py

This file was deleted.

59 changes: 0 additions & 59 deletions hive/envs/minigrid/minigrid.py

This file was deleted.

1 change: 0 additions & 1 deletion hive/envs/minigrid/requirements.txt

This file was deleted.

6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
long_description = fh.read()

atari = ["gymnasium[atari,accept-rom-license]~=0.27.0", "opencv-python~=4.0"]
gym_minigrid = ["gym-minigrid~=1.2.2"]
minigrid = ["minigrid~=2.1.0"]
minatar = ["MinAtar>=1.0.10"]
petting_zoo = ["pettingzoo[sisl,atari,classic]~=1.22"]
visualization = ["pandas~=1.0"]
Expand Down Expand Up @@ -47,11 +47,11 @@
],
extras_require={
"atari": atari,
"gym_minigrid": gym_minigrid,
"minigrid": minigrid,
"minatar": minatar,
"petting_zoo": petting_zoo,
"test": test,
"all": atari + gym_minigrid + minatar + petting_zoo + test,
"all": atari + minigrid + minatar + petting_zoo + test,
},
entry_points={
"console_scripts": [
Expand Down