-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(pu): add lightzero sphinx docs (#237)
* feature(pu): add lightzero sphinx docs * feature(pu): add .readthedocs.yaml * polish(pu): move .readthedocs.yaml to the root directory * polish(pu): polish sphinx requirements * polish(pu): polish recommonmark requirements * fix(pu): fix api_doc and use sphinx_rtd_theme * fix(pu): fix .readthedocs.yaml * fix(pu): fix .readthedocs.yaml * fix(pu): fix .readthedocs.yaml * fix(pu): fix conf.py * fix(pu): fix requirements-doc.txt * fix(pu): fix requirements-doc.txt * fix(pu): fix requirements-doc.txt * fix(pu): fix requirements-doc.txt * polish(pu): delete doc/zh_CN * polish(pu): polish conf.py * polish(pu): polish conf.py * polish(pu): polish deploy.yml for docs * fix(pu): Update GitHub Actions workflow and add .nojekyll file * polish(pu): polish deploy.yml for docs * polish(pu): polish deploy.yml for docs * polish(pu): polish deploy.yml for docs * polish(pu): polish deploy.yml for docs * polish(pu): polish deploy.yml for docs * polish(pu): polish deploy.yml for docs * polish(pu): polish documentation
- Loading branch information
1 parent
d2f5ba8
commit 230a4a5
Showing
68 changed files
with
947 additions
and
619 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Deploy Sphinx Docs to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev-doc | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade -r requirements-doc.txt | ||
pip install -e . | ||
pip install sphinx sphinx-rtd-theme recommonmark | ||
- name: Build the Sphinx documentation | ||
run: | | ||
cd docs/en | ||
make html | ||
cp ../../.nojekyll ./build/html/.nojekyll | ||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs/en/build/html |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Read the Docs configuration file for Sphinx projects | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the OS, Python version and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.9" | ||
# You can also specify other tool versions: | ||
# nodejs: "20" | ||
# rust: "1.70" | ||
# golang: "1.20" | ||
|
||
# Build documentation in the "docs/" directory with Sphinx | ||
sphinx: | ||
configuration: docs/en/source/conf.py | ||
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs | ||
# builder: "dirhtml" | ||
# Fail on all warnings to avoid broken references | ||
# fail_on_warning: true | ||
|
||
# Optionally build your docs in additional formats such as PDF and ePub | ||
formats: | ||
- epub | ||
- htmlzip | ||
|
||
# Optional but recommended, declare the Python requirements required | ||
# to build your documentation | ||
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html | ||
python: | ||
install: | ||
- requirements: requirements-doc.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
*.puml.eps | ||
*.puml.jpg | ||
*.puml.svg | ||
.DS_Store | ||
../build/ | ||
source/_build | ||
_build/ | ||
.vscode/ | ||
venv/ | ||
.idea/ | ||
src/pytorch-sphinx-theme/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Minimal makefile for Sphinx documentation | ||
DIAGRAMS_MK := diagrams.mk | ||
DIAGRAMS := $(MAKE) -f "${DIAGRAMS_MK}" | ||
|
||
# You can set these variables from the command line. | ||
SPHINXOPTS = | ||
SPHINXBUILD = sphinx-build | ||
SPHINXLIVE = sphinx-autobuild | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
# Build & clean the documentation | ||
diagrams: | ||
@$(DIAGRAMS) build | ||
html: diagrams | ||
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" ./source/**/*_zh.* $(SPHINXOPTS) $(O) -D master_doc=index_zh | ||
live: diagrams | ||
@$(SPHINXLIVE) "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
build: html | ||
clean: | ||
@$(DIAGRAMS) clean | ||
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help diagrams html build clean Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(DIAGRAMS) build | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Welcome to LightZero Docs | ||
|
||
[![Documentation Status](https://readthedocs.org/projects/lightzero-docs/badge/?version=latest)](https://lightzero-docs.readthedocs.io/en/latest/?badge=latest) | ||
|
||
[LightZero](https://arxiv.org/pdf/2310.08348.pdf) is a lightweight, efficient, and easy-to-understand open-source algorithm toolkit that combines Monte Carlo Tree Search (MCTS) and Deep Reinforcement Learning (RL). | ||
|
||
For those interested in customizing environments and algorithms, we provide relevant guides: | ||
|
||
- [Customize Environments](https://github.com/opendilab/LightZero/blob/main/docs/source/tutorials/envs/customize_envs.md) | ||
- [Customize Algorithms](https://github.com/opendilab/LightZero/blob/main/docs/source/tutorials/algos/customize_algos.md) | ||
- [How to Set Configuration Files?](https://github.com/opendilab/LightZero/blob/main/docs/source/tutorials/config/config.md) | ||
- [Logging and Monitoring System](https://github.com/opendilab/LightZero/blob/main/docs/source/tutorials/logs/logs.md) | ||
|
||
Should you have any questions, feel free to contact us for support. | ||
|
||
|
||
# Local Docs Generation | ||
```bash | ||
# step 1: install | ||
cd LightZero | ||
pip install -r requirements-doc.txt | ||
# step 2: compile docs | ||
cd LightZero/docs/en/source | ||
make live | ||
# step 3: open http://127.0.0.1:8000 in your browser, and explore it! | ||
``` | ||
|
||
# Citing LightZero-docs | ||
```latex | ||
@misc{ding, | ||
title={{LightZero-docs:} A Unified Benchmark for Monte Carlo Tree Search in General Sequential Decision Scenarios}, | ||
author={LightZero-docs Contributors}, | ||
publisher = {GitHub}, | ||
howpublished = {\url{https://github.com/opendilab/LightZero-docs}}, | ||
year={2023}, | ||
} | ||
``` | ||
# Contact Us | ||
If you have any questions about documentation, please add a new issue or contact `opendilab@pjlab.org.cn` | ||
|
||
# License | ||
|
||
LightZero-Docs released under the Apache 2.0 license |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=build | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.http://sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.header-logo { | ||
background-image: url("../../../../LightZero.png"); | ||
background-size: 180px 40px; | ||
height: 40px; | ||
width: 180px; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{% extends "!layout.html" %} | ||
{% block extrahead %} | ||
<link href="{{ pathto("_static/css/style.css", True) }}" rel="stylesheet" type="text/css"> | ||
{% endblock %} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Agent | ||
========== | ||
|
||
.. autoclass:: lzero.agent.alphazero.AlphaZeroAgent | ||
:members: | ||
|
||
.. autoclass:: lzero.agent.muzero.MuZeroAgent | ||
:members: | ||
|
||
.. autoclass:: lzero.agent.efficientzero.EfficientZeroAgent | ||
:members: | ||
|
||
.. autoclass:: lzero.agent.gumbel_muzero.GumbelMuZeroAgent | ||
:members: | ||
|
||
.. autoclass:: lzero.agent.sampled_efficientzero.SampledEfficientZeroAgent | ||
:members: | ||
|
||
.. autoclass:: lzero.agent.sampled_alphazero.SampledAlphaZeroAgent | ||
:members: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Config | ||
===================== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
meta |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Entry | ||
============================== | ||
|
||
.. autoclass:: lzero.entry.train_alphazero.train_alphazero | ||
:members: | ||
|
||
.. autoclass:: lzero.entry.eval_alphazero.eval_alphazero | ||
:members: | ||
|
||
.. autoclass:: lzero.entry.train_muzero.train_muzero | ||
:members: | ||
|
||
.. autoclass:: lzero.entry.eval_muzero.eval_muzero | ||
:members: | ||
|
||
.. autoclass:: lzero.entry.train_muzero_with_gym_env.train_muzero_with_gym_env | ||
:members: | ||
|
||
.. autoclass:: lzero.entry.eval_muzero_with_gym_env.eval_muzero_with_gym_env | ||
:members: | ||
|
||
.. autoclass:: lzero.entry.train_muzero_with_reward_model.train_muzero_with_reward_model | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Envs | ||
========== | ||
|
||
.. autoclass:: lzero.envs.wrappers.lightzero_env_wrapper.LightZeroEnvWrapper | ||
:members: | ||
|
||
.. autoclass:: lzero.envs.wrappers.action_discretization_env_wrapper.ActionDiscretizationEnvWrapper | ||
:members: | ||
|
||
.. autoclass:: lzero.envs.get_wrappered_env.get_wrappered_env | ||
:members: |
Oops, something went wrong.