Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
delaschwein committed Jan 29, 2023
1 parent ca5ff86 commit eab4a16
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 18 deletions.
13 changes: 13 additions & 0 deletions docs/contents/atari.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
## Atari Environments


### Installation
```
pip install shimmy[atari]
```

### Usage
```python
import gymnasium as gym

env = gym.make("ALE/Pong-v5")
```

### Class Description
```{eval-rst}
.. autoclass:: shimmy.atari_env.AtariEnv
Expand Down
34 changes: 34 additions & 0 deletions docs/contents/dm_control.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
## DM Control (both single and multiagent environments)


### Installation
```
pip install shimmy[dm-control]
```

### Usage (Single agent)
```python
import gymnasium as gym

env = gym.make("dm_control/acrobot_swingup_sparse-v0")
```

### Usage (Multi agent)
```python
from dm_control.locomotion import soccer as dm_soccer
from shimmy.dm_control_multiagent_compatibility import (
DmControlMultiAgentCompatibilityV0,
)

walker_type = dm_soccer.WalkerType.BOXHEAD,

env = dm_soccer.load(
team_size=2,
time_limit=10.0,
disable_walker_contacts=False,
enable_field_box=True,
terminate_on_goal=False,
walker_type=walker_type,
)

env = DmControlMultiAgentCompatibilityV0(env)
```

### Class Description

```{eval-rst}
Expand Down
47 changes: 47 additions & 0 deletions docs/contents/dm_lab.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,52 @@
## DM Lab

### Installation

Courtesy to [Danijar Hafner](https://github.com/deepmind/lab/issues/242) for providing this install script.
```bash
#!/bin/sh
set -eu

# Dependencies
apt-get update && apt-get install -y \
build-essential curl freeglut3 gettext git libffi-dev libglu1-mesa \
libglu1-mesa-dev libjpeg-dev liblua5.1-0-dev libosmesa6-dev \
libsdl2-dev lua5.1 pkg-config python-setuptools python3-dev \
software-properties-common unzip zip zlib1g-dev g++
pip3 install numpy

# Bazel
apt-get install -y apt-transport-https curl gnupg
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
mv bazel.gpg /etc/apt/trusted.gpg.d/
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list
apt-get update && apt-get install -y bazel

# Build
git clone https://github.com/deepmind/lab.git
cd lab
echo 'build --cxxopt=-std=c++17' > .bazelrc
bazel build -c opt //python/pip_package:build_pip_package
./bazel-bin/python/pip_package/build_pip_package /tmp/dmlab_pkg
pip3 install --force-reinstall /tmp/dmlab_pkg/deepmind_lab-*.whl
cd ..
rm -rf lab
```

### Usage
```python
import deepmind_lab

from shimmy.dm_lab_compatibility import DmLabCompatibilityV0

observations = ["RGBD"]
config = {"width": "640", "height": "480", "botCount": "2"}
renderer = "hardware"

env = deepmind_lab.Lab("lt_chasm", observations, config=config, renderer=renderer)
env = DmLabCompatibilityV0(env)
```

### Class Description
```{eval-rst}
.. autoclass:: shimmy.dm_lab_compatibility.DmLabCompatibilityV0
Expand Down
12 changes: 12 additions & 0 deletions docs/contents/gym.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
## OpenAI Gym

### Installation
```
pip install shimmy[gym]
```

### Usage
```python
import gymnasium as gym

env = gym.make("GymV22CompatibilityV0", env_name="...")
```

### Class Description
```{eval-rst}
.. autoclass:: shimmy.openai_gym_compatibility.GymV26CompatibilityV0
Expand Down
14 changes: 14 additions & 0 deletions docs/contents/open_spiel.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
## OpenSpiel

### Installation
```
pip install shimmy[pettingzoo]
```

### Usage
```python
import pyspiel
from shimmy.openspiel_compatibility import OpenspielCompatibilityV0

env = pyspiel.load_game("2048")
env = OpenspielCompatibilityV0(game=env, render_mode=None)
```

### Class Description
```{eval-rst}
.. autoclass:: shimmy.openspiel_compatibility.OpenspielCompatibilityV0
Expand Down
36 changes: 18 additions & 18 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,17 @@ Out of the box, Shimmy doesn't install any of the dependencies required for the
To install them, you'll have to install the optional extras.
All single agent environments have registration under the Gymnasium API, while all multiagent environments must be wrapped using the corresponding compatibility wrappers.

penAI Gym
### For Developers and Testing Only
```
pip install shimmy[testing]
```

### To just install everything
```
pip install shimmy[all, testing]
```

### OpenAI Gym

#### Installation
```
Expand Down Expand Up @@ -84,6 +94,13 @@ env = gym.make("ALE/Pong-v5")
pip install shimmy[dm-control]
```

#### Usage (Single agent)
```python
import gymnasium as gym

env = gym.make("dm_control/acrobot_swingup_sparse-v0")
```

#### Usage (Multi agent)
```python
from dm_control.locomotion import soccer as dm_soccer
Expand All @@ -105,13 +122,6 @@ env = dm_soccer.load(
env = DmControlMultiAgentCompatibilityV0(env)
```

#### Usage (Single agent)
```python
import gymnasium as gym

env = gym.make("dm_control/acrobot_swingup_sparse-v0")
```

### DM Lab

#### Installation
Expand Down Expand Up @@ -161,16 +171,6 @@ env = deepmind_lab.Lab("lt_chasm", observations, config=config, renderer=rendere
env = DmLabCompatibilityV0(env)
```

### For Developers and Testing Only
```
pip install shimmy[testing]
```

### To just install everything
```
pip install shimmy[all, testing]
```

### OpenSpiel

#### Installation
Expand Down

0 comments on commit eab4a16

Please sign in to comment.