-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
[DO NOT MERGE] Update to 1.0.0 alpha2 #36
Closed
Closed
Changes from 35 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
83014e5
Update to 1.0.0 alpha1
traversaro ed69344
Update meta.yaml
traversaro 17f5344
Update requirement list
pseudo-rnd-thoughts ee7c555
Update meta.yaml
traversaro c7ba3fd
Remove cython dependency from gymnasium-mujoco
traversaro 77b1438
Update for Alpha 2
pseudo-rnd-thoughts ab677e9
Fix sha256
pseudo-rnd-thoughts d41a48e
Create 1060.patch
traversaro c5f0fa1
Update meta.yaml
traversaro c49cc07
Update meta.yaml
traversaro 8f263ef
Update meta.yaml
traversaro 9daa0a0
Update meta.yaml
traversaro dbafe3f
Update meta.yaml
traversaro 968aea0
Update meta.yaml
traversaro 4f7c97a
Update meta.yaml
traversaro 897d31a
Update meta.yaml
traversaro 74e52fd
Update meta.yaml
traversaro ad7e21b
Update meta.yaml
traversaro b46e50f
Update meta.yaml
traversaro 71c8a6c
Create 1065.patch
traversaro 671c171
Update meta.yaml
traversaro bc3f555
Update meta.yaml
traversaro 4b5c798
Update meta.yaml
traversaro d2f4cfc
Create 1066.patch
traversaro 593c7f8
Delete recipe/patches/932.patch
traversaro 955d9b7
Update meta.yaml
traversaro 4ac2094
Update meta.yaml
traversaro 9f44e5b
Update meta.yaml
traversaro 24e9d79
Update meta.yaml
traversaro a1b7057
Update meta.yaml
traversaro bb08af2
Update meta.yaml
traversaro 36c0cc8
Update meta.yaml
traversaro 453fe7e
Update meta.yaml
traversaro 8076119
Update meta.yaml
traversaro cbd34d7
Skip more tests on aarch64
traversaro 497ee34
Update recipe/meta.yaml
traversaro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
From c72daa87f6eebf7a14057ab7e70ed8c74d021a4a Mon Sep 17 00:00:00 2001 | ||
From: Silvio Traversaro <[email protected]> | ||
Date: Tue, 21 May 2024 22:59:48 +0200 | ||
Subject: [PATCH] mujoco_py_env: Only raise an exception if MuJocoPyEnv class | ||
is actually used | ||
|
||
--- | ||
gymnasium/envs/mujoco/mujoco_py_env.py | 16 +++++++++++----- | ||
1 file changed, 11 insertions(+), 5 deletions(-) | ||
|
||
diff --git a/gymnasium/envs/mujoco/mujoco_py_env.py b/gymnasium/envs/mujoco/mujoco_py_env.py | ||
index 8d2949102..a15ac7a5a 100644 | ||
--- a/gymnasium/envs/mujoco/mujoco_py_env.py | ||
+++ b/gymnasium/envs/mujoco/mujoco_py_env.py | ||
@@ -12,11 +12,9 @@ | ||
try: | ||
import mujoco_py | ||
except ImportError as e: | ||
- raise error.DependencyNotInstalled( | ||
- "Could not import mujoco_py, which is needed for MuJoCo environments older than V4", | ||
- "You could either use a newer version of the environments, or install the (deprecated) mujoco-py package" | ||
- "following the instructions on their GitHub page.", | ||
- ) from e | ||
+ MUJOCO_PY_IMPORT_ERROR = e | ||
+else: | ||
+ MUJOCO_PY_IMPORT_ERROR = None | ||
|
||
|
||
# NOTE: duplication of analogous code in mujoco_env.py | ||
@@ -214,6 +212,14 @@ def __init__( | ||
camera_id: Optional[int] = None, | ||
camera_name: Optional[str] = None, | ||
): | ||
+ if MUJOCO_PY_IMPORT_ERROR is not None: | ||
+ raise error.DependencyNotInstalled( | ||
+ f"{MUJOCO_PY_IMPORT_ERROR}. " | ||
+ "Could not import mujoco_py, which is needed for MuJoCo environments older than V4", | ||
+ "You could either use a newer version of the environments, or install the (deprecated) mujoco-py package" | ||
+ "following the instructions on their GitHub page.", | ||
+ ) | ||
+ | ||
logger.deprecation( | ||
"This version of the mujoco environments depends " | ||
"on the mujoco-py bindings, which are no longer maintained " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
From 36e67165ba693cfe80bf2c6b02e5278fe435f9c8 Mon Sep 17 00:00:00 2001 | ||
From: Silvio Traversaro <[email protected]> | ||
Date: Fri, 24 May 2024 16:24:09 +0200 | ||
Subject: [PATCH] Fix RescaleObservation on Windows | ||
|
||
--- | ||
gymnasium/wrappers/transform_observation.py | 9 +++++++-- | ||
1 file changed, 7 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/gymnasium/wrappers/transform_observation.py b/gymnasium/wrappers/transform_observation.py | ||
index b288c426c..a95daf6ce 100644 | ||
--- a/gymnasium/wrappers/transform_observation.py | ||
+++ b/gymnasium/wrappers/transform_observation.py | ||
@@ -517,9 +517,14 @@ def __init__( | ||
self.max_obs = max_obs | ||
|
||
# Imagine the x-axis between the old Box and the y-axis being the new Box | ||
+ # float128 is not available everywhere | ||
+ try: | ||
+ high_low_diff_dtype = np.float128 | ||
+ except AttributeError: | ||
+ high_low_diff_dtype = np.float64 | ||
high_low_diff = np.array( | ||
- env.observation_space.high, dtype=np.float128 | ||
- ) - np.array(env.observation_space.low, dtype=np.float128) | ||
+ env.observation_space.high, dtype=high_low_diff_dtype | ||
+ ) - np.array(env.observation_space.low, dtype=high_low_diff_dtype) | ||
gradient = np.array( | ||
(max_obs - min_obs) / high_low_diff, dtype=env.observation_space.dtype | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
From 13d3653c7a40e2b97bc694f3602a715b2ae6a85f Mon Sep 17 00:00:00 2001 | ||
From: Silvio Traversaro <[email protected]> | ||
Date: Fri, 24 May 2024 17:56:31 +0200 | ||
Subject: [PATCH] Fix test_dict_info_to_list test on Windows | ||
|
||
--- | ||
.../wrappers/vector/test_dict_info_to_list.py | 23 ++++++++++++------- | ||
1 file changed, 15 insertions(+), 8 deletions(-) | ||
|
||
diff --git a/tests/wrappers/vector/test_dict_info_to_list.py b/tests/wrappers/vector/test_dict_info_to_list.py | ||
index 9e61f29b9..f07c97005 100644 | ||
--- a/tests/wrappers/vector/test_dict_info_to_list.py | ||
+++ b/tests/wrappers/vector/test_dict_info_to_list.py | ||
@@ -60,9 +60,13 @@ def test_update_info(): | ||
"_e": np.array([True]), | ||
} | ||
_, list_info = env.reset(options=vector_infos) | ||
+ | ||
+ # The return dtype of np.array([0]) is platform dependent | ||
+ np_array_int_default_dtype = np.array([0]).dtype.type | ||
+ | ||
expected_list_info = [ | ||
{ | ||
- "a": np.int64(0), | ||
+ "a": np_array_int_default_dtype(0), | ||
"b": np.float64(0.0), | ||
"c": None, | ||
"d": np.zeros((2,)), | ||
@@ -90,21 +94,21 @@ def test_update_info(): | ||
_, list_info = env.reset(options=vector_infos) | ||
expected_list_info = [ | ||
{ | ||
- "a": np.int64(0), | ||
+ "a": np_array_int_default_dtype(0), | ||
"b": np.float64(0.0), | ||
"c": None, | ||
"d": np.zeros((2,)), | ||
"e": Discrete(1), | ||
}, | ||
{ | ||
- "a": np.int64(1), | ||
+ "a": np_array_int_default_dtype(1), | ||
"b": np.float64(1.0), | ||
"c": None, | ||
"d": np.zeros((2,)), | ||
"e": Discrete(2), | ||
}, | ||
{ | ||
- "a": np.int64(2), | ||
+ "a": np_array_int_default_dtype(2), | ||
"b": np.float64(2.0), | ||
"c": None, | ||
"d": np.zeros((2,)), | ||
@@ -134,7 +138,7 @@ def test_update_info(): | ||
} | ||
_, list_info = env.reset(options=vector_infos) | ||
expected_list_info = [ | ||
- {"a": np.int64(1), "b": np.float64(1.0)}, | ||
+ {"a": np_array_int_default_dtype(1), "b": np.float64(1.0)}, | ||
{"c": None, "d": np.zeros((2,))}, | ||
{"e": Discrete(3)}, | ||
] | ||
@@ -156,8 +160,11 @@ def test_update_info(): | ||
} | ||
_, list_info = env.reset(options=vector_infos) | ||
expected_list_info = [ | ||
- {"episode": {"a": np.int64(1), "b": np.float64(1.0)}}, | ||
- {"episode": {"a": np.int64(2), "b": np.float64(2.0)}, "a": np.int64(1)}, | ||
- {"a": np.int64(2)}, | ||
+ {"episode": {"a": np_array_int_default_dtype(1), "b": np.float64(1.0)}}, | ||
+ { | ||
+ "episode": {"a": np_array_int_default_dtype(2), "b": np.float64(2.0)}, | ||
+ "a": np_array_int_default_dtype(1), | ||
+ }, | ||
+ {"a": np_array_int_default_dtype(2)}, | ||
] | ||
assert data_equivalence(list_info, expected_list_info) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to be consistent and also move this into the
patches
folder