Skip to content

Commit

Permalink
Updated the doc to be compatible with gym1.0.0a1
Browse files Browse the repository at this point in the history
  • Loading branch information
ppasupat committed Feb 28, 2024
1 parent a51e22f commit d41edc4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/_scripts/gen_env_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import gymnasium as gym
import pandas as pd

import miniwob
from utils import extract_description_from_docstring, get_all_registered_miniwob_envs


gym.register_envs(miniwob)
gym.logger.set_level(gym.logger.DISABLED)

ENV_TYPES = [
Expand Down
2 changes: 2 additions & 0 deletions docs/_scripts/gen_mds.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

import gymnasium as gym

import miniwob
from utils import get_all_registered_miniwob_envs, trim_docstring


LAYOUT = "env"

gym.register_envs(miniwob)
gym.logger.set_level(gym.logger.DISABLED)


Expand Down
3 changes: 3 additions & 0 deletions docs/content/basic_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ The following code performs a deterministic action on the
```python
import time
import gymnasium
import miniwob
from miniwob.action import ActionTypes

gymnasium.register_envs(miniwob)

env = gymnasium.make('miniwob/click-test-2-v1', render_mode='human')

# Wrap the code in try-finally to ensure proper cleanup.
Expand Down
1 change: 1 addition & 0 deletions docs/content/custom_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ from miniwob.fields import field_lookup

# Import `custom_registry.py` above to register the task.
import custom_registry
gymnasium.register_envs(custom_registry)

# Create an environment.
env = gymnasium.make('miniwob/custom-v0', render_mode='human')
Expand Down
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Exploration](https://arxiv.org/abs/1802.08802).
The Gymnasium interface allows an agent to initialize and interact with a MiniWoB++ environment as follows:
```python
import gymnasium
import miniwob
gymnasium.register_envs(miniwob)
env = gymnasium.make('miniwob/click-test-2-v1', render_mode='human')
try:
observation, info = env.reset(seed=42)
Expand Down

0 comments on commit d41edc4

Please sign in to comment.