Skip to content

Commit

Permalink
Hotfix for act wrapping error (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadcowD authored Jun 16, 2020
1 parent a04654c commit 3c67e0e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion minerl/env/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def _process_action(self, action_in) -> str:
subact = " ".join(str(x) for x in subact)

action_in[act] = subact
elif isinstance(self.action_space.spaces[act], gym.spaces.Discrete):
elif isinstance(bottom_env_spec.action_space.spaces[act], gym.spaces.Discrete):
action_in[act] = int(action_in[act])

action_str.append(
Expand Down
10 changes: 7 additions & 3 deletions minerl/herobraine/envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import minerl.data.version
import os



# Must load non-obfuscated envs first!
# Publish.py depends on this order for black-listing streams
MINERL_TREECHOP_V0 = Treechop()
Expand All @@ -25,9 +27,6 @@
MINERL_OBTAIN_IRON_PICKAXE_V0 = ObtainIronPickaxe(dense=False)
MINERL_OBTAIN_IRON_PICKAXE_DENSE_V0 = ObtainIronPickaxe(dense=True)

# # Survival envs
# MINERL_OBTAIN_DIAMOND_SURVIVAL_V0 = ObtainDiamondSurvival(dense=False)

# # prototype envs
# # TODO: Actually make these work and correct, it'll be good to release these.
# MINERL_OBTAIN_MEAT_V0 = Obtain(target_item='meat', dense=False, reward_schedule={
Expand All @@ -50,6 +49,9 @@
# TODO FORMAT THIS AUTOMATICALLY USING CIRCULAR IMPORTS
os.path.dirname(os.path.abspath(__file__)), "env_specs", "obfuscators", "comp", "v3")

# # Survival envs
MINERL_OBTAIN_DIAMOND_SURVIVAL_V0 = Obfuscated(Vectorized(ObtainDiamondSurvival(dense=True), common_envs=comp_envs), comp_obfuscator_dir, 'MineRLObtainDiamondSurvivalVectorObf-v0')



MINERL_TREECHOP_OBF_V0 = Obfuscated(Vectorized(MINERL_TREECHOP_V0, common_envs=comp_envs), comp_obfuscator_dir)
Expand All @@ -65,6 +67,8 @@
MINERL_OBTAIN_IRON_PICKAXE_OBF_V0 = Obfuscated(Vectorized(MINERL_OBTAIN_IRON_PICKAXE_V0, common_envs=comp_envs), comp_obfuscator_dir)
MINERL_OBTAIN_IRON_PICKAXE_DENSE_OBF_V0 = Obfuscated(Vectorized(MINERL_OBTAIN_IRON_PICKAXE_DENSE_V0, common_envs=comp_envs), comp_obfuscator_dir)



# ENVS = [MINERL_OBTAIN_IRON_PICKAXE_OBF_V0]


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def package_files(directory):

setuptools.setup(
name='minerl',
version='0.3.0',
version='0.3.1',
description='MineRL environment and data loader for reinforcement learning from human demonstration in Minecraft',
long_description=markdown,
long_description_content_type="text/markdown",
Expand Down
4 changes: 4 additions & 0 deletions tests/excluded/no_op_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import minerl, gym
env = gym.make("MineRLObtainDiamondVectorObf-v0")
obs = env.reset()
_ = env.step(env.action_space.noop()) # Also happens if you try to feed in {'vector': np.random.random((64,))}

0 comments on commit 3c67e0e

Please sign in to comment.