Skip to content

Commit

Permalink
Merge branch 'master' into update-python-versions
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudo-rnd-thoughts committed Apr 11, 2024
2 parents 2df6427 + 3c5879f commit 3c744fc
Show file tree
Hide file tree
Showing 24 changed files with 673 additions and 194 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-docs-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: pip install .

- name: Generate Environments page
run: xvfb-run -a -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" python docs/_scripts/gen_docs_page.py
run: xvfb-run -a -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" python docs/_scripts/gen_env_docs.py

- name: Generate Environments page
run: xvfb-run -a -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" python docs/_scripts/gen_envs_display.py
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-docs-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: pip install .

- name: Generate Environments page
run: xvfb-run -a -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" python docs/_scripts/gen_docs_page.py
run: xvfb-run -a -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" python docs/_scripts/gen_env_docs.py

- name: Generate Environments page
run: xvfb-run -a -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" python docs/_scripts/gen_envs_display.py
Expand All @@ -44,7 +44,7 @@ jobs:
run: mv _build/404/index.html _build/404.html

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

- name: Remove .doctrees
run: rm -r _build/.doctrees
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/manual-build-docs-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: pip install .

- name: Generate Environments page
run: xvfb-run -a -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" python docs/_scripts/gen_docs_page.py
run: xvfb-run -a -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" python docs/_scripts/gen_env_docs.py

- name: Generate Environments page
run: xvfb-run -a -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" python docs/_scripts/gen_envs_display.py
Expand All @@ -55,7 +55,7 @@ jobs:
run: mv _build/404/index.html _build/404.html

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

- name: Remove .doctrees
run: rm -r _build/.doctrees
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
repos:
- repo: https://github.com/python/black
rev: 22.3.0
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
rev: v2.2.4
hooks:
- id: codespell
args:
- --skip=*.svg
# - --ignore-words-list=
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 6.0.0
hooks:
- id: flake8
args:
Expand All @@ -37,7 +37,7 @@ repos:
# - --convention=google
# additional_dependencies: ["toml"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.0
rev: v3.3.1
hooks:
- id: pyupgrade
args: ["--py37-plus"]
Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="https://raw.githubusercontent.com/Farama-Foundation/Miniworld/master/miniworld-text.png" width="500px"/>
</p>

Miniworld (formerly gym-miniworld) is currently under development to be made compliant with the standards of the Farama Foundation (https://farama.org/project_standards), and when complete this will be maintained long term.
Miniworld is being maintained by the Farama Foundation (https://farama.org/project_standards). See the [Project Roadmap](https://github.com/Farama-Foundation/Miniworld/issues/103) for details regarding the long-term plans.

[![Build Status](https://travis-ci.org/maximecb/gym-miniworld.svg?branch=master)](https://travis-ci.org/maximecb/gym-miniworld)

Expand Down Expand Up @@ -44,19 +44,6 @@ Limitations:
- Graphics are basic, nowhere near photorealism
- Physics are very basic, not sufficient for robot arms or manipulation

Please use this bibtex if you want to cite this repository in your publications:

```
@misc{gym_miniworld,
author = {Chevalier-Boisvert, Maxime},
title = {MiniWorld: Minimalistic 3D Environment for RL & Robotics Research},
year = {2018},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/maximecb/gym-miniworld}},
}
```

List of publications & submissions using MiniWorld (please open a pull request to add missing entries):
- [Decoupling Exploration and Exploitation for Meta-Reinforcement Learning without Sacrifices](https://arxiv.org/abs/2008.02790) (Stanford University, ICML 2021)
- [Rank the Episodes: A Simple Approach for Exploration in Procedurally-Generated Environments](https://openreview.net/forum?id=MtEE0CktZht) (Texas A&M University, Kuai Inc., ICLR 2021)
Expand Down Expand Up @@ -125,3 +112,16 @@ Alternatively, if this doesn't work, you can also try running MiniWorld with `xv
xvfb-run -a -s "-screen 0 1024x768x24 -ac +extension GLX +render -noreset" python3 your_script.py
```

# Citation

To cite this project please use:

```bibtex
@article{MinigridMiniworld23,
author = {Maxime Chevalier-Boisvert and Bolun Dai and Mark Towers and Rodrigo de Lazcano and Lucas Willems and Salem Lahlou and Suman Pal and Pablo Samuel Castro and Jordan Terry},
title = {Minigrid \& Miniworld: Modular \& Customizable Reinforcement Learning Environments for Goal-Oriented Tasks},
journal = {CoRR},
volume = {abs/2306.13831},
year = {2023},
}
```
25 changes: 19 additions & 6 deletions docs/_scripts/gen_docs_page.py → docs/_scripts/gen_env_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import gymnasium as gym

import miniworld
import miniworld # noqa: F401


# From python docs
Expand Down Expand Up @@ -33,11 +33,9 @@ def trim(docstring):
return "\n".join(trimmed)


LAYOUT = "env"

pattern = re.compile(r"(?<!^)(?=[A-Z])")

miniworld_env_ids = sorted(list(miniworld.envs.env_ids))
miniworld_env_ids = sorted(
[env_id for env_id in gym.envs.registry if "MiniWorld-" in env_id]
)

previous_env_name = None

Expand Down Expand Up @@ -67,6 +65,21 @@ def trim(docstring):
+ f" ../_static/environments/{env_name_snake_case}.jpg"
+ f" \n:width: 300px\n:alt: {env_name}\n```\n\n"
)

# Environment Attributes
env = env_spec.make()
action_space_table = env.action_space.__repr__().replace("\n", "")
observation_space_table = env.observation_space.__repr__().replace("\n", "")
env_attributes = f"""
| | |
|---|---|
| Action Space | `{re.sub(' +', ' ', action_space_table)}` |
| Observation Space | `{re.sub(' +', ' ', observation_space_table)}` |
| Reward Range | `{env.reward_range}` |
| Creation | `gymnasium.make("{env_spec.id}")` |
"""
res_env_md += f"{env_attributes}\n"

# Docstring
res_env_md += f"{docstring}\n"

Expand Down
9 changes: 6 additions & 3 deletions docs/_scripts/gen_envs_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import gymnasium as gym

import miniworld
import miniworld # noqa: F401


def create_grid_cell(env_id):
env_name = env_id.split("-")[-2]
return f"""
<a href="/environments/{env_name}">
<a href="/environments/{env_name.lower()}">
<div class="env-grid__cell">
<div class="cell__image-container">
<img src="/_static/environments/{env_name.lower()}.jpg">
Expand All @@ -33,7 +33,10 @@ def generate_page(env_list):


if __name__ == "__main__":
miniworld_env_ids = sorted(list(miniworld.envs.env_ids))
miniworld_env_ids = sorted(
[env_id for env_id in gym.envs.registry if "MiniWorld-" in env_id]
)

filtered_env_ids = []
previous_env_name = None

Expand Down
Binary file added docs/_static/img/miniworld-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
176 changes: 176 additions & 0 deletions docs/_static/img/miniworld-text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3c744fc

Please sign in to comment.