Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit 4587b25

Browse files
committed
Registering default navigation and skills environments using MiniHacks environment registration function
1 parent ff7d8f1 commit 4587b25

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

minihack/navigation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Copyright (c) Facebook, Inc. and its affiliates.
22

33
from minihack import MiniHack
4+
from minihack.envs import register
45
from nle import nethack
5-
from gym.envs import registration
66

77

88
MOVE_ACTIONS = tuple(nethack.CompassDirection)
@@ -42,7 +42,7 @@ def __init__(self, *args, des_file: str = None, **kwargs):
4242
super().__init__(*args, des_file=des_file, **kwargs)
4343

4444

45-
registration.register(
45+
register(
4646
id="MiniHack-Navigation-Custom-v0",
4747
entry_point="minihack.navigation:MiniHackNavigation",
4848
)

minihack/skills.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Copyright (c) Facebook, Inc. and its affiliates.
2+
23
from minihack import MiniHack
34
from minihack.base import MH_DEFAULT_OBS_KEYS
4-
from gym.envs import registration
5+
from minihack.envs import register
56

67

78
class MiniHackSkill(MiniHack):
@@ -51,7 +52,7 @@ def __init__(
5152
super().__init__(*args, des_file=des_file, **kwargs)
5253

5354

54-
registration.register(
55+
register(
5556
id="MiniHack-Skill-Custom-v0",
5657
entry_point="minihack.skills:MiniHackSkill",
5758
)

0 commit comments

Comments
 (0)