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

[pre-commit.ci] pre-commit autoupdate #371

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-docstring-first

- repo: https://github.com/psf/black
rev: 23.9.1
rev: 24.8.0
hooks:
- id: black

- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
rev: 1.18.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.1.0]

- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies: [flake8-docstrings]
Expand Down
1 change: 1 addition & 0 deletions examples/demo_agents/video_plot_a2c.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_a2c.jpg'

from rlberry_research.agents.torch import A2CAgent
Expand Down
1 change: 1 addition & 0 deletions examples/demo_agents/video_plot_mbqvi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_mbqvi.jpg'
from rlberry_scool.agents.mbqvi import MBQVIAgent
from rlberry_research.envs.finite import GridWorld
Expand Down
1 change: 1 addition & 0 deletions examples/demo_agents/video_plot_ppo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_a2c.jpg'

from rlberry_research.agents.torch import PPOAgent
Expand Down
1 change: 1 addition & 0 deletions examples/demo_agents/video_plot_rs_kernel_ucbvi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_rs_kernel_ucbvi.jpg'

from rlberry_research.envs import Acrobot
Expand Down
1 change: 1 addition & 0 deletions examples/demo_agents/video_plot_rsucbvi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_rsucbvi.jpg'

from rlberry_research.agents import RSUCBVIAgent
Expand Down
1 change: 1 addition & 0 deletions examples/demo_agents/video_plot_vi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_vi.jpg'

from rlberry_scool.agents.dynprog import ValueIterationAgent
Expand Down
1 change: 1 addition & 0 deletions examples/demo_bandits/plot_compare_index_bandits.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
This script Compare several bandits agents and as a sub-product also shows
how to use subplots in with `plot_writer_data`
"""

import numpy as np
import matplotlib.pyplot as plt
from rlberry_research.envs.bandits import BernoulliBandit
Expand Down
1 change: 1 addition & 0 deletions examples/demo_bandits/plot_mirror_bandit.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
The code is in three parts: definition of environment, definition of agent,
and finally definition of the experiment.
"""

import numpy as np

from rlberry.manager import ExperimentManager, read_writer_data
Expand Down
1 change: 1 addition & 0 deletions examples/demo_env/example_atari_atlantis_vectorized_ppo.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/example_plot_atari_atlantis_vectorized_ppo.jpg'


Expand Down
1 change: 1 addition & 0 deletions examples/demo_env/example_atari_breakout_vectorized_ppo.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/example_plot_atari_breakout_vectorized_ppo.jpg'


Expand Down
1 change: 1 addition & 0 deletions examples/demo_env/video_plot_acrobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_acrobot.jpg'

from rlberry_research.envs import Acrobot
Expand Down
1 change: 1 addition & 0 deletions examples/demo_env/video_plot_apple_gold.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_apple_gold.jpg'
from rlberry_research.envs.benchmarks.grid_exploration.apple_gold import AppleGold
from rlberry_scool.agents.dynprog import ValueIterationAgent
Expand Down
1 change: 1 addition & 0 deletions examples/demo_env/video_plot_atari_freeway.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_atari_freeway.jpg'


Expand Down
1 change: 1 addition & 0 deletions examples/demo_env/video_plot_chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_chain.jpg'


Expand Down
1 change: 1 addition & 0 deletions examples/demo_env/video_plot_gridworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
.. video:: ../../video_plot_gridworld.mp4
:width: 600
"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_gridworld.jpg'

from rlberry_scool.agents.dynprog import ValueIterationAgent
Expand Down
1 change: 1 addition & 0 deletions examples/demo_env/video_plot_mountain_car.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_montain_car.jpg'

from rlberry_scool.agents.mbqvi import MBQVIAgent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_old_gym_acrobot.jpg'


Expand Down
1 change: 1 addition & 0 deletions examples/demo_env/video_plot_pball.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_pball.jpg'

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions examples/demo_env/video_plot_rooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_rooms.jpg'

from rlberry_research.envs.benchmarks.grid_exploration.nroom import NRoom
Expand Down
1 change: 1 addition & 0 deletions examples/demo_env/video_plot_springcartpole.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_springcartpole.jpg'

from rlberry_research.envs.classic_control import SpringCartPole
Expand Down
1 change: 1 addition & 0 deletions examples/demo_env/video_plot_twinrooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:width: 600

"""

# sphinx_gallery_thumbnail_path = 'thumbnails/video_plot_twinrooms.jpg'

from rlberry_research.envs.benchmarks.generalization.twinrooms import TwinRooms
Expand Down
1 change: 0 additions & 1 deletion examples/example_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
and are only there to give the script's text.
"""


from rlberry.manager import with_venv, run_venv_xp


Expand Down
1 change: 1 addition & 0 deletions examples/plot_checkpointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
This is a minimal example of how to create checkpoints while training
your agents, and how to restore from a previous checkpoint.
"""

from rlberry.agents import Agent
from rlberry.manager import ExperimentManager
from rlberry.manager import plot_writer_data
Expand Down
1 change: 0 additions & 1 deletion examples/plot_writer_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
`rlberry.manager.plot_writer_data` documentation for more information.
"""


import numpy as np

from rlberry_scool.envs import GridWorld
Expand Down
1 change: 0 additions & 1 deletion rlberry/rendering/render_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Interface that allows 2D rendering.
"""


from abc import ABC, abstractmethod

from rlberry.rendering.opengl_render2d import OpenGLRender2D
Expand Down
1 change: 0 additions & 1 deletion rlberry/tests/test_agents_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

"""


import pytest
import numpy as np
import sys
Expand Down
5 changes: 1 addition & 4 deletions rlberry/wrappers/tests/old_env/old_acrobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,7 @@ def _dsdt(self, s_augmented, t):
# the following line is consistent with the java implementation
# and the book
ddtheta2 = (
a
+ d2 / d1 * phi1
- m2 * l1 * lc2 * dtheta1**2 * np.sin(theta2)
- phi2
a + d2 / d1 * phi1 - m2 * l1 * lc2 * dtheta1**2 * np.sin(theta2) - phi2
) / (m2 * lc2**2 + I2 - d2**2 / d1)
ddtheta1 = -(d2 * ddtheta2 + phi1) / d1
return (dtheta1, dtheta2, ddtheta1, ddtheta2, 0.0)
Expand Down
4 changes: 1 addition & 3 deletions rlberry/wrappers/tests/old_env/old_pendulum.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ def step(self, action):

action = np.clip(action, -self.max_torque, self.max_torque)[0]
self.last_action = action # for rendering
costs = (
angle_normalize(theta) ** 2 + 0.1 * thetadot**2 + 0.001 * (action**2)
)
costs = angle_normalize(theta) ** 2 + 0.1 * thetadot**2 + 0.001 * (action**2)

# compute the next state after action
newthetadot = (
Expand Down
1 change: 1 addition & 0 deletions scripts/fetch_contributors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
The table should be updated for each new inclusion in the teams.
Generating the table requires admin rights.
"""

import requests
import time
from pathlib import Path
Expand Down