Skip to content

Commit

Permalink
Merge branch 'master' into babyai-text
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudo-rnd-thoughts authored Jan 13, 2025
2 parents cf73dd1 + f9398ba commit 1db4c78
Show file tree
Hide file tree
Showing 117 changed files with 294 additions and 250 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ Add any other context about the problem here.

### Checklist

- [ ] I have checked that there is no similar [issue](https://github.com/Farama-Foundation/MiniGrid/issues) in the repo (**required**)
- [ ] I have checked that there is no similar [issue](https://github.com/Farama-Foundation/MiniGrid/issues) in the repo (**required**)
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: "[Proposal] Proposal title"



### Proposal
### Proposal

A clear and concise description of the proposal.

Expand Down
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
# Look for GitHub Actions workflows in the `root` directory
directory: "/"
# Check the for updates once a week
schedule:
interval: "weekly"
File renamed without changes.
16 changes: 16 additions & 0 deletions .github/docker/py-old.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# A Dockerfile that sets up a full Gym install with test dependencies
ARG PYTHON_VERSION
FROM python:$PYTHON_VERSION

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

RUN apt-get -y update \
&& apt-get install --no-install-recommends -y \
xvfb

COPY ../.. /usr/local/minigrid/
WORKDIR /usr/local/minigrid/

RUN pip install .[wfc,testing] gymnasium==0.29.1 numpy==1.26.4

ENTRYPOINT ["/usr/local/minigrid/.github/docker/docker_entrypoint"]
9 changes: 3 additions & 6 deletions py.Dockerfile → .github/docker/py.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ RUN apt-get -y update \
&& apt-get install --no-install-recommends -y \
xvfb

COPY . /usr/local/minigrid/
COPY ../.. /usr/local/minigrid/
WORKDIR /usr/local/minigrid/

RUN pip install .[wfc,testing] --no-cache-dir

RUN ["chmod", "+x", "/usr/local/minigrid/docker_entrypoint"]

ENTRYPOINT ["/usr/local/minigrid/docker_entrypoint"]
RUN pip install .[wfc,testing]

ENTRYPOINT ["/usr/local/minigrid/.github/docker/docker_entrypoint"]
2 changes: 1 addition & 1 deletion .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ only: issues

# issues:
# exemptLabels:
# - confirmed
# - confirmed
6 changes: 3 additions & 3 deletions .github/workflows/build-docs-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
env:
SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

Expand Down Expand Up @@ -46,4 +46,4 @@ jobs:
with:
folder: _build
target-folder: main
clean: false
clean: false
6 changes: 3 additions & 3 deletions .github/workflows/build-docs-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
env:
SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

Expand Down Expand Up @@ -59,4 +59,4 @@ jobs:
folder: _build
clean-exclude: |
*.*.*/
main
main
22 changes: 0 additions & 22 deletions .github/workflows/build.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/manual-build-docs-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
env:
SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: inputs.commit == ''

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

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

Expand Down Expand Up @@ -71,4 +71,4 @@ jobs:
folder: _build
clean-exclude: |
*.*.*/
main
main
16 changes: 9 additions & 7 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# https://pre-commit.com
# This GitHub Action assumes that the repo contains a valid .pre-commit-config.yaml file.
name: pre-commit
on: [pull_request, push]
name: Run pre-commit
on:
pull_request:
push:
branches: [master]

permissions:
contents: read
contents: read # to fetch code (actions/checkout)

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- run: pip install pre-commit
- run: pre-commit --version
- run: pre-commit install
- run: pre-commit run --all-files
- run: pre-commit run --all-files
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
name: build-publish

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

Expand All @@ -21,26 +17,17 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
python-version: '3.10'
- name: Install pypa/build
run: >-
python -m
pip install -U
build
run: python -m pip install -U build
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
run: python -m build --sdist --wheel --outdir dist/ .
- name: Store wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: dist

Expand All @@ -51,7 +38,7 @@ jobs:
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Download dists
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: artifact
path: dist
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: build
on: [pull_request, push]

permissions:
contents: read

jobs:
build-latest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- run: |
docker build -f .github/docker/py.Dockerfile \
--build-arg PYTHON_VERSION=${{ matrix.python-version }} \
--tag minigrid-docker .
- name: Run tests
run: docker run minigrid-docker pytest
- name: Run doctest
run: docker run minigrid-docker pytest --doctest-modules minigrid/

build-old:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
docker build -f .github/docker/py-old.Dockerfile \
--build-arg PYTHON_VERSION="3.10" \
--tag minigrid-docker .
- name: Run tests
run: docker run minigrid-docker pytest
46 changes: 31 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-symlinks
- id: destroyed-symlinks
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-ast
- id: check-added-large-files
- id: check-merge-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: detect-private-key
- id: debug-statements
- repo: https://github.com/python/black
rev: 23.12.1
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
args:
- --ignore-words-list=linz
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
args:
Expand All @@ -36,18 +52,18 @@ repos:
# - --convention=google
# additional_dependencies: ["toml"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: ["--py37-plus"]
- repo: local
hooks:
- id: pyright
name: pyright
entry: pyright
language: node
pass_filenames: false
types: [python]
additional_dependencies: ["pyright"]
args:
- --project=pyproject.toml
# - repo: local
# hooks:
# - id: pyright
# name: pyright
# entry: pyright
# language: node
# pass_filenames: false
# types: [python]
# additional_dependencies: ["pyright@1.1.383"]
# args:
# - --project=pyproject.toml
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

1 change: 0 additions & 1 deletion CODE_OF_CONDUCT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,3 @@ Attribution
-----------
This Code of Conduct is adapted from `Python's Code of Conduct <https://www.python.org/psf/conduct/>`_, which is under a `Creative Commons License
<https://creativecommons.org/licenses/by-sa/3.0/>`_.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

<p align="center">
<img src="https://raw.githubusercontent.com/Farama-Foundation/Minigrid/master/minigrid-text.png" width="500px"/>
<a href = "https://minigrid.farama.org/" target = "_blank" > <img src="https://raw.githubusercontent.com/Farama-Foundation/Minigrid/master/minigrid-text.png" width="500px"/> </a>
</p>

<p align="center">
<img src="figures/door-key-curriculum.gif" width=200 alt="Figure Door Key Curriculum">
</p>

The Minigrid library contains a collection of discrete grid-world environments to conduct research on Reinforcement Learning. The environments follow the [Gymnasium](https://github.com/Farama-Foundation/Gymnasium) standard API and they are designed to be lightweight, fast, and easily customizable.
The Minigrid library contains a collection of discrete grid-world environments to conduct research on Reinforcement Learning. The environments follow the [Gymnasium](https://github.com/Farama-Foundation/Gymnasium) standard API and they are designed to be lightweight, fast, and easily customizable.

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

Expand All @@ -24,7 +24,7 @@ To install the Minigrid library use `pip install minigrid`.
We support Python 3.7, 3.8, 3.9, 3.10 and 3.11 on Linux and macOS. We will accept PRs related to Windows, but do not officially support it.

# Environments
The included environments can be divided in two groups. The original `Minigrid` environments and the `BabyAI` environments.
The included environments can be divided in two groups. The original `Minigrid` environments and the `BabyAI` environments.

## Minigrid
The list of the environments that were included in the original `Minigrid` library can be found in the [documentation](https://minigrid.farama.org/environments/minigrid/). These environments have in common a triangle-like agent with a discrete action space that has to navigate a 2D map with different obstacles (Walls, Lava, Dynamic obstacles) depending on the environment. The task to be accomplished is described by a `mission` string returned by the observation of the agent. These mission tasks include different goal-oriented and hierarchical missions such as picking up boxes, opening doors with keys or navigating a maze to reach a goal location. Each environment provides one or more configurations registered with Gymansium. Each environment is also programmatically tunable in terms of size/complexity, which is useful for curriculum learning or to fine-tune difficulty.
Expand All @@ -34,7 +34,7 @@ These environments have been imported from the [BabyAI](https://github.com/mila-
natural-looking instructions (e.g. “put the red ball next to the box on your left”) that command the the agent to navigate the world (including unlocking doors) and move objects to specified locations in order to accomplish the task.

# Training an Agent
The [rl-starter-files](https://github.com/lcswillems/torch-rl) is a repository with examples on how to train `Minigrid` environments with RL algorithms. This code has been tested and is known to work with this environment. The default hyper-parameters are also known to converge.
The [rl-starter-files](https://github.com/lcswillems/torch-rl) is a repository with examples on how to train `Minigrid` environments with RL algorithms. This code has been tested and is known to work with this environment. The default hyper-parameters are also known to converge.

# Citation

Expand Down
Loading

0 comments on commit 1db4c78

Please sign in to comment.