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

Fixing MiniHacks obs space if include_alignment_blstats==False #85

Merged
merged 2 commits into from
Apr 20, 2023
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9"]
python-version: ["3.8", "3.9"]
os: [ubuntu-latest, macos-latest]
fail-fast: false
steps:
Expand Down
18 changes: 9 additions & 9 deletions minihack/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,18 +328,18 @@ def __init__(
def _get_obs_space_dict(self, space_dict):
obs_space_dict = {}
for key in self._minihack_obs_keys:
if key in space_dict.keys():
obs_space_dict[key] = space_dict[key]
elif "blstats" in key and self.remove_alignment_blstats:
if "blstats" in key and self.remove_alignment_blstats:
# Remove alignment from blstats to make minihack compatible
# with NLE version v0.8.1
obs_space_dict[key] = (
gym.spaces.Box(
low=np.iinfo(np.int32).min,
high=np.iinfo(np.int32).max,
**nethack.OBSERVATION_DESC["blstats"] - 1,
),
shape = nethack.OBSERVATION_DESC["blstats"]["shape"]
obs_space_dict[key] = gym.spaces.Box(
low=np.iinfo(np.int32).min,
high=np.iinfo(np.int32).max,
shape=(shape[0] - 1,),
dtype=nethack.OBSERVATION_DESC["blstats"]["dtype"],
)
elif key in space_dict.keys():
obs_space_dict[key] = space_dict[key]
elif key in MINIHACK_SPACE_FUNCS.keys():
space_func = MINIHACK_SPACE_FUNCS[key]
obs_space_dict[key] = space_func(
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
Expand Down