|
1 | 1 | """Tests the functionality of the DmControlCompatibility Wrapper on dm_control envs."""
|
| 2 | + |
2 | 3 | import pickle
|
3 | 4 | import warnings
|
4 | 5 | from typing import Callable
|
@@ -37,37 +38,17 @@ def test_dm_control_suite_envs():
|
37 | 38 | assert dm_control.suite.ALL_TASKS == DM_CONTROL_SUITE_ENVS
|
38 | 39 |
|
39 | 40 |
|
40 |
| -# todo - gymnasium v27 should remove the need for some of these warnings |
41 | 41 | CHECK_ENV_IGNORE_WARNINGS = [
|
42 | 42 | f"\x1b[33mWARN: {message}\x1b[0m"
|
43 | 43 | for message in [
|
44 | 44 | "A Box observation space minimum value is -infinity. This is probably too low.",
|
45 | 45 | "A Box observation space maximum value is infinity. This is probably too high.",
|
46 | 46 | "For Box action spaces, we recommend using a symmetric and normalized space (range=[-1, 1] or [0, 1]). See https://stable-baselines3.readthedocs.io/en/master/guide/rl_tips.html for more information.",
|
47 |
| - "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: ()", |
48 |
| - "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (8, 2)", |
49 |
| - "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (2, 4)", |
50 |
| - "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (4, 4)", |
51 |
| - "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (1, 3)", |
52 |
| - "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (1, 84, 84, 3)", |
53 |
| - "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (1, 2)", |
54 |
| - "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (1, 6)", |
55 |
| - "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (1, 4)", |
56 |
| - "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (1, 9)", |
57 |
| - "A Box observation space has an unconventional shape (neither an image, nor a 1D vector). We recommend flattening the observation to have only a 1D vector or use a custom policy to properly process the data. Actual observation shape: (1, 5)", |
58 |
| - "It seems a Box observation space is an image but the `dtype` is not `np.uint8`, actual type: float64. If the Box observation space is not an image, we recommend flattening the observation to have only a 1D vector.", |
59 |
| - "It seems a Box observation space is an image but the upper and lower bounds are not in [0, 255]. Generally, CNN policies assume observations are within that range, so you may encounter an issue if the observation values are not.", |
60 |
| - "arrays to stack must be passed as a 'sequence' type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future.", |
61 | 47 | "Calling `env.close()` on the closed environment should be allowed, but it raised an exception: _data",
|
62 | 48 | "Calling `env.close()` on the closed environment should be allowed, but it raised an exception: 'Physics' object has no attribute '_data'",
|
63 | 49 | ]
|
64 | 50 | ]
|
65 |
| -CHECK_ENV_IGNORE_WARNINGS.append( |
66 |
| - 'arrays to stack must be passed as a "sequence" type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future.', |
67 |
| -) |
68 |
| -CHECK_ENV_IGNORE_WARNINGS.append( |
69 |
| - "Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)" |
70 |
| -) |
| 51 | +CHECK_ENV_IGNORE_WARNINGS.append("`in1d` is deprecated. Use `np.isin` instead.") |
71 | 52 |
|
72 | 53 |
|
73 | 54 | @pytest.mark.parametrize("env_id", DM_CONTROL_ENV_IDS)
|
|
0 commit comments