Improve atari documentation through using multiple columns for the actions table (#394)

This commit is contained in:
Mark Towers
2023-03-17 23:25:58 +00:00
committed by GitHub
parent a6672bad9e
commit 2a9077bee6
107 changed files with 741 additions and 1616 deletions

View File

@@ -90,7 +90,7 @@ for rom_id in tqdm(ALL_ATARI_GAMES):
env_description = env_data["env_description"]
if env_data["atariage_url"]:
env_url = f"""
For a more detailed documentation, see [the AtariAge page]({env_data['atariage_url']})
For a more detailed documentation, see [the AtariAge page]({env_data['atariage_url']})
"""
else:
env_url = ""
@@ -101,12 +101,13 @@ for rom_id in tqdm(ALL_ATARI_GAMES):
env_url = ""
reward_description = ""
table_values = map(
lambda s: f"`{s}`",
itertools.chain(*zip(range(env.action_space.n), env.get_action_meanings())),
)
default_action_table = tabulate.tabulate(
[
[f"`{num}`", f"`{meaning}`"]
for num, meaning in enumerate(env.get_action_meanings())
],
headers=["Value", "Meaning"],
list(itertools.zip_longest(*([iter(table_values)] * 6), fillvalue="")),
headers=["Value", "Meaning", "Value", "Meaning", "Value", "Meaning"],
tablefmt="github",
)
if env.action_space.n == 18: