-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from Armandpl/27-match-sim-timing-to-robot
27 match sim timing to robot
- Loading branch information
Showing
20 changed files
with
730 additions
and
217 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 |
---|---|---|
@@ -1,6 +1,87 @@ | ||
default_language_version: | ||
python: python3 | ||
|
||
repos: | ||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 3.7.9 | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.3.0 | ||
hooks: | ||
# list of supported hooks: https://pre-commit.com/hooks.html | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-docstring-first | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: detect-private-key | ||
- id: check-executables-have-shebangs | ||
- id: check-toml | ||
- id: check-case-conflict | ||
- id: check-added-large-files | ||
|
||
# python code formatting | ||
- repo: https://github.com/psf/black | ||
rev: 22.6.0 | ||
hooks: | ||
- id: black | ||
args: [--line-length, "99"] | ||
|
||
# python import sorting | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
args: ["--profile", "black", "--filter-files"] | ||
|
||
# python upgrading syntax to newer version | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v2.32.1 | ||
hooks: | ||
- id: flake8 | ||
- id: pyupgrade | ||
args: [--py38-plus] | ||
|
||
# python docstring formatting | ||
- repo: https://github.com/myint/docformatter | ||
rev: v1.4 | ||
hooks: | ||
- id: docformatter | ||
args: [--in-place, --wrap-summaries=99, --wrap-descriptions=99] | ||
|
||
# python check (PEP8), programming errors and code complexity | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 4.0.1 | ||
hooks: | ||
- id: flake8 | ||
args: | ||
[ | ||
"--extend-ignore", | ||
"E203,E402,E501,F401,F841", | ||
"--exclude", | ||
"logs/*,data/*", | ||
] | ||
|
||
# yaml formatting | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v2.7.1 | ||
hooks: | ||
- id: prettier | ||
types: [yaml] | ||
|
||
# # jupyter notebook cell output clearing | ||
# - repo: https://github.com/kynan/nbstripout | ||
# rev: 0.5.0 | ||
# hooks: | ||
# - id: nbstripout | ||
|
||
# # jupyter notebook linting | ||
# - repo: https://github.com/nbQA-dev/nbQA | ||
# rev: 1.4.0 | ||
# hooks: | ||
# - id: nbqa-black | ||
# args: ["--line-length=99"] | ||
# - id: nbqa-isort | ||
# args: ["--profile=black"] | ||
# - id: nbqa-flake8 | ||
# args: | ||
# [ | ||
# "--extend-ignore=E203,E402,E501,F401,F841", | ||
# "--exclude=logs/*,data/*", | ||
# ] |
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
from gym.envs.registration import register | ||
from gymnasium.envs.registration import register | ||
|
||
register( | ||
id='FurutaReal-v0', | ||
entry_point='furuta_gym.envs:FurutaReal', | ||
id="FurutaReal-v0", | ||
entry_point="furuta_gym.envs:FurutaReal", | ||
) | ||
register( | ||
id='FurutaSim-v0', | ||
entry_point='furuta_gym.envs:FurutaSim', | ||
id="FurutaSim-v0", | ||
entry_point="furuta_gym.envs:FurutaSim", | ||
) |
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,16 @@ | ||
import stable_baselines3 | ||
|
||
|
||
# wrapper class for stable-baselines3.SAC | ||
# TODO can we make one class for all algos? | ||
# check if they all have the train freq param | ||
# check if they have other tuple args | ||
# check if it would be cleaner for sb3 to accept list instead of tuple? | ||
# TODO also does having the sb3 import means i need sb3 when importing from everywhere else in the package? | ||
class SAC(stable_baselines3.SAC): | ||
def __init__(self, **kwargs): | ||
# sb3 expects tuple, omegaconf returns list | ||
# so we need to convert kwarg train_freq from tuple to list | ||
kwargs.update({"train_freq": tuple(kwargs["train_freq"])}) | ||
|
||
super().__init__(**kwargs) |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from furuta_gym.envs.furuta_base import FurutaBase # noqa F420 | ||
from furuta_gym.envs.furuta_real import FurutaReal # noqa F420 | ||
from furuta_gym.envs.furuta_sim import FurutaSim # noqa F420 | ||
# from furuta_gym.envs.furuta_base import FurutaBase # noqa F420 | ||
# from furuta_gym.envs.furuta_real import FurutaReal # noqa F420 | ||
# from furuta_gym.envs.furuta_sim import FurutaSim # noqa F420 |
Oops, something went wrong.