From f04e06fae25a7f828eb8dc59c759c15c7775e032 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 19:38:41 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- neodroid/entry_points/cli.py | 9 ++++++--- .../non_neodroidian_environments/blackjack.py | 1 + .../non_neodroidian_environments/multi_armed_bandit.py | 1 + neodroid/factories/configuration_reactions.py | 2 +- .../specifications/unity_specifications/motion.py | 3 ++- .../wrappers/curriculum_wrapper/curriculum_wrapper.py | 4 ++-- samples/experimental/observation_generator.py | 2 +- samples/gui_client/gui_components/reaction_box.py | 5 ++++- samples/gui_client/main.py | 2 +- 9 files changed, 19 insertions(+), 10 deletions(-) diff --git a/neodroid/entry_points/cli.py b/neodroid/entry_points/cli.py index 17eb43b2..8243d342 100644 --- a/neodroid/entry_points/cli.py +++ b/neodroid/entry_points/cli.py @@ -62,7 +62,8 @@ def run(self, env_name: str) -> None: @staticmethod def fetch(env_name: str) -> Path: """ - Fetches a remotely stored environment with the specified name to local storage""" + Fetches a remotely stored environment with the specified name to local storage + """ exe_path = download_environment( env_name, path_to_executables_directory=DEFAULT_ENVIRONMENTS_PATH ) @@ -71,7 +72,8 @@ def fetch(env_name: str) -> Path: def install(self, env_name: str) -> Path: """ - Fetches a remotely stored environment with the specified name to local storage""" + Fetches a remotely stored environment with the specified name to local storage + """ return self.fetch(env_name) @staticmethod @@ -85,7 +87,8 @@ def remove(env_name: str) -> None: def update(self, env_name: str) -> None: """ - Updates, fetches environment with the specified name again and replaces the previous version if present""" + Updates, fetches environment with the specified name again and replaces the previous version if present + """ if os.path.exists(DEFAULT_ENVIRONMENTS_PATH): self.remove(env_name) exe_path = self.fetch(env_name) diff --git a/neodroid/environments/python_environment/non_neodroidian_environments/blackjack.py b/neodroid/environments/python_environment/non_neodroidian_environments/blackjack.py index 465b4fe9..dd0800d2 100644 --- a/neodroid/environments/python_environment/non_neodroidian_environments/blackjack.py +++ b/neodroid/environments/python_environment/non_neodroidian_environments/blackjack.py @@ -31,6 +31,7 @@ ============================================================ """ + import random import numpy diff --git a/neodroid/environments/python_environment/non_neodroidian_environments/multi_armed_bandit.py b/neodroid/environments/python_environment/non_neodroidian_environments/multi_armed_bandit.py index 22ad5ac6..611e2b95 100644 --- a/neodroid/environments/python_environment/non_neodroidian_environments/multi_armed_bandit.py +++ b/neodroid/environments/python_environment/non_neodroidian_environments/multi_armed_bandit.py @@ -29,6 +29,7 @@ = Q(a;k) + 1/(k+1) * (R(a) - Q(a;k)) """ + import numpy from matplotlib import pyplot diff --git a/neodroid/factories/configuration_reactions.py b/neodroid/factories/configuration_reactions.py index b3c5dfec..a3351d52 100644 --- a/neodroid/factories/configuration_reactions.py +++ b/neodroid/factories/configuration_reactions.py @@ -21,7 +21,7 @@ def verify_configuration_reactions( *, input_reactions, - environment_descriptions + environment_descriptions, #: Mapping[str, EnvironmentDescription] ): """ diff --git a/neodroid/utilities/specifications/unity_specifications/motion.py b/neodroid/utilities/specifications/unity_specifications/motion.py index bf368e6e..e8f07f7a 100644 --- a/neodroid/utilities/specifications/unity_specifications/motion.py +++ b/neodroid/utilities/specifications/unity_specifications/motion.py @@ -15,7 +15,8 @@ def __init__(self, actor_name: str, actuator_name: str, strength: float): :param actor_name: :param actuator_name: - :param strength: Strength has a possible direction given by the sign of the float""" + :param strength: Strength has a possible direction given by the sign of the float + """ self._actor_name = actor_name self._actuator_name = actuator_name self._strength = strength diff --git a/neodroid/wrappers/curriculum_wrapper/curriculum_wrapper.py b/neodroid/wrappers/curriculum_wrapper/curriculum_wrapper.py index f470cd4f..3db26def 100644 --- a/neodroid/wrappers/curriculum_wrapper/curriculum_wrapper.py +++ b/neodroid/wrappers/curriculum_wrapper/curriculum_wrapper.py @@ -53,7 +53,7 @@ def generate_trajectory_from_configuration( configure_params = ReactionParameters( reset=True, terminable=False, - configure=True + configure=True, # ,episode_count=False ) @@ -63,7 +63,7 @@ def generate_trajectory_from_configuration( non_terminable_params = ReactionParameters( step=True, - terminable=False + terminable=False, # , # episode_count=False ) diff --git a/samples/experimental/observation_generator.py b/samples/experimental/observation_generator.py index e0e7549b..ed8e8488 100644 --- a/samples/experimental/observation_generator.py +++ b/samples/experimental/observation_generator.py @@ -21,7 +21,7 @@ def main(): connect_to_running=True ) as env: with tqdm(env, leave=False) as observation_session: - for (observation, reward, terminated, info) in observation_session: + for observation, reward, terminated, info in observation_session: frame_i += 1 if not diverged and frame_i != info.frame_number: diff --git a/samples/gui_client/gui_components/reaction_box.py b/samples/gui_client/gui_components/reaction_box.py index 3b5e2ed8..8ecebcba 100644 --- a/samples/gui_client/gui_components/reaction_box.py +++ b/samples/gui_client/gui_components/reaction_box.py @@ -48,7 +48,10 @@ def on_step_button(self, value): str(self.motor_1.motor_input.text), float(self.motor_1.motor_slider.value), ), - (str(self.motor_2.motor_input.text), float(self.motor_2.motor_slider.value)) + ( + str(self.motor_2.motor_input.text), + float(self.motor_2.motor_slider.value), + ), # (str(self.motor_3.motor_input.text), # float(self.motor_3.motor_slider.value)), # (str(self.motor_4.motor_input.text), diff --git a/samples/gui_client/main.py b/samples/gui_client/main.py index 26e9e6e7..bd025ff7 100644 --- a/samples/gui_client/main.py +++ b/samples/gui_client/main.py @@ -47,7 +47,7 @@ def update_callback(state): def on_step_callback(actor_name, slider_values): motions = [ Motion(str(actor_name), str(slider_values[0][0]), slider_values[0][1]), - Motion(str(actor_name), str(slider_values[1][0]), slider_values[1][1]) + Motion(str(actor_name), str(slider_values[1][0]), slider_values[1][1]), # Motion(str(actor_name), str(slider_values[2][0]), slider_values[2][1]), # Motion(str(actor_name), str(slider_values[3][0]), slider_values[3][1]) ]