Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 29, 2024
1 parent 0c859ce commit 18f9e96
Show file tree
Hide file tree
Showing 27 changed files with 25 additions and 9 deletions.
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.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.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_research.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.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_research.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_research.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.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.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: 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.wrappers import WriterWrapper
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

0 comments on commit 18f9e96

Please sign in to comment.