Skip to content

Commit

Permalink
handers..equip.py: Reduce from_universal warning verbosity (#540)
Browse files Browse the repository at this point in the history
* handers..equip.py: Reduce from_universal warning verbosity

* even more filtering
  • Loading branch information
shwang authored Jul 6, 2021
1 parent 561ffe6 commit 8c92075
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions minerl/herobraine/hero/handlers/agent/actions/equip.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,15 @@ def from_universal(self, obs) -> str:
self._previous_metadata = metadata
return result
else:
self.logger.warning(f"Unexpected slots_gui_type={slots_gui_type}, "
f"Abandoning processing and simply returning {self._default}"
)
expected_ignore_types = ( # Filter these out to reduce stderr clutter
"class net.minecraft.inventory.ContainerWorkbench",
"class net.minecraft.inventory.ContainerFurnace",
"class net.minecraft.inventory.ContainerChest",
"class net.minecraft.inventory.ContainerMerchant",
)

if slots_gui_type not in expected_ignore_types:
self.logger.debug(f"Unexpected slots_gui_type={slots_gui_type}, "
f"Abandoning processing and simply returning '{self._default}'"
)
return self._default

0 comments on commit 8c92075

Please sign in to comment.