Skip to content

Commit

Permalink
Fix doc build
Browse files Browse the repository at this point in the history
Signed-off-by: guillemdb <[email protected]>
  • Loading branch information
Guillemdb committed Sep 1, 2024
1 parent 9ba8f25 commit 79e7d4c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 66 deletions.
59 changes: 4 additions & 55 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ state = state.copy()
action = env.action_space.sample()

data = env.step(state=state, action=action)
new_state, observ, reward, end, info = data
new_state, observ, reward, end, truncated, info = data
```


Expand All @@ -52,7 +52,7 @@ states = [state.copy() for _ in range(10)]
actions = [env.action_space.sample() for _ in range(10)]

data = env.step_batch(states=states, actions=actions)
new_states, observs, rewards, ends, infos = data
new_states, observs, rewards, ends, truncateds, infos = data
```


Expand All @@ -68,62 +68,11 @@ states = [state.copy() for _ in range(10)]
actions = [env.action_space.sample() for _ in range(10)]

data = env.step_batch(states=states, actions=actions)
new_states, observs, rewards, ends, infos = data
new_states, observs, rewards, ends, truncateds, infos = data
```

## Installation
Plangym is tested on Ubuntu 20.04 and Ubuntu 21.04 for python versions 3.7 and 3.8.

Installing it with Python 3.6 will break AtariEnv, and RetroEnv does not support
python 3.9 yet.

### Installing from Pip
Assuming that the environment libraries that you want to use are already installed, you can
install plangym from pip running:
```bash
pip3 install plangym
```

### Installing from source
If you also want to install the environment libraries, first clone the repository:

```bash
git clone [email protected]:FragileTech/plangym.git
cd plangym
```

Install the system dependencies by running
```bash
sudo apt-get install -y --no-install-suggests --no-install-recommends libglfw3 libglew-dev libgl1-mesa-glx libosmesa6 xvfb swig
```

To install MuJoCo, run:
```bash
make install-mujoco
```

Finally, install the project requirements and plangym.
```bash
pip install -r requirements.txt
pip install .
```

## Roadmap

This is a summary of the incoming improvements to the project:
- **Improved documentation**:
* Adding specific tutorials for all the different types of supported environments.
* Adding a developer guide section for incorporating new environments to plangym.
* Improving the library docstrings with more examples and detailed information.
- **Better gym integration**:
* Registering all of plangym environments in gym under a namespace.
* Offering more control over how the states are passed to `step`, `reset` and `step_batch`.
* Allowing to return the states inside the info dictionary.
- **Adding new environments to plangym, such as**:
* Gym mujoco
* Gym robotics
* [Gym-pybullet-drones](https://github.com/utiasDSL/gym-pybullet-drones)
- **Support for rendering in notebooks that are running on headless machines**.
TODO: Meanwhile take a look at how we set up the repository in `.github/workflows/push.yaml`.

## License
Plangym is released under the [MIT](LICENSE) license.
Expand Down
37 changes: 27 additions & 10 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,21 @@ def __getattr__(cls, name):
"sphinx.ext.napoleon",
"sphinx.ext.autosectionlabel",
"sphinx.ext.autodoc.typehints",
"sphinx_book_theme",
"myst_nb",
# "myst_parser",
# "sphinx.ext.githubpages",
# "m2r",
"sphinxcontrib.mermaid",
"sphinx.ext.githubpages",
"sphinx_copybutton",
"sphinx_togglebutton",
]
suppress_warnings = ["image.nonlocal_uri"]
autodoc_typehints = "description"
autodoc_mock_imports = ["ray"]
# Autoapi settings
autoapi_type = "python"
autoapi_dirs = ["../../src/plangym"]
autoapi_add_toctree_entry = True
# Make use of custom templates
# autoapi_template_dir = "_autoapi_templates"
autoapi_template_dir = "_autoapi_templates"
exclude_patterns.append("_autoapi_templates/index.rst")

# Ignore sphinx-autoapi warnings on multiple target description
Expand Down Expand Up @@ -105,18 +106,34 @@ def __getattr__(cls, name):
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
html_title = ""
html_theme = "sphinx_book_theme"
# html_logo = "_static/logo-wide.svg"
# html_favicon = "_static/logo-square.svg"
html_theme_options = {
"github_url": "https://github.com/poolsideai/fragile",
"repository_url": "https://github.com/poolsideai/fragile",
"repository_branch": "gh-pages",
"home_page_in_toc": True,
"path_to_docs": "docs",
"show_navbar_depth": 1,
"use_edit_page_button": True,
"use_repository_button": True,
"use_download_button": True,
"launch_buttons": {
"binderhub_url": "https://mybinder.org",
"notebook_interface": "classic",
},
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

# myst_parser options
nb_execution_mode = "off"
myst_heading_anchors = 2
myst_number_code_blocks = ["python"]
# myst_update_mathjax = False
autosectionlabel_prefix_document = True
myst_enable_extensions = [
"amsmath",
"colon_fence",
Expand All @@ -132,4 +149,4 @@ def __getattr__(cls, name):


# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
todo_include_todos = True
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ docs = [
"sphinx_rtd_theme",
"jupyter-cache",
"sphinx-copybutton",
"sphinx-togglebutton",
"sphinxext-opengraph",
"sphinxcontrib-bibtex",
]
Expand All @@ -90,8 +91,10 @@ import-roms = { cmd = "python3 src/plangym/scripts/import_retro_roms.py" }
"test:parallel" = { cmd = "pytest -n auto -s -o log_cli=true -o log_cli_level=info tests", env-file = ".multicore.env" }
"test:singlecore" = { cmd = "pytest -s -o log_cli=true -o log_cli_level=info tests/control/test_classic_control.py", env-file = ".onecore.env" }
"test:doctest" = { cmd = "pytest --doctest-modules -n 0 -s -o log_cli=true -o log_cli_level=info src", env-file = ".multicore.env" }
"codecov:parallel" = { cmd = "pytest -n auto -s -o log_cli=true -o log_cli_level=info --cov=./ --cov-report=xml --cov-config=pyproject.toml tests", env-file = ".multicore.env" }
"codecov:parallel" = { cmd = "pytest -n auto -s -o log_cli=true -o log_cli_level=info --cov=./ --cov-report=xml:coverage_parallel.xml --cov-config=pyproject.toml tests", env-file = ".multicore.env" }
"codecov:singlecore" = { cmd = "pytest --doctest-modules -s -o log_cli=true -o log_cli_level=info --cov=./ --cov-report=xml --cov-config=pyproject.toml tests/control/test_classic_control.py", env-file = ".onecore.env" }
build-docs = { cmd = "sphinx-build -b html docs/source docs/build"}
serve-docs = { cmd = "python3 -m http.server --directory docs/build" }

[tool.ruff]
# Assume Python 3.10
Expand Down

0 comments on commit 79e7d4c

Please sign in to comment.