From 30b6dac55b8bac3aca4048fda8d63235330f657d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 19:43:11 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../agents/numpy_agents/evolutionary/cma_agent_tf.py | 1 + .../agents/numpy_agents/evolutionary/get_rid/local_runner.py | 1 + neodroidagent/agents/numpy_agents/model_based/dyna_agent.py | 2 +- neodroidagent/common/memory/transitions/transitions.py | 3 ++- neodroidagent/entry_points/session_factory.py | 3 ++- .../exploration/intrinsic_signals/torch_isp/curiosity/icm.py | 3 ++- samples/curriculum/experimental/difficulty.py | 4 +++- 7 files changed, 12 insertions(+), 5 deletions(-) diff --git a/neodroidagent/agents/numpy_agents/evolutionary/cma_agent_tf.py b/neodroidagent/agents/numpy_agents/evolutionary/cma_agent_tf.py index cb27b0d2..ad4e2dc4 100644 --- a/neodroidagent/agents/numpy_agents/evolutionary/cma_agent_tf.py +++ b/neodroidagent/agents/numpy_agents/evolutionary/cma_agent_tf.py @@ -1,4 +1,5 @@ """Covariance Matrix Adaptation Evolution Strategy.""" + from typing import Sequence import numpy diff --git a/neodroidagent/agents/numpy_agents/evolutionary/get_rid/local_runner.py b/neodroidagent/agents/numpy_agents/evolutionary/get_rid/local_runner.py index d03f8e79..9fb49be4 100644 --- a/neodroidagent/agents/numpy_agents/evolutionary/get_rid/local_runner.py +++ b/neodroidagent/agents/numpy_agents/evolutionary/get_rid/local_runner.py @@ -1,4 +1,5 @@ """Provides algorithms with access to most of garage's features.""" + import copy import os import time diff --git a/neodroidagent/agents/numpy_agents/model_based/dyna_agent.py b/neodroidagent/agents/numpy_agents/model_based/dyna_agent.py index 3220447a..3145d8f8 100644 --- a/neodroidagent/agents/numpy_agents/model_based/dyna_agent.py +++ b/neodroidagent/agents/numpy_agents/model_based/dyna_agent.py @@ -363,7 +363,7 @@ def _simulate_behavior(self): pairs = env_model.state_action_pairs_leading_to_outcome(s_sim) # add predecessors to queue if their priority exceeds thresh - for (_s, _a) in pairs: + for _s, _a in pairs: self._update_queue(_s, _a) def _update(self, s, a): diff --git a/neodroidagent/common/memory/transitions/transitions.py b/neodroidagent/common/memory/transitions/transitions.py index a7f5d7da..c2e2f39c 100644 --- a/neodroidagent/common/memory/transitions/transitions.py +++ b/neodroidagent/common/memory/transitions/transitions.py @@ -88,7 +88,8 @@ def non_terminal_numerical(self): @dataclass class ValuedTransitionPoint(TransitionPoint): """ - __slots__=['state','action','successor_state','signal','terminal',"distribution","value_estimate"]""" + __slots__=['state','action','successor_state','signal','terminal',"distribution","value_estimate"] + """ __slots__ = TransitionPoint.__slots__ + ["distribution", "value_estimate"] state: Any diff --git a/neodroidagent/entry_points/session_factory.py b/neodroidagent/entry_points/session_factory.py index c9995d52..8897699c 100644 --- a/neodroidagent/entry_points/session_factory.py +++ b/neodroidagent/entry_points/session_factory.py @@ -37,7 +37,8 @@ def session_factory( ): r""" Entry point start a starting a training session with the functionality of parsing cmdline arguments and - confirming configuration to use before training and overwriting of default training configurations""" + confirming configuration to use before training and overwriting of default training configurations + """ if config is None: config = {} diff --git a/neodroidagent/utilities/exploration/intrinsic_signals/torch_isp/curiosity/icm.py b/neodroidagent/utilities/exploration/intrinsic_signals/torch_isp/curiosity/icm.py index c1b8de37..18768993 100644 --- a/neodroidagent/utilities/exploration/intrinsic_signals/torch_isp/curiosity/icm.py +++ b/neodroidagent/utilities/exploration/intrinsic_signals/torch_isp/curiosity/icm.py @@ -127,7 +127,8 @@ def __init__( :param signal_space: used for scaling the intrinsic reward returned by this module. Can be used to control how the fluctuation scale of the intrinsic signal :param weight: balances the importance between forward and inverse model - :param intrinsic_signal_factor: balances the importance between extrinsic and intrinsic signal.""" + :param intrinsic_signal_factor: balances the importance between extrinsic and intrinsic signal. + """ assert ( len(observation_space.shape) == 1 diff --git a/samples/curriculum/experimental/difficulty.py b/samples/curriculum/experimental/difficulty.py index ae5a8d67..88d48151 100644 --- a/samples/curriculum/experimental/difficulty.py +++ b/samples/curriculum/experimental/difficulty.py @@ -66,7 +66,9 @@ def color_sample(identifier): neodroid.Configuration( identifier + "ColorConfigurableG", numpy.random.sample() ), - neodroid.Configuration(identifier + "ColorConfigurableB", numpy.random.sample()) + neodroid.Configuration( + identifier + "ColorConfigurableB", numpy.random.sample() + ), # neodroid.Configuration(id+'ColorConfigurableA', # numpy.random.sample()), ]