From b26a69df659eef3a36b17f5b467162cfde7a9b15 Mon Sep 17 00:00:00 2001 From: pseudo-rnd-thoughts Date: Thu, 9 Jan 2025 13:21:27 +0000 Subject: [PATCH] pre-commit --- docs/_scripts/gen_environments_md.py | 3 ++- docs/environments/riverraid.md | 2 +- src/ale/python/registration.py | 4 +--- tests/python/test_atari_env.py | 8 ++++++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/_scripts/gen_environments_md.py b/docs/_scripts/gen_environments_md.py index 42ff4d52..ba8d13f7 100644 --- a/docs/_scripts/gen_environments_md.py +++ b/docs/_scripts/gen_environments_md.py @@ -44,7 +44,8 @@ def shortened_repr(values): env = gymnasium.make(f"ALE/{env_name}-v5").unwrapped - general_info_table = tabulate.tabulate([ + general_info_table = tabulate.tabulate( + [ ["Make", f'gymnasium.make("ALE/{env_name}-v5")'], ["Action Space", str(env.action_space)], ["Observation Space", str(env.observation_space)], diff --git a/docs/environments/riverraid.md b/docs/environments/riverraid.md index e362b634..c30d25d6 100644 --- a/docs/environments/riverraid.md +++ b/docs/environments/riverraid.md @@ -53,7 +53,7 @@ See variants section for the type of observation used by each environment id by ### Reward -Score points are your only reward. You get score points each time you destroy an enemy object: +Score points are your only reward. You get score points each time you destroy an enemy object: | Enemy Object | Score Points | |--------------|--------------| diff --git a/src/ale/python/registration.py b/src/ale/python/registration.py index e46eb22a..61ff42ce 100644 --- a/src/ale/python/registration.py +++ b/src/ale/python/registration.py @@ -2,8 +2,6 @@ from __future__ import annotations -from collections import defaultdict - import ale_py.roms as roms import gymnasium @@ -16,7 +14,7 @@ def rom_id_to_name(rom: str) -> str: def register_envs(): """Register all the Atari Environments.""" all_rom_ids = roms.get_all_rom_ids() - # These environments all don't have a single agent implementation + # These environments all don't have a single agent implementation therefore are removed all_rom_ids.remove("warlords") all_rom_ids.remove("maze_craze") all_rom_ids.remove("joust") diff --git a/tests/python/test_atari_env.py b/tests/python/test_atari_env.py index 58a4a96b..78c15d5d 100644 --- a/tests/python/test_atari_env.py +++ b/tests/python/test_atari_env.py @@ -23,9 +23,13 @@ def test_roms_register(): registered_v5_roms = list(filter(lambda env_id: "v5" in env_id, registered_roms)) assert len(registered_v5_roms) == 104 - registered_noframeskip_v4_roms = list(filter(lambda env_id: "NoFrameskip-v4" in env_id, registered_roms)) + registered_noframeskip_v4_roms = list( + filter(lambda env_id: "NoFrameskip-v4" in env_id, registered_roms) + ) assert len(registered_noframeskip_v4_roms) == 104 - assert len(registered_roms) == len(registered_v5_roms) + len(registered_noframeskip_v4_roms) + assert len(registered_roms) == len(registered_v5_roms) + len( + registered_noframeskip_v4_roms + ) @pytest.mark.parametrize(