mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-30 01:50:19 +00:00
Add (A)syncVectorEnv support for sub-envs with different observation spaces (#1140)
Co-authored-by: Reggie <72816837+reginald-mclean@users.noreply.github.com> Co-authored-by: Reggie McLean <reginald.mclean@ryerson.ca>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
"""Test the `SyncVectorEnv` implementation."""
|
||||
|
||||
import re
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
|
||||
@@ -139,7 +141,12 @@ def test_check_spaces_sync_vector_env():
|
||||
env_fns = [make_env("CartPole-v1", i) for i in range(8)]
|
||||
# FrozenLake-v1 - Discrete(16), action_space: Discrete(4)
|
||||
env_fns[1] = make_env("FrozenLake-v1", 1)
|
||||
with pytest.raises(RuntimeError):
|
||||
with pytest.raises(
|
||||
AssertionError,
|
||||
match=re.escape(
|
||||
"SyncVectorEnv(..., observation_mode='same') however the sub-environments observation spaces are not equivalent."
|
||||
),
|
||||
):
|
||||
env = SyncVectorEnv(env_fns)
|
||||
env.close()
|
||||
|
||||
|
Reference in New Issue
Block a user