Skip to content

Commit cab0fbb

Browse files
Update the documentation for v0.28 (#405)
1 parent 3d5c218 commit cab0fbb

27 files changed

+115
-57
lines changed

Diff for: docs/api/experimental.md

-8
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,3 @@ We aimed to replace the wrappers in gymnasium v0.30.0 with these experimental wr
155155
* :class:`experimental.wrappers.JaxToTorchV0`
156156
* :class:`experimental.wrappers.NumpyToTorchV0`
157157
```
158-
159-
## Vector Environment
160-
161-
These changes will be made in v0.28
162-
163-
## Wrappers for Vector Environments
164-
165-
These changes will be made in v0.28

Diff for: docs/api/experimental/functional.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ title: Functional
2929
## gymnasium.experimental.func2env.FunctionalJaxCompatibilityEnv
3030

3131
```{eval-rst}
32-
.. autoclass:: gymnasium.experimental.func_jax_env.FunctionalJaxEnv
32+
.. autoclass:: gymnasium.experimental.functional_jax_env.FunctionalJaxEnv
3333
34-
.. autofunction:: gymnasium.experimental.func_jax_env.FunctionalJaxEnv.reset
35-
.. autofunction:: gymnasium.experimental.func_jax_env.FunctionalJaxEnv.step
36-
.. autofunction:: gymnasium.experimental.func_jax_env.FunctionalJaxEnv.render
34+
.. autofunction:: gymnasium.experimental.functional_jax_env.FunctionalJaxEnv.reset
35+
.. autofunction:: gymnasium.experimental.functional_jax_env.FunctionalJaxEnv.step
36+
.. autofunction:: gymnasium.experimental.functional_jax_env.FunctionalJaxEnv.render
3737
```

Diff for: docs/api/experimental/vector.md

+27-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,34 @@ title: Vector
66

77
## gymnasium.experimental.VectorEnv
88

9+
```{eval-rst}
10+
.. autoclass:: gymnasium.experimental.vector.VectorEnv
11+
.. autofunction:: gymnasium.experimental.vector.VectorEnv.reset
12+
.. autofunction:: gymnasium.experimental.vector.VectorEnv.step
13+
.. autofunction:: gymnasium.experimental.vector.VectorEnv.close
14+
.. autofunction:: gymnasium.experimental.vector.VectorEnv.reset
15+
```
16+
917
## gymnasium.experimental.vector.AsyncVectorEnv
1018

11-
## gymnasium.experimental.vector.SyncVectorEnv
19+
```{eval-rst}
20+
.. autoclass:: gymnasium.experimental.vector.AsyncVectorEnv
21+
.. autofunction:: gymnasium.experimental.vector.AsyncVectorEnv.reset
22+
.. autofunction:: gymnasium.experimental.vector.AsyncVectorEnv.step
23+
.. autofunction:: gymnasium.experimental.vector.AsyncVectorEnv.close
24+
.. autofunction:: gymnasium.experimental.vector.AsyncVectorEnv.call
25+
.. autofunction:: gymnasium.experimental.vector.AsyncVectorEnv.get_attr
26+
.. autofunction:: gymnasium.experimental.vector.AsyncVectorEnv.set_attr
27+
```
1228

13-
## Custom Vector environments
29+
## gymnasium.experimental.vector.SyncVectorEnv
1430

15-
## EnvPool
31+
```{eval-rst}
32+
.. autoclass:: gymnasium.experimental.vector.SyncVectorEnv
33+
.. autofunction:: gymnasium.experimental.vector.SyncVectorEnv.reset
34+
.. autofunction:: gymnasium.experimental.vector.SyncVectorEnv.step
35+
.. autofunction:: gymnasium.experimental.vector.SyncVectorEnv.close
36+
.. autofunction:: gymnasium.experimental.vector.SyncVectorEnv.call
37+
.. autofunction:: gymnasium.experimental.vector.SyncVectorEnv.get_attr
38+
.. autofunction:: gymnasium.experimental.vector.SyncVectorEnv.set_attr
39+
```

Diff for: docs/api/experimental/vector_utils.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
---
2-
title: Vector Utility functions
2+
title: Vector Utility
33
---
44

55
# Utility functions for vectorisation
66

7+
## Spaces utility functions
8+
79
```{eval-rst}
810
.. autofunction:: gymnasium.experimental.vector.utils.batch_space
911
.. autofunction:: gymnasium.experimental.vector.utils.concatenate
1012
.. autofunction:: gymnasium.experimental.vector.utils.iterate
1113
.. autofunction:: gymnasium.experimental.vector.utils.create_empty_array
1214
```
15+
16+
## Shared memory functions
17+
18+
```{eval-rst}
19+
.. autofunction:: gymnasium.experimental.vector.utils.create_shared_memory
20+
.. autofunction:: gymnasium.experimental.vector.utils.read_from_shared_memory
21+
.. autofunction:: gymnasium.experimental.vector.utils.write_to_shared_memory
22+
```
23+
24+
## Miscellaneous
25+
26+
```{eval-rst}
27+
.. autofunction:: gymnasium.experimental.vector.utils.CloudpickleWrapper
28+
.. autofunction:: gymnasium.experimental.vector.utils.clear_mpi_env_vars
29+
```

Diff for: docs/api/experimental/vector_wrappers.md

+24
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,36 @@ title: Vector Wrappers
44

55
# Vector Environment Wrappers
66

7+
```{eval-rst}
8+
.. autoclass:: gymnasium.experimental.vector.VectorWrapper
9+
```
10+
711
## Vector Lambda Observation Wrappers
812

13+
```{eval-rst}
14+
.. autoclass:: gymnasium.experimental.vector.VectorObservationWrapper
15+
```
16+
917
## Vector Lambda Action Wrappers
1018

19+
```{eval-rst}
20+
.. autoclass:: gymnasium.experimental.vector.VectorActionWrapper
21+
```
22+
1123
## Vector Lambda Reward Wrappers
1224

25+
```{eval-rst}
26+
.. autoclass:: gymnasium.experimental.vector.VectorRewardWrapper
27+
```
28+
1329
## Vector Common Wrappers
1430

31+
```{eval-rst}
32+
.. autoclass:: gymnasium.experimental.wrappers.vector.VectorRecordEpisodeStatistics
33+
```
34+
1535
## Vector Only Wrappers
36+
37+
```{eval-rst}
38+
.. autoclass:: gymnasium.experimental.wrappers.vector.VectorListInfo
39+
```

Diff for: docs/api/experimental/wrappers.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
title: Wrappers
3+
---
4+
15
# Wrappers
26

37
## Observation Wrappers

Diff for: docs/api/registry.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ Gymnasium allows users to automatically load environments, pre-wrapped with seve
3535
.. autofunction:: gymnasium.envs.registration.parse_env_id
3636
.. autofunction:: gymnasium.envs.registration.find_highest_version
3737
.. autofunction:: gymnasium.envs.registration.namespace
38-
.. autofunction:: gymnasium.envs.registration.load_env
38+
.. autofunction:: gymnasium.envs.registration.load_env_creator
3939
.. autofunction:: gymnasium.envs.registration.load_plugin_envs
4040
```

Diff for: docs/release_notes/gym_v0.19.0.md renamed to docs/gym_release_notes/gym_v0.19.0.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Gym 0.19.0 is a large maintenance release, and the first since [@jkterry1](https
1515

1616
## Bug fixes
1717

18-
* Removed unused dependencies, removed unnescesary dependency version requirements that caused installation issues on newer machines, added full requirements.txt and moved general dependencies to extras. Notably, "toy_text" is not a used extra. atari-py is now pegged to a precise working version pending the switch to ale-py ([@jkterry1](https://github.com/jkterry1))
18+
* Removed unused dependencies, removed unnecessary dependency version requirements that caused installation issues on newer machines, added full requirements.txt and moved general dependencies to extras. Notably, "toy_text" is not a used extra. atari-py is now pegged to a precise working version pending the switch to ale-py ([@jkterry1](https://github.com/jkterry1))
1919
* Bug fixes to rewards in FrozenLake and FrozenLake8x8; versions bumped to v1 ([@ZhiqingXiao](https://github.com/ZhiqingXiao))
2020
* Removed remaining numpy depreciation warnings ([@super-pirata](https://github.com/super-pirata))
2121
* Fixes to video recording ([@mahiuchun](https://github.com/mahiuchun), [@zlig](https://github.com/zlig))
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: docs/gym_release_notes/index.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
layout: "contents"
3+
title: Gym Release Notes
4+
---
5+
6+
# Gym Release Notes
7+
8+
```{eval-rst}
9+
.. changelog::
10+
:github: https://github.com/openai/gym/releases
11+
:pypi: https://pypi.org/project/gym/
12+
:changelog-url:
13+
```

Diff for: docs/gymnasium_release_notes/index.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
layout: "contents"
3+
title: Gymnasium Release Notes
4+
---
5+
6+
# Gymnasium Release Notes
7+
8+
```{eval-rst}
9+
.. changelog::
10+
:github: https://github.com/Farama-Foundation/Gymnasium/releases
11+
:pypi: https://pypi.org/project/gymnasium/
12+
:changelog-url:
13+
```

Diff for: docs/index.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ lastpage:
66

77
# Gymnasium is a standard API for reinforcement learning, and a diverse collection of reference environments
88

9-
```{figure} _static/videos/box2d/lunar_lander_continuous.gif
9+
```{figure} _static/videos/box2d/lunar_lander.gif
1010
:alt: Lunar Lander
1111
:width: 500
1212
```
@@ -76,6 +76,7 @@ Comet Tutorial <https://www.comet.com/docs/v2/integrations/ml-frameworks/gymnasi
7676
:caption: Development
7777
7878
Github <https://github.com/Farama-Foundation/Gymnasium>
79-
release_notes/index
79+
gymnasium_release_notes/index
80+
gym_release_notes/index
8081
Contribute to the Docs <https://github.com/Farama-Foundation/Gymnasium/blob/main/docs/README.md>
8182
```

Diff for: docs/release_notes/index.md

-30
This file was deleted.

Diff for: gymnasium/experimental/vector/async_vector_env.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""An async vector environment."""
22
from __future__ import annotations
33

4-
import multiprocessing as mp
4+
import multiprocessing
55
import sys
66
import time
77
from copy import deepcopy
@@ -96,7 +96,7 @@ def __init__(
9696
"""
9797
super().__init__()
9898

99-
ctx = mp.get_context(context)
99+
ctx = multiprocessing.get_context(context)
100100
self.env_fns = env_fns
101101
self.num_envs = len(env_fns)
102102
self.shared_memory = shared_memory
@@ -238,7 +238,7 @@ def reset_wait(
238238

239239
if not self._poll(timeout):
240240
self._state = AsyncState.DEFAULT
241-
raise mp.TimeoutError(
241+
raise multiprocessing.TimeoutError(
242242
f"The call to `reset_wait` has timed out after {timeout} second(s)."
243243
)
244244

@@ -326,7 +326,7 @@ def step_wait(
326326

327327
if not self._poll(timeout):
328328
self._state = AsyncState.DEFAULT
329-
raise mp.TimeoutError(
329+
raise multiprocessing.TimeoutError(
330330
f"The call to `step_wait` has timed out after {timeout} second(s)."
331331
)
332332

@@ -421,7 +421,7 @@ def call_wait(self, timeout: int | float | None = None) -> list:
421421

422422
if not self._poll(timeout):
423423
self._state = AsyncState.DEFAULT
424-
raise mp.TimeoutError(
424+
raise multiprocessing.TimeoutError(
425425
f"The call to `call_wait` has timed out after {timeout} second(s)."
426426
)
427427

@@ -511,7 +511,7 @@ def close_extras(self, timeout: int | float | None = None, terminate: bool = Fal
511511
)
512512
function = getattr(self, f"{self._state.value}_wait")
513513
function(timeout)
514-
except mp.TimeoutError:
514+
except multiprocessing.TimeoutError:
515515
terminate = True
516516

517517
if terminate:

Diff for: gymnasium/experimental/vector/utils/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"iterate",
2323
"concatenate",
2424
"create_empty_array",
25-
"read_from_shared_memory",
2625
"create_shared_memory",
26+
"read_from_shared_memory",
2727
"write_to_shared_memory",
2828
"CloudpickleWrapper",
2929
"clear_mpi_env_vars",

0 commit comments

Comments
 (0)