Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update pre-commit #246

Merged
merged 6 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
2 changes: 1 addition & 1 deletion .github/workflows/build-docs-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
with:
folder: _build
target-folder: main
clean: false
clean: false
2 changes: 1 addition & 1 deletion .github/workflows/build-docs-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ jobs:
folder: _build
clean-exclude: |
*.*.*/
main
main
1 change: 0 additions & 1 deletion .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', "3.12"]
steps:
- uses: actions/checkout@v2
- run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-build-docs-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ jobs:
folder: _build
clean-exclude: |
*.*.*/
main
main
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ vizdoom.ini
# docs
docs/envs/**/*.*
!docs/envs/**/index.md
_build/
_build/
57 changes: 39 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/python/black
rev: 22.3.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: black
- 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/codespell-project/codespell
rev: v2.1.0
rev: v2.3.0
hooks:
- id: codespell
exclude: .svg
args:
- --ignore-words-list=nd,reacher,thist,ths, arry
- repo: https://github.com/pycqa/flake8
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
Expand All @@ -21,16 +35,31 @@ repos:
- --max-line-length=456
- --show-source
- --statistics
- repo: https://github.com/asottile/pyupgrade
rev: v3.18.0
hooks:
- id: pyupgrade
args: ["--py38-plus"]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.32.0
- repo: https://github.com/python/black
rev: 24.10.0
hooks:
- id: pyupgrade
args: ["--py38-plus"]
- id: black
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
exclude: ^(tests/envs/hand)|(tests/test_envs.py)|(tests/__init__.py)|(tests/utils.py)|(tests/envs/__init__.py)|(docs)|(gymnasium_robotics/utils)|(gymnasium_robotics/envs/fetch)|(gymnasium_robotics/envs/shadow_dexterous_hand)|(gymnasium_robotics/envs/maze)|(gymnasium_robotics/envs/adroit_hand)|(gymnasium_robotics/envs/franka_kitchen)
args:
- --convention=google
- --add-ignore=D100
- --source
- --explain
additional_dependencies: ["tomli"]
- repo: local
hooks:
- id: pyright
Expand All @@ -42,11 +71,3 @@ repos:
additional_dependencies: ["[email protected]"]
args:
- --project=pyproject.toml
- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
exclude: ^(tests/envs/hand)|(tests/test_envs.py)|(tests/__init__.py)|(tests/utils.py)|(tests/envs/__init__.py)|(docs)|(gymnasium_robotics/utils)|(gymnasium_robotics/envs/fetch)|(gymnasium_robotics/envs/shadow_dexterous_hand)|(gymnasium_robotics/envs/maze)|(gymnasium_robotics/envs/adroit_hand)|(gymnasium_robotics/envs/franka_kitchen)
args:
- --convention=google
- --add-ignore=D100
2 changes: 0 additions & 2 deletions CODE_OF_CONDUCT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +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/>`_.


6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The documentation website is at [robotics.farama.org](https://robotics.farama.or

To install the Gymnasium-Robotics environments use `pip install gymnasium-robotics`

These environments also require the MuJoCo engine from Deepmind to be installed. Instructions to install the physics engine can be found at the [MuJoCo website](https://mujoco.org/) and the [MuJoCo Github repository](https://github.com/deepmind/mujoco).
These environments also require the MuJoCo engine from Deepmind to be installed. Instructions to install the physics engine can be found at the [MuJoCo website](https://mujoco.org/) and the [MuJoCo Github repository](https://github.com/deepmind/mujoco).

Note that the latest environment versions use the latest mujoco python bindings maintained by the MuJoCo team. If you wish to use the old versions of the environments that depend on [mujoco-py](https://github.com/openai/mujoco-py), please install this library with `pip install gymnasium-robotics[mujoco-py]`

Expand All @@ -28,7 +28,7 @@ We support and test for Linux and macOS. We will accept PRs related to Windows,

* [Fetch](https://robotics.farama.org/envs/fetch/) - A collection of environments with a 7-DoF robot arm that has to perform manipulation tasks such as Reach, Push, Slide or Pick and Place.
* [Shadow Dexterous Hand](https://robotics.farama.org/envs/shadow_dexterous_hand/) - A collection of environments with a 24-DoF anthropomorphic robotic hand that has to perform object manipulation tasks with a cube, egg-object, or pen. There are variations of these environments that also include data from 92 touch sensors in the observation space.
* [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) - A collection of multi agent factorizations of the [Gymnasium/MuJoCo](https://gymnasium.farama.org/environments/mujoco/) environments and a framework for factorizing robotic environments, uses the [pettingzoo.ParallelEnv](https://pettingzoo.farama.org/api/parallel/) API.
* [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) - A collection of multi agent factorizations of the [Gymnasium/MuJoCo](https://gymnasium.farama.org/environments/mujoco/) environments and a framework for factorizing robotic environments, uses the [pettingzoo.ParallelEnv](https://pettingzoo.farama.org/api/parallel/) API.

The [D4RL](https://github.com/Farama-Foundation/D4RL) environments are now available. These environments have been refactored and may not have the same action/observation spaces as the original, please read their documentation:

Expand Down Expand Up @@ -76,7 +76,7 @@ substitute_truncated = env.compute_truncated(obs["achieved_goal"], substitute_go
The `GoalEnv` class can also be used for custom environments.

## Project Maintainers
Main Contributors: [Rodrigo Perez-Vicente](https://github.com/rodrigodelazcano), [Kallinteris Andreas](https://github.com/Kallinteris-Andreas), [Jet Tai](https://github.com/jjshoots)
Main Contributors: [Rodrigo Perez-Vicente](https://github.com/rodrigodelazcano), [Kallinteris Andreas](https://github.com/Kallinteris-Andreas), [Jet Tai](https://github.com/jjshoots)

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

Expand Down
2 changes: 1 addition & 1 deletion docs/_static/css/env_pages.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
width: 240px;
margin: 12px auto;
display: block;
}
}
2 changes: 1 addition & 1 deletion docs/content/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ lastpage:

To install the Gymnasium-Robotics environments use `pip install gymnasium-robotics`

These environments also require the MuJoCo engine from Deepmind to be installed. Instructions to install the physics engine can be found at the [MuJoCo website](https://mujoco.org/) and the [MuJoCo Github repository](https://github.com/deepmind/mujoco).
These environments also require the MuJoCo engine from Deepmind to be installed. Instructions to install the physics engine can be found at the [MuJoCo website](https://mujoco.org/) and the [MuJoCo Github repository](https://github.com/deepmind/mujoco).

Note that the latest environment versions use the latest mujoco python bindings maintained by the MuJoCo team. If you wish to use the old versions of the environments that depend on [mujoco-py](https://github.com/openai/mujoco-py), please install this library with `pip install gymnasium-robotics[mujoco-py]`

Expand Down
2 changes: 1 addition & 1 deletion docs/content/multi-goal_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ The `GoalEnv` class can also be used for custom environments.
.. autofunction:: gymnasium_robotics.core.GoalEnv.compute_reward
.. autofunction:: gymnasium_robotics.core.GoalEnv.compute_terminated
.. autofunction:: gymnasium_robotics.core.GoalEnv.compute_truncated
```
```
4 changes: 2 additions & 2 deletions docs/envs/MaMuJoCo/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Here we are Factorizing the "[Boston Dynamics Spot with arm](https://bostondynam
We are using the robot model from [MuJoCo Menagerie](https://github.com/google-deepmind/mujoco_menagerie/tree/main/boston_dynamics_spot).

```{figure} figures/boston_dymanics_spot_arm.png
:name: Boston Dymanics Spot Arm factorization
:name: Boston Dynamics Spot Arm factorization
```

```python
Expand Down Expand Up @@ -179,7 +179,7 @@ env = mamujoco_v1.parallel_env(
xml_file="./mujoco_menagerie/boston_dynamics_spot/scene_arm.xml",
)
```
Of course, you also need to add new elements to the environment and define your task, to do something useful.
Of course, you also need to add new elements to the environment and define your task, to do something useful.



Expand Down
4 changes: 2 additions & 2 deletions docs/envs/MaMuJoCo/ma_ant.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lastpage:
<p align="center">
<img src="https://gymnasium.farama.org/_images/ant.gif" alt="ant" width="200"/>
</p>
</html>
</html>

This Environment is part of [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) environments. Please read that page first for general information.
The task is [Gymansium's MuJoCo/Ant](https://gymnasium.farama.org/environments/mujoco/ant/).
Expand Down Expand Up @@ -151,7 +151,7 @@ The environment is partitioned in 4 parts, with each part corresponding to a leg

## Observation Space
| Observation Categories ||
|-----------------------|------------------------------------------------------|
|-----------------------|------------------------------------------------------|
| Default `local_categories` | `[["qpos", "qvel"], ["qpos"]]` |
| Default `global_categories` | `("qpos", "qvel")` |
| Supported observation categories | `"qpos", "qvel", "cfrc_ext"` |
Expand Down
3 changes: 1 addition & 2 deletions docs/envs/MaMuJoCo/ma_coupled_half_cheetah.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ The environment is partitioned in 2 parts, one part corresponding to the first c
## Observation Space

| Observation Categories ||
|-----------------------|------------------------------------------------------|
|-----------------------|------------------------------------------------------|
| Default `local_categories` | `[["qpos", "qvel", "ten_J", "ten_length,ten_velocity"], ["qpos"]]` |
| Default `global_categories` | `("qpos", "qvel")` |
| Supported observation categories | `"qpos", "qvel", "ten_J", "ten_length,ten_velocity"` |
Expand Down Expand Up @@ -117,4 +117,3 @@ Changes from the original `MaMuJoCo` ([schroederdewitt/multiagent_mujoco](https:
- Added/Fixed Global observations (The Cheetahes's front tips: `rootx`s, `rooty`s, `rootz`s) not being observed.
- Improved node naming
- Changed action ordering to be same as [Gymnasium/MuJoCo/HalfCheetah](https://gymnasium.farama.org/environments/mujoco/half_cheetah/#action-space)

8 changes: 3 additions & 5 deletions docs/envs/MaMuJoCo/ma_half_cheetah.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lastpage:
<p align="center">
<img src="https://gymnasium.farama.org/_images/half_cheetah.gif" alt="Half Cheetah" width="200"/>
</p>
</html>
</html>

This Environment is part of [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) environments. Please read that page first for general information.
The task is [Gymansium's MuJoCo/Half Cheetah](https://gymnasium.farama.org/environments/mujoco/half_cheetah/).
Expand Down Expand Up @@ -42,7 +42,7 @@ If partitioning, is `None`, then the environment contains a single agent with th
| 4 | Torque applied on the front shin rotor | -1 | 1 | fshin | hinge | torque (N m) |
| 5 | Torque applied on the front foot rotor | -1 | 1 | ffoot | hinge | torque (N m) |

### if partitioning == "2x3": # front and back
### if partitioning == "2x3": # front and back
```{figure} figures/half_cheetah_2x3.png
:name: half_cheetah_2x3
```
Expand Down Expand Up @@ -113,7 +113,7 @@ The environment is partitioned in 6 parts, each part corresponding to a single j

## Observation Space
| Observation Categories ||
|-----------------------|------------------------------------------------------|
|-----------------------|------------------------------------------------------|
| Default `local_categories` | `[["qpos", "qvel"], ["qpos"]]` |
| Default `global_categories` | `("qpos", "qvel")` |
| Supported observation categories | `"qpos", "qvel"` |
Expand Down Expand Up @@ -144,5 +144,3 @@ All agent terminate and truncate at the same time, given the same conditions as
Changes from the original `MaMuJoCo` ([schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco)):
- Added/Fixed Global observations (The Cheetah's front tip: `rootx`, `rooty`, `rootz`) not being observed.
- Changed action ordering to be same as [Gymnasium/MuJoCo/HalfCheetah](https://gymnasium.farama.org/environments/mujoco/half_cheetah/#action-space)


4 changes: 2 additions & 2 deletions docs/envs/MaMuJoCo/ma_hopper.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lastpage:
<p align="center">
<img src="https://gymnasium.farama.org/_images/hopper.gif" alt="Hopper" width="200"/>
</p>
</html>
</html>

This Environment is part of [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) environments. Please read that page first for general information.
The task is [Gymansium's MuJoCo/Hopper](https://gymnasium.farama.org/environments/mujoco/hopper/).
Expand Down Expand Up @@ -73,7 +73,7 @@ The environment is partitioned in 3 parts, each part corresponding to a single j

## Observation Space
| Observation Categories ||
|-----------------------|------------------------------------------------------|
|-----------------------|------------------------------------------------------|
| Default `local_categories` | `[["qpos", "qvel"], ["qpos"]]` |
| Default `global_categories` | `("qpos", "qvel")` |
| Supported observation categories | `"qpos", "qvel"` |
Expand Down
5 changes: 2 additions & 3 deletions docs/envs/MaMuJoCo/ma_humanoid.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lastpage:
<p align="center">
<img src="https://gymnasium.farama.org/_images/humanoid.gif" alt="Humanoid" width="200"/>
</p>
</html>
</html>

This Environment is part of [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) environments. Please read that page first for general information.
The task is [Gymansium's MuJoCo/Humanoid](https://gymnasium.farama.org/environments/mujoco/humanoid/).
Expand Down Expand Up @@ -98,7 +98,7 @@ The environment is partitioned in 2 parts, one part corresponding to the upper b

## Observation Space
| Observation Categories ||
|-----------------------|------------------------------------------------------|
|-----------------------|------------------------------------------------------|
| Default `local_categories` | `[["qpos", "qvel", "cinert", "cvel", "qfrc_actuator", "cfrc_ext"], ["qpos"]]` |
| Default `global_categories` | `("qpos", "qvel", "cinert", "cvel", "qfrc_actuator", "cfrc_ext")` |
| Supported observation categories | `"qpos", "qvel", "cinert", "cvel", "qfrc_actuator", "cfrc_ext"` |
Expand Down Expand Up @@ -132,4 +132,3 @@ Changes from the original `MaMuJoCo` ([schroederdewitt/multiagent_mujoco](https:
- Fixed abdomen observations ordering.
- Added support for body observations (`cvel`, `cinert`, `cfrc_ext`)
- Changed action ordering to be same as [Gymnasium/MuJoCo/Humanoid](https://gymnasium.farama.org/environments/mujoco/humanoid/#action-space)

4 changes: 2 additions & 2 deletions docs/envs/MaMuJoCo/ma_humanoid_standup.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lastpage:
<p align="center">
<img src="https://gymnasium.farama.org/_images/humanoid_standup.gif" alt="Humanoid Standup" width="200"/>
</p>
</html>
</html>

This Environment is part of [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) environments. Please read that page first for general information.
The task is [Gymansium's MuJoCo/Humanoid Standup](https://gymnasium.farama.org/environments/mujoco/humanoid_standup/).
Expand Down Expand Up @@ -98,7 +98,7 @@ The environment is partitioned in 2 parts, one part corresponding to the upper b

## Observation Space
| Observation Categories ||
|-----------------------|------------------------------------------------------|
|-----------------------|------------------------------------------------------|
| Default `local_categories` | `[["qpos", "qvel", "cinert", "cvel", "qfrc_actuator", "cfrc_ext"], ["qpos"]]` |
| Default `global_categories` | `("qpos", "qvel", "cinert", "cvel", "qfrc_actuator", "cfrc_ext")` |
| Supported observation categories | `"qpos", "qvel", "cinert", "cvel", "qfrc_actuator", "cfrc_ext"` |
Expand Down
3 changes: 1 addition & 2 deletions docs/envs/MaMuJoCo/ma_multiagentswimmer.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The environment is partitioned in `${Number Of Agents}` parts, with each part co

## Observation Space
| Observation Categories ||
|-----------------------|------------------------------------------------------|
|-----------------------|------------------------------------------------------|
| Default `local_categories` | `[["qpos", "qvel"], ["qpos"]]` |
| Default `global_categories` | `("qpos", "qvel")` |
| Supported observation categories | `"qpos", "qvel"` |
Expand Down Expand Up @@ -78,4 +78,3 @@ All agent terminate and truncate at the same time, given the same conditions as
- Now uses the same `option.timestep` as `Gymansum/Swimmer` (0.01).
- Updated model to work with `mujoco>=3.0.0`.
* v0: Initial version release, uses [Gymnasium.MuJoCo-v4](https://gymnasium.farama.org/environments/mujoco/), and is a fork of the original MaMuJoCo [schroederdewitt/multiagent_mujoco](https://github.com/schroederdewitt/multiagent_mujoco).

4 changes: 2 additions & 2 deletions docs/envs/MaMuJoCo/ma_pusher.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lastpage:
<p align="center">
<img src="https://gymnasium.farama.org/_images/pusher.gif" alt="Pusher" width="200"/>
</p>
</html>
</html>

This Environment is part of [MaMuJoCo](https://robotics.farama.org/envs/MaMuJoCo/) environments. Please read that page first for general information.
The task is [Gymansium's MuJoCo/Pusher](https://gymnasium.farama.org/environments/mujoco/pusher/).
Expand Down Expand Up @@ -82,7 +82,7 @@ The environment is partitioned in 3 parts, one part corresponding to the shoulde

## Observation Space
| Observation Categories ||
|-----------------------|------------------------------------------------------|
|-----------------------|------------------------------------------------------|
| Default `local_categories` | `[["qpos", "qvel"], ["qpos"]]` |
| Default `global_categories` | `("qpos", "qvel")` |
| Supported observation categories | `"qpos", "qvel"` |
Expand Down
Loading
Loading