Skip to content

Commit

Permalink
reformatted code
Browse files Browse the repository at this point in the history
  • Loading branch information
BolunDai0216 committed Jul 22, 2024
1 parent b9ec97f commit d3deb45
Show file tree
Hide file tree
Showing 35 changed files with 20 additions and 20 deletions.
1 change: 0 additions & 1 deletion minigrid/core/world_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@


class WorldObj:

"""
Base class for grid world objects
"""
Expand Down
1 change: 1 addition & 0 deletions minigrid/envs/babyai/core/levelgen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Copied and adapted from https://github.com/mila-iqia/babyai
"""

from __future__ import annotations

from minigrid.core.constants import COLOR_NAMES
Expand Down
1 change: 1 addition & 0 deletions minigrid/envs/babyai/core/roomgrid_level.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Copied and adapted from https://github.com/mila-iqia/babyai
"""

from __future__ import annotations

from minigrid.core.roomgrid import RoomGrid
Expand Down
1 change: 1 addition & 0 deletions minigrid/envs/babyai/core/verifier.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Copied and adapted from https://github.com/mila-iqia/babyai
"""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions minigrid/envs/babyai/goto.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Copied and adapted from https://github.com/mila-iqia/babyai.
Levels described in the Baby AI ICLR 2019 submission, with the `Go to` instruction.
"""

from __future__ import annotations

from minigrid.envs.babyai.core.levelgen import LevelGen
Expand Down
1 change: 1 addition & 0 deletions minigrid/envs/babyai/open.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Copied and adapted from https://github.com/mila-iqia/babyai.
Levels described in the Baby AI ICLR 2019 submission, with the `Open` instruction.
"""

from __future__ import annotations

from minigrid.core.constants import COLOR_NAMES
Expand Down
1 change: 1 addition & 0 deletions minigrid/envs/babyai/other.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Copied and adapted from https://github.com/mila-iqia/babyai.
Levels described in the Baby AI ICLR 2019 submission, with different instructions than those in other files.
"""

from __future__ import annotations

from minigrid.envs.babyai.core.roomgrid_level import RoomGridLevel
Expand Down
1 change: 1 addition & 0 deletions minigrid/envs/babyai/pickup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Copied and adapted from https://github.com/mila-iqia/babyai.
Levels described in the Baby AI ICLR 2019 submission, with the `Pick up` instruction.
"""

from __future__ import annotations

from minigrid.envs.babyai.core.levelgen import LevelGen
Expand Down
1 change: 1 addition & 0 deletions minigrid/envs/babyai/putnext.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Copied and adapted from https://github.com/mila-iqia/babyai.
Levels described in the Baby AI ICLR 2019 submission, with the `Put Next` instruction.
"""

from __future__ import annotations

from minigrid.envs.babyai.core.roomgrid_level import RoomGridLevel
Expand Down
1 change: 1 addition & 0 deletions minigrid/envs/babyai/unlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Copied and adapted from https://github.com/mila-iqia/babyai.
Levels described in the Baby AI ICLR 2019 submission, with the `Unlock` instruction.
"""

from __future__ import annotations

from minigrid.core.constants import COLOR_NAMES
Expand Down
1 change: 0 additions & 1 deletion minigrid/envs/blockedunlockpickup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class BlockedUnlockPickupEnv(RoomGrid):

"""
## Description
Expand Down
1 change: 0 additions & 1 deletion minigrid/envs/crossing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@


class CrossingEnv(MiniGridEnv):

"""
## Description
Expand Down
1 change: 0 additions & 1 deletion minigrid/envs/distshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class DistShiftEnv(MiniGridEnv):

"""
## Description
Expand Down
1 change: 0 additions & 1 deletion minigrid/envs/doorkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class DoorKeyEnv(MiniGridEnv):

"""
## Description
Expand Down
1 change: 0 additions & 1 deletion minigrid/envs/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class FetchEnv(MiniGridEnv):

"""
## Description
Expand Down
1 change: 0 additions & 1 deletion minigrid/envs/fourrooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class FourRoomsEnv(MiniGridEnv):

"""
## Description
Expand Down
1 change: 0 additions & 1 deletion minigrid/envs/keycorridor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class KeyCorridorEnv(RoomGrid):

"""
## Description
Expand Down
1 change: 0 additions & 1 deletion minigrid/envs/lavagap.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@


class LavaGapEnv(MiniGridEnv):

"""
## Description
Expand Down
1 change: 0 additions & 1 deletion minigrid/envs/lockedroom.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def rand_pos(self, env):


class LockedRoomEnv(MiniGridEnv):

"""
## Description
Expand Down
1 change: 0 additions & 1 deletion minigrid/envs/memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


class MemoryEnv(MiniGridEnv):

"""
## Description
Expand Down
1 change: 0 additions & 1 deletion minigrid/envs/multiroom.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def __init__(self, top, size, entryDoorPos, exitDoorPos):


class MultiRoomEnv(MiniGridEnv):

"""
## Description
Expand Down
1 change: 0 additions & 1 deletion minigrid/envs/obstructedmaze.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class ObstructedMazeEnv(RoomGrid):

"""
## Description
Expand Down
1 change: 0 additions & 1 deletion minigrid/envs/putnear.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class PutNearEnv(MiniGridEnv):

"""
## Description
Expand Down
1 change: 0 additions & 1 deletion minigrid/envs/redbluedoors.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class RedBlueDoorEnv(MiniGridEnv):

"""
## Description
Expand Down
1 change: 0 additions & 1 deletion minigrid/envs/unlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class UnlockEnv(RoomGrid):

"""
## Description
Expand Down
1 change: 0 additions & 1 deletion minigrid/envs/unlockpickup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class UnlockPickupEnv(RoomGrid):

"""
## Description
Expand Down
1 change: 1 addition & 0 deletions minigrid/envs/wfc/wfclogic/adjacency.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Convert input data to adjacency information. Implementation based on https://github.com/ikarth/wfc_2019f"""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions minigrid/envs/wfc/wfclogic/control.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Main WFC execution function. Implementation based on https://github.com/ikarth/wfc_2019f"""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions minigrid/envs/wfc/wfclogic/solver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Wave Function Collapse solver. Implementation based on https://github.com/ikarth/wfc_2019f"""

from __future__ import annotations

import itertools
Expand Down
1 change: 1 addition & 0 deletions minigrid/envs/wfc/wfclogic/tiles.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Breaks an image into consituant tiles. Implementation based on https://github.com/ikarth/wfc_2019f"""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions minigrid/envs/wfc/wfclogic/utilities.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utility data and functions for WFC. Implementation based on https://github.com/ikarth/wfc_2019f"""

from __future__ import annotations

import collections
Expand Down
6 changes: 3 additions & 3 deletions minigrid/wrappers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from __future__ import annotations

import math
import operator
from functools import reduce
from typing import Any

import gymnasium as gym
Expand Down Expand Up @@ -596,7 +594,9 @@ def observation(self, obs):
), f"mission string too long ({len(mission)} chars)"
mission = mission.lower()

str_array = np.zeros(shape=(self.maxStrLen, self.numCharCodes), dtype="uint8")
str_array = np.zeros(
shape=(self.maxStrLen, self.numCharCodes), dtype="uint8"
)
# as `numCharCodes` < 255 then we can use `uint8`

for idx, ch in enumerate(mission):
Expand Down
1 change: 1 addition & 0 deletions tests/test_wfc/test_wfc_adjacency.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Convert input data to adjacency information"""

from __future__ import annotations

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions tests/test_wfc/test_wfc_tiles.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Breaks an image into consituant tiles."""

from __future__ import annotations

from minigrid.envs.wfc.wfclogic import tiles as wfc_tiles
Expand Down
1 change: 1 addition & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Finds all the specs that we can test with"""

from __future__ import annotations

from importlib.util import find_spec
Expand Down

0 comments on commit d3deb45

Please sign in to comment.