-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ Pass gym.make test for common HCraft envs
- Loading branch information
1 parent
c845de6
commit da95b04
Showing
14 changed files
with
90 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,56 @@ | ||
from hcraft.examples.minicraft.empty import MiniCraftEmpty | ||
from hcraft.examples.minicraft.fourrooms import MiniCraftFourRooms | ||
from hcraft.examples.minicraft.multiroom import MiniCraftMultiRoom | ||
from hcraft.examples.minicraft.crossing import MiniCraftCrossing | ||
from hcraft.examples.minicraft.doorkey import MiniCraftDoorKey | ||
from hcraft.examples.minicraft.unlock import MiniCraftUnlock | ||
from hcraft.examples.minicraft.unlockpickup import MiniCraftUnlockPickup | ||
from hcraft.examples.minicraft.unlockpickupblocked import MiniCraftBlockedUnlockPickup | ||
from hcraft.examples.minicraft.keycorridor import MiniCraftKeyCorridor | ||
import inspect | ||
from pathlib import Path | ||
|
||
from hcraft.examples.minicraft.empty import MiniHCraftEmpty | ||
from hcraft.examples.minicraft.fourrooms import MiniHCraftFourRooms | ||
from hcraft.examples.minicraft.multiroom import MiniHCraftMultiRoom | ||
from hcraft.examples.minicraft.crossing import MiniHCraftCrossing | ||
from hcraft.examples.minicraft.doorkey import MiniHCraftDoorKey | ||
from hcraft.examples.minicraft.unlock import MiniHCraftUnlock | ||
from hcraft.examples.minicraft.unlockpickup import MiniHCraftUnlockPickup | ||
from hcraft.examples.minicraft.unlockpickupblocked import MiniHCraftBlockedUnlockPickup | ||
from hcraft.examples.minicraft.keycorridor import MiniHCraftKeyCorridor | ||
|
||
|
||
MINICRAFT_ENVS = [ | ||
MiniCraftEmpty, | ||
MiniCraftFourRooms, | ||
MiniCraftMultiRoom, | ||
MiniCraftCrossing, | ||
MiniCraftDoorKey, | ||
MiniCraftUnlock, | ||
MiniCraftUnlockPickup, | ||
MiniCraftBlockedUnlockPickup, | ||
MiniCraftKeyCorridor, | ||
MiniHCraftEmpty, | ||
MiniHCraftFourRooms, | ||
MiniHCraftMultiRoom, | ||
MiniHCraftCrossing, | ||
MiniHCraftDoorKey, | ||
MiniHCraftUnlock, | ||
MiniHCraftUnlockPickup, | ||
MiniHCraftBlockedUnlockPickup, | ||
MiniHCraftKeyCorridor, | ||
] | ||
|
||
__all__ = [ | ||
"MiniCraftEmpty", | ||
"MiniCraftFourRooms", | ||
"MiniCraftMultiRoom", | ||
"MiniCraftCrossing", | ||
"MiniCraftDoorKey", | ||
"MiniCraftUnlock", | ||
"MiniCraftUnlockPickup", | ||
"MiniCraftBlockedUnlockPickup", | ||
"MiniCraftKeyCorridor", | ||
"MiniHCraftEmpty", | ||
"MiniHCraftFourRooms", | ||
"MiniHCraftMultiRoom", | ||
"MiniHCraftCrossing", | ||
"MiniHCraftDoorKey", | ||
"MiniHCraftUnlock", | ||
"MiniHCraftUnlockPickup", | ||
"MiniHCraftBlockedUnlockPickup", | ||
"MiniHCraftKeyCorridor", | ||
] | ||
|
||
MINICRAFT_GYM_ENVS = [] | ||
|
||
try: | ||
import gym | ||
|
||
ENV_PATH = "hcraft.examples.minicraft" | ||
|
||
for env_class in MINICRAFT_ENVS: | ||
env_name = env_class().name | ||
submodule = Path(inspect.getfile(env_class)).name.split(".")[0] | ||
env_path = f"{ENV_PATH}.{submodule}:{env_class.__name__}" | ||
gym_name = f"{env_name}-v1" | ||
gym.register(id=gym_name, entry_point=env_path) | ||
MINICRAFT_GYM_ENVS.append(gym_name) | ||
|
||
|
||
except ImportError: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters