Skip to content

Commit

Permalink
Update the documentation for v0.28 (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudo-rnd-thoughts authored Mar 25, 2023
1 parent 3d5c218 commit cab0fbb
Show file tree
Hide file tree
Showing 27 changed files with 115 additions and 57 deletions.
8 changes: 0 additions & 8 deletions docs/api/experimental.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,3 @@ We aimed to replace the wrappers in gymnasium v0.30.0 with these experimental wr
* :class:`experimental.wrappers.JaxToTorchV0`
* :class:`experimental.wrappers.NumpyToTorchV0`
```

## Vector Environment

These changes will be made in v0.28

## Wrappers for Vector Environments

These changes will be made in v0.28
8 changes: 4 additions & 4 deletions docs/api/experimental/functional.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ title: Functional
## gymnasium.experimental.func2env.FunctionalJaxCompatibilityEnv

```{eval-rst}
.. autoclass:: gymnasium.experimental.func_jax_env.FunctionalJaxEnv
.. autoclass:: gymnasium.experimental.functional_jax_env.FunctionalJaxEnv
.. autofunction:: gymnasium.experimental.func_jax_env.FunctionalJaxEnv.reset
.. autofunction:: gymnasium.experimental.func_jax_env.FunctionalJaxEnv.step
.. autofunction:: gymnasium.experimental.func_jax_env.FunctionalJaxEnv.render
.. autofunction:: gymnasium.experimental.functional_jax_env.FunctionalJaxEnv.reset
.. autofunction:: gymnasium.experimental.functional_jax_env.FunctionalJaxEnv.step
.. autofunction:: gymnasium.experimental.functional_jax_env.FunctionalJaxEnv.render
```
30 changes: 27 additions & 3 deletions docs/api/experimental/vector.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,34 @@ title: Vector

## gymnasium.experimental.VectorEnv

```{eval-rst}
.. autoclass:: gymnasium.experimental.vector.VectorEnv
.. autofunction:: gymnasium.experimental.vector.VectorEnv.reset
.. autofunction:: gymnasium.experimental.vector.VectorEnv.step
.. autofunction:: gymnasium.experimental.vector.VectorEnv.close
.. autofunction:: gymnasium.experimental.vector.VectorEnv.reset
```

## gymnasium.experimental.vector.AsyncVectorEnv

## gymnasium.experimental.vector.SyncVectorEnv
```{eval-rst}
.. autoclass:: gymnasium.experimental.vector.AsyncVectorEnv
.. autofunction:: gymnasium.experimental.vector.AsyncVectorEnv.reset
.. autofunction:: gymnasium.experimental.vector.AsyncVectorEnv.step
.. autofunction:: gymnasium.experimental.vector.AsyncVectorEnv.close
.. autofunction:: gymnasium.experimental.vector.AsyncVectorEnv.call
.. autofunction:: gymnasium.experimental.vector.AsyncVectorEnv.get_attr
.. autofunction:: gymnasium.experimental.vector.AsyncVectorEnv.set_attr
```

## Custom Vector environments
## gymnasium.experimental.vector.SyncVectorEnv

## EnvPool
```{eval-rst}
.. autoclass:: gymnasium.experimental.vector.SyncVectorEnv
.. autofunction:: gymnasium.experimental.vector.SyncVectorEnv.reset
.. autofunction:: gymnasium.experimental.vector.SyncVectorEnv.step
.. autofunction:: gymnasium.experimental.vector.SyncVectorEnv.close
.. autofunction:: gymnasium.experimental.vector.SyncVectorEnv.call
.. autofunction:: gymnasium.experimental.vector.SyncVectorEnv.get_attr
.. autofunction:: gymnasium.experimental.vector.SyncVectorEnv.set_attr
```
19 changes: 18 additions & 1 deletion docs/api/experimental/vector_utils.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
---
title: Vector Utility functions
title: Vector Utility
---

# Utility functions for vectorisation

## Spaces utility functions

```{eval-rst}
.. autofunction:: gymnasium.experimental.vector.utils.batch_space
.. autofunction:: gymnasium.experimental.vector.utils.concatenate
.. autofunction:: gymnasium.experimental.vector.utils.iterate
.. autofunction:: gymnasium.experimental.vector.utils.create_empty_array
```

## Shared memory functions

```{eval-rst}
.. autofunction:: gymnasium.experimental.vector.utils.create_shared_memory
.. autofunction:: gymnasium.experimental.vector.utils.read_from_shared_memory
.. autofunction:: gymnasium.experimental.vector.utils.write_to_shared_memory
```

## Miscellaneous

```{eval-rst}
.. autofunction:: gymnasium.experimental.vector.utils.CloudpickleWrapper
.. autofunction:: gymnasium.experimental.vector.utils.clear_mpi_env_vars
```
24 changes: 24 additions & 0 deletions docs/api/experimental/vector_wrappers.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,36 @@ title: Vector Wrappers

# Vector Environment Wrappers

```{eval-rst}
.. autoclass:: gymnasium.experimental.vector.VectorWrapper
```

## Vector Lambda Observation Wrappers

```{eval-rst}
.. autoclass:: gymnasium.experimental.vector.VectorObservationWrapper
```

## Vector Lambda Action Wrappers

```{eval-rst}
.. autoclass:: gymnasium.experimental.vector.VectorActionWrapper
```

## Vector Lambda Reward Wrappers

```{eval-rst}
.. autoclass:: gymnasium.experimental.vector.VectorRewardWrapper
```

## Vector Common Wrappers

```{eval-rst}
.. autoclass:: gymnasium.experimental.wrappers.vector.VectorRecordEpisodeStatistics
```

## Vector Only Wrappers

```{eval-rst}
.. autoclass:: gymnasium.experimental.wrappers.vector.VectorListInfo
```
4 changes: 4 additions & 0 deletions docs/api/experimental/wrappers.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Wrappers
---

# Wrappers

## Observation Wrappers
Expand Down
2 changes: 1 addition & 1 deletion docs/api/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ Gymnasium allows users to automatically load environments, pre-wrapped with seve
.. autofunction:: gymnasium.envs.registration.parse_env_id
.. autofunction:: gymnasium.envs.registration.find_highest_version
.. autofunction:: gymnasium.envs.registration.namespace
.. autofunction:: gymnasium.envs.registration.load_env
.. autofunction:: gymnasium.envs.registration.load_env_creator
.. autofunction:: gymnasium.envs.registration.load_plugin_envs
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Gym 0.19.0 is a large maintenance release, and the first since [@jkterry1](https

## Bug fixes

* 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))
* 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))
* Bug fixes to rewards in FrozenLake and FrozenLake8x8; versions bumped to v1 ([@ZhiqingXiao](https://github.com/ZhiqingXiao))
* Removed remaining numpy depreciation warnings ([@super-pirata](https://github.com/super-pirata))
* Fixes to video recording ([@mahiuchun](https://github.com/mahiuchun), [@zlig](https://github.com/zlig))
Expand Down
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.
13 changes: 13 additions & 0 deletions docs/gym_release_notes/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
layout: "contents"
title: Gym Release Notes
---

# Gym Release Notes

```{eval-rst}
.. changelog::
:github: https://github.com/openai/gym/releases
:pypi: https://pypi.org/project/gym/
:changelog-url:
```
13 changes: 13 additions & 0 deletions docs/gymnasium_release_notes/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
layout: "contents"
title: Gymnasium Release Notes
---

# Gymnasium Release Notes

```{eval-rst}
.. changelog::
:github: https://github.com/Farama-Foundation/Gymnasium/releases
:pypi: https://pypi.org/project/gymnasium/
:changelog-url:
```
5 changes: 3 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ lastpage:

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

```{figure} _static/videos/box2d/lunar_lander_continuous.gif
```{figure} _static/videos/box2d/lunar_lander.gif
:alt: Lunar Lander
:width: 500
```
Expand Down Expand Up @@ -76,6 +76,7 @@ Comet Tutorial <https://www.comet.com/docs/v2/integrations/ml-frameworks/gymnasi
:caption: Development
Github <https://github.com/Farama-Foundation/Gymnasium>
release_notes/index
gymnasium_release_notes/index
gym_release_notes/index
Contribute to the Docs <https://github.com/Farama-Foundation/Gymnasium/blob/main/docs/README.md>
```
30 changes: 0 additions & 30 deletions docs/release_notes/index.md

This file was deleted.

12 changes: 6 additions & 6 deletions gymnasium/experimental/vector/async_vector_env.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""An async vector environment."""
from __future__ import annotations

import multiprocessing as mp
import multiprocessing
import sys
import time
from copy import deepcopy
Expand Down Expand Up @@ -96,7 +96,7 @@ def __init__(
"""
super().__init__()

ctx = mp.get_context(context)
ctx = multiprocessing.get_context(context)
self.env_fns = env_fns
self.num_envs = len(env_fns)
self.shared_memory = shared_memory
Expand Down Expand Up @@ -238,7 +238,7 @@ def reset_wait(

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

Expand Down Expand Up @@ -326,7 +326,7 @@ def step_wait(

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

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

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

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

if terminate:
Expand Down
2 changes: 1 addition & 1 deletion gymnasium/experimental/vector/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"iterate",
"concatenate",
"create_empty_array",
"read_from_shared_memory",
"create_shared_memory",
"read_from_shared_memory",
"write_to_shared_memory",
"CloudpickleWrapper",
"clear_mpi_env_vars",
Expand Down

0 comments on commit cab0fbb

Please sign in to comment.