Skip to content
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

Add VectorizeMode for make_vec #765

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
97ac1eb
Remove deprecated features (#609)
pseudo-rnd-thoughts Jul 15, 2023
d4aa544
Merge experimental functional api into root (#610)
pseudo-rnd-thoughts Jul 16, 2023
68a6a25
Merge experimental vector into root (#613)
pseudo-rnd-thoughts Jul 17, 2023
e49cdc8
Merge experimental wrappers to root (#614)
pseudo-rnd-thoughts Jul 18, 2023
0d78c98
[WIP] Merge stateful observation tests to main tests suite (#623)
jjshoots Jul 22, 2023
d932fe9
Update vector docs (#624)
pseudo-rnd-thoughts Jul 24, 2023
b754b5d
Update all of the docs to v1.0.0 (#637)
pseudo-rnd-thoughts Jul 31, 2023
93f6448
ENH: Add NormalizeReward & NormalizeObservation vector wrappers (#632)
younik Aug 2, 2023
f159ab4
Remove `VectorWrapper.__getattr__` (#645)
pseudo-rnd-thoughts Aug 3, 2023
04a8548
Update docs 2 (#649)
pseudo-rnd-thoughts Aug 4, 2023
700ffd0
Automatically generate the list of wrappers using their first line in…
pseudo-rnd-thoughts Aug 5, 2023
a220735
Merge experimental wrappers tests into wrappers tests (#656)
pseudo-rnd-thoughts Aug 7, 2023
02b7d6d
Improve the normalize vector wrapper tests (#659)
pseudo-rnd-thoughts Aug 10, 2023
e98bbad
Reduce the number of CI warnings (#663)
pseudo-rnd-thoughts Aug 10, 2023
937177d
Update version to v1.0.0a1
pseudo-rnd-thoughts Aug 10, 2023
f686481
Add more examples to docs for wrappers (#657)
jjshoots Aug 21, 2023
24cc085
Rename `AsyncVectorEnv` or `SyncVectorEnv` attributes (#678)
pseudo-rnd-thoughts Aug 21, 2023
e3ec4b8
Remove wrapper version numbers (#665)
pseudo-rnd-thoughts Aug 21, 2023
0bc7f1e
Support `gym.make_vec(envs.spec)` (#679)
pseudo-rnd-thoughts Aug 21, 2023
dcd9ab9
Add `VectorEnv.render` function (#666)
pseudo-rnd-thoughts Aug 21, 2023
36a446b
Remove old testing code (#680)
pseudo-rnd-thoughts Aug 22, 2023
ff1128f
Add `Wrapper.set_wrapper_attr` and fix issue 357 (#681)
pseudo-rnd-thoughts Aug 22, 2023
d2efa7c
Change to release candidate from alpha
pseudo-rnd-thoughts Aug 22, 2023
76e8871
Improve the documentation (#688)
pseudo-rnd-thoughts Aug 26, 2023
c48cbd7
Fixed `VectorizeTransformAction` and `VectorizeTransformObservation` …
jjshoots Aug 26, 2023
65c62eb
Remove `Autoreset.spec`, add type hints to `TimeLimit`, correct type …
pseudo-rnd-thoughts Aug 28, 2023
80ef108
Add change logs to wrapper documentation (#696)
pseudo-rnd-thoughts Aug 29, 2023
f7f0363
Add dtype check to `Box.__eq__` and `MultiDiscrete.__eq__` (#707)
pseudo-rnd-thoughts Sep 5, 2023
0313eac
add examples for vector wrappers (#673)
jjshoots Sep 5, 2023
2af443f
Add `make(max_episode_steps=0)` to not apply a `TimeLimit` wrapper (#…
pseudo-rnd-thoughts Sep 8, 2023
ce01fd9
Update `make_vec(vectorization_mode)` to default to `None` and use `v…
pseudo-rnd-thoughts Sep 8, 2023
adcc405
Update `make_vec` to use `make` for `async` and `sync` (#711)
pseudo-rnd-thoughts Sep 8, 2023
16f3a4e
Option to save frames to disk in video recorder (#715)
rk1a Sep 20, 2023
6d492ea
Fix CI problems of #715 (#719)
rk1a Sep 20, 2023
00a62a0
Add VectorizeMode for `make_vec`
pseudo-rnd-thoughts Nov 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
name: Build main branch documentation website

on:
push:
branches: [main]

permissions:
contents: write

jobs:
docs:
name: Generate Website
runs-on: ubuntu-latest
env:
SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
--tag gymnasium-necessary-docker .
- name: Run tests
run: |
docker run gymnasium-necessary-docker pytest tests/test_core.py tests/envs/test_compatibility.py tests/envs/test_envs.py tests/spaces
docker run gymnasium-necessary-docker pytest tests/test_core.py tests/envs/test_envs.py tests/spaces
2 changes: 2 additions & 0 deletions .github/workflows/docs-manual-versioning.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Manual Docs Versioning

on:
workflow_dispatch:
inputs:
Expand All @@ -14,6 +15,7 @@ on:

permissions:
contents: write

jobs:
docs:
name: Generate Website for new version
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/docs-versioning.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Docs Versioning

on:
push:
tags:
- 'v?*.*.*'
-
permissions:
contents: write

jobs:
docs:
name: Generate Website for new version
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ repos:
rev: 6.3.0
hooks:
- id: pydocstyle
exclude: ^(gymnasium/envs/box2d)|(gymnasium/envs/classic_control)|(gymnasium/envs/mujoco)|(gymnasium/envs/toy_text)|(tests/envs)|(tests/spaces)|(tests/utils)|(tests/vector)|(tests/wrappers)|(docs/)
exclude: ^(gymnasium/envs/box2d)|(gymnasium/envs/classic_control)|(gymnasium/envs/mujoco)|(gymnasium/envs/toy_text)|(tests/envs)|(tests/spaces)|(tests/utils)|(tests/vector)|(docs/)
args:
- --source
- --explain
Expand Down
73 changes: 73 additions & 0 deletions docs/_scripts/gen_wrapper_table.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import os.path

import gymnasium as gym


exclude_wrappers = {"vector"}


def generate_wrappers():
wrapper_table = ""
for wrapper_name in sorted(gym.wrappers.__all__):
if wrapper_name not in exclude_wrappers:
wrapper_doc = getattr(gym.wrappers, wrapper_name).__doc__.split("\n")[0]
wrapper_table += f""" * - :class:`{wrapper_name}`
- {wrapper_doc}
"""
return wrapper_table


def generate_vector_wrappers():
unique_vector_wrappers = set(gym.wrappers.vector.__all__) - set(
gym.wrappers.__all__
)

vector_table = ""
for vector_name in sorted(unique_vector_wrappers):
vector_doc = getattr(gym.wrappers.vector, vector_name).__doc__.split("\n")[0]
vector_table += f""" * - :class:`{vector_name}`
- {vector_doc}
"""
return vector_table


if __name__ == "__main__":
gen_wrapper_table = generate_wrappers()
gen_vector_table = generate_vector_wrappers()

page = f"""
# List of Gymnasium Wrappers

Gymnasium provides a number of commonly used wrappers listed below. More information can be found on the particular
wrapper in the page on the wrapper type

```{{eval-rst}}
.. py:currentmodule:: gymnasium.wrappers

.. list-table::
:header-rows: 1

* - Name
- Description
{gen_wrapper_table}
```

## Vector only Wrappers

```{{eval-rst}}
.. py:currentmodule:: gymnasium.wrappers.vector

.. list-table::
:header-rows: 1

* - Name
- Description
{gen_vector_table}
```
"""

filename = os.path.join(
os.path.dirname(__file__), "..", "api", "wrappers", "table.md"
)
with open(filename, "w") as file:
file.write(page)
42 changes: 18 additions & 24 deletions docs/api/env.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
---
title: Utils
title: Env
---

# Env

## gymnasium.Env

```{eval-rst}
.. autoclass:: gymnasium.Env
```

### Methods

## Methods
```{eval-rst}
.. autofunction:: gymnasium.Env.step
.. autofunction:: gymnasium.Env.reset
.. autofunction:: gymnasium.Env.render
.. automethod:: gymnasium.Env.step
.. automethod:: gymnasium.Env.reset
.. automethod:: gymnasium.Env.render
.. automethod:: gymnasium.Env.close
```

### Attributes

## Attributes
```{eval-rst}
.. autoattribute:: gymnasium.Env.action_space

The Space object corresponding to valid actions, all valid actions should be contained with the space. For example, if the action space is of type `Discrete` and gives the value `Discrete(2)`, this means there are two valid discrete actions: 0 & 1.
The Space object corresponding to valid actions, all valid actions should be contained with the space. For example, if the action space is of type `Discrete` and gives the value `Discrete(2)`, this means there are two valid discrete actions: `0` & `1`.

.. code::

Expand Down Expand Up @@ -51,29 +48,26 @@ title: Utils

The render mode of the environment determined at initialisation

.. autoattribute:: gymnasium.Env.reward_range

A tuple corresponding to the minimum and maximum possible rewards for an agent over an episode. The default reward range is set to :math:`(-\infty,+\infty)`.

.. autoattribute:: gymnasium.Env.spec

The ``EnvSpec`` of the environment normally set during :py:meth:`gymnasium.make`
The :class:`EnvSpec` of the environment normally set during :py:meth:`gymnasium.make`

.. autoproperty:: gymnasium.Env.unwrapped
.. autoproperty:: gymnasium.Env.np_random
```

### Additional Methods
## Implementing environments

```{eval-rst}
.. autofunction:: gymnasium.Env.close
.. autoproperty:: gymnasium.Env.unwrapped
.. autoproperty:: gymnasium.Env.np_random
.. py:currentmodule:: gymnasium

When implementing an environment, the :meth:`Env.reset` and :meth:`Env.step` functions much be created describing the dynamics of the environment. For more information see the environment creation tutorial.
```

### Implementing environments
## Creating environments

```{eval-rst}
.. py:currentmodule:: gymnasium

When implementing an environment, the :meth:`Env.reset` and :meth:`Env.step` functions much be created describing the
dynamics of the environment.
For more information see the environment creation tutorial.
To create an environment, gymnasium provides :meth:`make` to initialise the environment along with several important wrappers. Furthermore, gymnasium provides :meth:`make_vec` for creating vector environments and to view all the environment that can be created use :meth:`pprint_registry`.
```
157 changes: 0 additions & 157 deletions docs/api/experimental.md

This file was deleted.

Loading
Loading