Skip to content

Commit

Permalink
Allow parallel envs to have other optional keys in info/obs dicts (e.…
Browse files Browse the repository at this point in the history
…g., "common") (#1110)
  • Loading branch information
elliottower authored Sep 27, 2023
1 parent e907e05 commit d0196aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pettingzoo/test/parallel_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ def parallel_api_test(par_env: ParallelEnv, num_cycles=1000):

assert isinstance(obs, dict)
assert isinstance(infos, dict)
assert set(obs.keys()) == (set(par_env.agents))
assert set(infos.keys()) == (set(par_env.agents))
# Note: obs and info dicts must contain all AgentIDs, but can also have other additional keys (e.g., "common")
assert set(par_env.agents).issubset(set(obs.keys()))
assert set(par_env.agents).issubset(set(infos.keys()))
terminated = {agent: False for agent in par_env.agents}
truncated = {agent: False for agent in par_env.agents}
live_agents = set(par_env.agents[:])
Expand Down

0 comments on commit d0196aa

Please sign in to comment.