Skip to content

Commit

Permalink
Init website
Browse files Browse the repository at this point in the history
  • Loading branch information
ffelten committed Nov 3, 2023
1 parent 47b171b commit deb8fd6
Show file tree
Hide file tree
Showing 23 changed files with 800 additions and 2 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build-docs-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build main branch documentation website
on:
push:
branches: [main, feature/website]
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

- uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install docs requirements
run: pip install -r docs/requirements.txt

- name: Install project
run: pip install -e .[all]

- name: Build env docs
run: python docs/_scripts/gen_env_docs.py

- name: Build
run: sphinx-build -b dirhtml -v docs _build

- name: Move 404
run: mv _build/404/index.html _build/404.html

- name: Update 404 links
run: python docs/_scripts/move_404.py _build/404.html

- name: Remove .doctrees
run: rm -r _build/.doctrees

- name: Upload to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _build
target-folder: main
clean: false
59 changes: 59 additions & 0 deletions .github/workflows/build-docs-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Docs Versioning
on:
push:
tags:
- 'v?*.*.*'
permissions:
contents: write
jobs:
docs:
name: Generate Website for new version
runs-on: ubuntu-latest
env:
SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1

- name: Install docs requirements
run: pip install -r docs/requirements.txt

- name: Install project
run: pip install -e .[all]

- name: Build env docs
run: python docs/_scripts/gen_env_docs.py

- name: Build
run: sphinx-build -b dirhtml -v docs _build

- name: Move 404
run: mv _build/404/index.html _build/404.html

- name: Update 404 links
run: python docs/_scripts/move_404.py _build/404.html

- name: Remove .doctrees
run: rm -r _build/.doctrees

- name: Upload to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _build
target-folder: ${{steps.tag.outputs.tag}}
clean: false

- name: Upload to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _build
clean-exclude: |
*.*.*/
main
65 changes: 65 additions & 0 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This workflow will build and (if release) publish Python distributions to PyPI
# For more information see:
# - https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# - https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
#
# derived from https://github.com/Farama-Foundation/PettingZoo/blob/e230f4d80a5df3baf9bd905149f6d4e8ce22be31/.github/workflows/build-publish.yml
name: build-publish

on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]

jobs:
build-wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
python: 38
platform: manylinux_x86_64
- os: ubuntu-latest
python: 39
platform: manylinux_x86_64
- os: ubuntu-latest
python: 310
platform: manylinux_x86_64
- os: ubuntu-latest
python: 311
platform: manylinux_x86_64

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: python -m pip install --upgrade pip setuptools build
- name: Build sdist and wheels
run: python -m build
- name: Store wheels
uses: actions/upload-artifact@v2
with:
path: dist

publish:
runs-on: ubuntu-latest
needs:
- build-wheels
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Download dists
uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_MOGYM }}
71 changes: 71 additions & 0 deletions .github/workflows/manual-build-docs-version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Manual Docs Versioning
on:
workflow_dispatch:
inputs:
version:
description: 'Documentation version to create'
required: true
commit:
description: 'Commit used to build the Documentation version'
required: false
latest:
description: 'Latest version'
type: boolean

permissions:
contents: write
jobs:
docs:
name: Generate Website for new version
runs-on: ubuntu-latest
env:
SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
if: inputs.commit == ''

- uses: actions/checkout@v3
if: inputs.commit != ''
with:
ref: ${{ inputs.commit }}

- uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install docs requirements
run: pip install -r docs/requirements.txt

- name: Install project
run: pip install -e .[all]

- name: Build env docs
run: python docs/_scripts/gen_env_docs.py

- name: Build
run: sphinx-build -b dirhtml -v docs _build

- name: Move 404
run: mv _build/404/index.html _build/404.html

- name: Update 404 links
run: python docs/_scripts/move_404.py _build/404.html

- name: Remove .doctrees
run: rm -r _build/.doctrees

- name: Upload to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _build
target-folder: ${{ inputs.version }}
clean: false

- name: Upload to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
if: inputs.latest
with:
folder: _build
clean-exclude: |
*.*.*/
main
78 changes: 76 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,83 @@
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)


# momadm-bechmarks
Benchmarks for Multi-Objective Multi-Agent Decision Making
<!-- start elevator-pitch -->

TODO is an open source Python library for developing and comparing multi-objective multi-agent reinforcement learning algorithms by providing a standard API to communicate between learning algorithms and environments, as well as a standard set of environments compliant with that API. Essentially, the environments follow the standard [PettingZoo APIs](https://github.com/Farama-Foundation/PettingZoo), but return vectorized rewards as numpy arrays instead of scalar values.

The documentation website is at TODO, and we have a public discord server (which we also use to coordinate development work) that you can join here: https://discord.gg/bnJ6kubTg6.

<!-- end elevator-pitch -->

## Environments

TODO includes environments taken from the MOMARL literature, as well as multi-objective version of classical environments, such as SISL or Butterfly.
The full list of environments is available at TODO.

## Installation
<!-- start install -->

To install TODO, use:
```bash
pip install TODO
```

This does not include dependencies for all families of environments (some can be problematic to install on certain systems). You can install these dependencies for one family like `pip install "TODO"` or use `pip install "TODO[all]"` to install all dependencies.

<!-- end install -->

## API

<!-- start snippet-usage -->

As for PettingZoo, the TODO API models environments as simple Python `env` classes. Creating environment instances and interacting with them is very simple - here's an example using the "mosurround_v0" environment:

```python
import todo
import numpy as np

# It follows the original PettingZoo APIs ...
env = todo.envs.crazyrl.surround.surround_v0.parallel_env()

obs, info = env.reset()
# but vector_reward is a numpy array!
actions = {agent: env.action_spaces[agent].sample() for agent in env.agents}
next_obs, vector_reward, terminated, truncated, info = env.step(actions)

# Optionally, you can scalarize the reward function with the LinearReward wrapper to fall back to the original PZ API
env = todo.LinearReward(env, weight=np.array([0.8, 0.2, 0.2]))
```
For details on multi-objective multi-agent RL definitions, see [Multi-Objective Multi-Agent Decision Making: A Utility-based Analysis and Survey](https://arxiv.org/abs/1909.02964).

You can also check more examples in this colab notebook! TODO

<!-- end snippet-usage -->


## Environment Versioning

TODO keeps strict versioning for reproducibility reasons. All environments end in a suffix like "-v0". When changes are made to environments that might impact learning results, the number is increased by one to prevent potential confusion.

## Development Roadmap
We have a roadmap for future development available here: TODO.

## Project Maintainers

Project Managers: TODO

Maintenance for this project is also contributed by the broader Farama team: [farama.org/team](https://farama.org/team).

## Citing

<!-- start citation -->

If you use this repository in your research, please cite:

```bibtex
@inproceedings{TODO}
```

<!-- end citation -->

## Development

Expand Down
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
environments/**/*.md
environments/**/list.html
3 changes: 3 additions & 0 deletions docs/404.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 404 - Page Not Found

## The requested page could not be found.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help 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
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
Loading

0 comments on commit deb8fd6

Please sign in to comment.