Skip to content

Commit

Permalink
Fixed issue when generating documentation (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
BolunDai0216 authored Jan 15, 2024
1 parent fa10ae7 commit 1eb3617
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-docs-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: pip install -r docs/requirements.txt

- name: Register Envs
run: pip install -e .
run: pip install -e .[wfc]

- name: Build Envs Docs
run: python docs/_scripts/gen_env_docs.py
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-docs-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: pip install -r docs/requirements.txt

- name: Register Envs
run: pip install -e .
run: pip install -e .[wfc]

- name: Build Envs Docs
run: python docs/_scripts/gen_env_docs.py
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-build-docs-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: pip install -r docs/requirements.txt

- name: Register Envs
run: pip install -e .
run: pip install -e .[wfc]

- name: Build Envs Docs
run: python docs/_scripts/gen_env_docs.py
Expand Down
8 changes: 4 additions & 4 deletions minigrid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def register_minigrid_envs():

register(
id="MiniGrid-ObstructedMaze-2Dlhb-v1",
entry_point="minigrid.envs.obstructedmaze_v1:ObstructedMaze_Full",
entry_point="minigrid.envs:ObstructedMaze_Full_V1",
kwargs={
"agent_room": (2, 1),
"key_in_box": True,
Expand All @@ -490,7 +490,7 @@ def register_minigrid_envs():

register(
id="MiniGrid-ObstructedMaze-1Q-v1",
entry_point="minigrid.envs.obstructedmaze_v1:ObstructedMaze_Full",
entry_point="minigrid.envs:ObstructedMaze_Full_V1",
kwargs={
"agent_room": (1, 1),
"key_in_box": True,
Expand All @@ -502,7 +502,7 @@ def register_minigrid_envs():

register(
id="MiniGrid-ObstructedMaze-2Q-v1",
entry_point="minigrid.envs.obstructedmaze_v1:ObstructedMaze_Full",
entry_point="minigrid.envs:ObstructedMaze_Full_V1",
kwargs={
"agent_room": (2, 1),
"key_in_box": True,
Expand All @@ -514,7 +514,7 @@ def register_minigrid_envs():

register(
id="MiniGrid-ObstructedMaze-Full-v1",
entry_point="minigrid.envs.obstructedmaze_v1:ObstructedMaze_Full",
entry_point="minigrid.envs:ObstructedMaze_Full_V1",
)

# Playground
Expand Down
1 change: 1 addition & 0 deletions minigrid/envs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
ObstructedMaze_Full,
ObstructedMazeEnv,
)
from minigrid.envs.obstructedmaze_v1 import ObstructedMaze_Full_V1
from minigrid.envs.playground import PlaygroundEnv
from minigrid.envs.putnear import PutNearEnv
from minigrid.envs.redbluedoors import RedBlueDoorEnv
Expand Down
2 changes: 1 addition & 1 deletion minigrid/envs/obstructedmaze_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from minigrid.envs.obstructedmaze import ObstructedMazeEnv


class ObstructedMaze_Full(ObstructedMazeEnv):
class ObstructedMaze_Full_V1(ObstructedMazeEnv):
"""
A blue ball is hidden in one of the 4 corners of a 3x3 maze. Doors
are locked, doors are obstructed by a ball and keys are hidden in
Expand Down
5 changes: 5 additions & 0 deletions minigrid/minigrid_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ def pprint_grid(self):

output = ""

# check if self.agent_pos & self.agent_dir is None
# should not be after env is reset
if self.agent_pos is None:
return super().__str__()

for j in range(self.grid.height):
for i in range(self.grid.width):
if i == self.agent_pos[0] and j == self.agent_pos[1]:
Expand Down

0 comments on commit 1eb3617

Please sign in to comment.