Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow parallel envs to have other optional keys in info/obs dicts (e.g., "common") #1110

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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