From be5e3dde5c3f1d3fec82e247654508a6cd9d2ef7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 16:32:43 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- moderl/mode_rl.py | 1 - subtrees/mosvgpe/mosvgpe/mixture_of_experts.py | 1 + subtrees/simenvs/simenvs/point_mass/generate_dataset.py | 5 ++++- subtrees/simenvs/simenvs/quadcopter/quadcopter_2D_sim.py | 1 - subtrees/simenvs/simenvs/quadcopter/quadcopter_sim.py | 1 - .../simenvs/quadcopter/scenario-1/configs/env_config.toml | 2 +- .../quadcopter/scenario-1/generate_const_action_dataset.py | 5 ++++- .../simenvs/quadcopter/scenario-1/generate_dataset.py | 5 ++++- .../velocity_controlled_point_mass/generate_dataset.py | 5 ++++- .../simenvs/velocity_controlled_point_mass/point_mass_sim.py | 1 - .../scenario-10/env_config.toml | 2 +- .../scenario-2/env_config.toml | 2 +- .../scenario-3/env_config.toml | 2 +- .../scenario-4/env_config.toml | 2 +- .../scenario-5/env_config.toml | 2 +- .../scenario-6/env_config.toml | 2 +- .../scenario-7/env_config.toml | 2 +- .../scenario-8/env_config.toml | 2 +- .../scenario-9/env_config.toml | 2 +- 19 files changed, 27 insertions(+), 18 deletions(-) diff --git a/moderl/mode_rl.py b/moderl/mode_rl.py index b53ce331..ea4e0e90 100644 --- a/moderl/mode_rl.py +++ b/moderl/mode_rl.py @@ -32,7 +32,6 @@ def mode_rl_loop( ): converged = False while not converged: - opt_result = explorative_controller.optimise() X, Y = [], [] diff --git a/subtrees/mosvgpe/mosvgpe/mixture_of_experts.py b/subtrees/mosvgpe/mosvgpe/mixture_of_experts.py index c8d576a0..4594d3f5 100644 --- a/subtrees/mosvgpe/mosvgpe/mixture_of_experts.py +++ b/subtrees/mosvgpe/mosvgpe/mixture_of_experts.py @@ -22,6 +22,7 @@ logger = logging.getLogger(__name__) + # class MixtureOfExpertsBase(gpf.models.BayesianModel, abc.ABC): # class MixtureOfExpertsBase(tf.keras.Model, abc.ABC): class MixtureOfExpertsBase(tf.keras.Model, BayesianModel, abc.ABC): diff --git a/subtrees/simenvs/simenvs/point_mass/generate_dataset.py b/subtrees/simenvs/simenvs/point_mass/generate_dataset.py index 7a720204..f21cea86 100644 --- a/subtrees/simenvs/simenvs/point_mass/generate_dataset.py +++ b/subtrees/simenvs/simenvs/point_mass/generate_dataset.py @@ -49,7 +49,10 @@ def generate_point_mass_dataset( toml_env_config_file, gating_bitmap_filename=gating_bitmap_file ) - (state_action_inputs, delta_state_outputs,) = generate_transitions_dataset( + ( + state_action_inputs, + delta_state_outputs, + ) = generate_transitions_dataset( num_states=num_states, num_actions=num_actions, env=env, diff --git a/subtrees/simenvs/simenvs/quadcopter/quadcopter_2D_sim.py b/subtrees/simenvs/simenvs/quadcopter/quadcopter_2D_sim.py index 268c00bb..8c24801e 100644 --- a/subtrees/simenvs/simenvs/quadcopter/quadcopter_2D_sim.py +++ b/subtrees/simenvs/simenvs/quadcopter/quadcopter_2D_sim.py @@ -476,7 +476,6 @@ def policy(i): if __name__ == "__main__": - record_env() # test_Quadcopter3DEnv() # test_VelocityControlledQuadcopter2DEnv() diff --git a/subtrees/simenvs/simenvs/quadcopter/quadcopter_sim.py b/subtrees/simenvs/simenvs/quadcopter/quadcopter_sim.py index 55caf7aa..19533527 100644 --- a/subtrees/simenvs/simenvs/quadcopter/quadcopter_sim.py +++ b/subtrees/simenvs/simenvs/quadcopter/quadcopter_sim.py @@ -708,7 +708,6 @@ def policy(i): if __name__ == "__main__": - record_env() # test_Quadcopter3DEnv() # test_VelocityControlledQuadcopter2DEnv() diff --git a/subtrees/simenvs/simenvs/quadcopter/scenario-1/configs/env_config.toml b/subtrees/simenvs/simenvs/quadcopter/scenario-1/configs/env_config.toml index 16c2ebdc..578e9c59 100644 --- a/subtrees/simenvs/simenvs/quadcopter/scenario-1/configs/env_config.toml +++ b/subtrees/simenvs/simenvs/quadcopter/scenario-1/configs/env_config.toml @@ -3,7 +3,7 @@ gating_bitmap = "./bitmaps/gating_mask.bmp" # filename for gating bitmap # gating_bitmap = "../scenario-1/gating_mask.bmp" # filename for gating bitmap # lists are converted to 1D np.arrays and floats/ints are broadcast -# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) +# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) # state constraints min_state = [-3.0, -2.0] max_state = [3.0, 3.0] diff --git a/subtrees/simenvs/simenvs/quadcopter/scenario-1/generate_const_action_dataset.py b/subtrees/simenvs/simenvs/quadcopter/scenario-1/generate_const_action_dataset.py index ba7a0824..fd2f60b1 100644 --- a/subtrees/simenvs/simenvs/quadcopter/scenario-1/generate_const_action_dataset.py +++ b/subtrees/simenvs/simenvs/quadcopter/scenario-1/generate_const_action_dataset.py @@ -21,7 +21,10 @@ # configure environment from toml config file env = parse_toml_config_to_VelocityControlledQuadcopter2DEnv(toml_env_config_file) -(state_action_inputs, delta_state_outputs,) = generate_transitions_dataset_const_action( +( + state_action_inputs, + delta_state_outputs, +) = generate_transitions_dataset_const_action( action, num_states=num_states, env=env, omit_data_mask=omit_data_mask ) diff --git a/subtrees/simenvs/simenvs/quadcopter/scenario-1/generate_dataset.py b/subtrees/simenvs/simenvs/quadcopter/scenario-1/generate_dataset.py index a196abe0..af912980 100644 --- a/subtrees/simenvs/simenvs/quadcopter/scenario-1/generate_dataset.py +++ b/subtrees/simenvs/simenvs/quadcopter/scenario-1/generate_dataset.py @@ -16,7 +16,10 @@ # configure environment from toml config file env = parse_toml_config_to_VelocityControlledQuadcopter2DEnv(toml_env_config_file) -(state_action_inputs, delta_state_outputs,) = generate_transitions_dataset( +( + state_action_inputs, + delta_state_outputs, +) = generate_transitions_dataset( num_states=num_states, num_actions=num_actions, env=env, diff --git a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/generate_dataset.py b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/generate_dataset.py index 2d00263e..c39b2b88 100644 --- a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/generate_dataset.py +++ b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/generate_dataset.py @@ -50,7 +50,10 @@ def generate_point_mass_dataset( toml_env_config_file, gating_bitmap_filename=gating_bitmap_file ) - (state_action_inputs, delta_state_outputs,) = generate_transitions_dataset( + ( + state_action_inputs, + delta_state_outputs, + ) = generate_transitions_dataset( num_states=num_states, num_actions=num_actions, env=env, diff --git a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/point_mass_sim.py b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/point_mass_sim.py index 638e7e8b..edcbda5b 100644 --- a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/point_mass_sim.py +++ b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/point_mass_sim.py @@ -319,7 +319,6 @@ def test_tf_env(env): if __name__ == "__main__": - # test_Quadcopter3DEnv() # test_VelocityControlledQuadcopter2DEnv() diff --git a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-10/env_config.toml b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-10/env_config.toml index df9e8412..0d9e2d2c 100644 --- a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-10/env_config.toml +++ b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-10/env_config.toml @@ -3,7 +3,7 @@ gating_bitmap = "./bitmaps/gating_mask.bmp" # filename for gating bitmap # gating_bitmap = "../scenario-1/gating_mask.bmp" # filename for gating bitmap # lists are converted to 1D np.arrays and floats/ints are broadcast -# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) +# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) # state constraints min_state = [-3.0, -3.0] # min_state = [-3.0, -3.0] diff --git a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-2/env_config.toml b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-2/env_config.toml index 9bfefcfb..30af5b50 100644 --- a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-2/env_config.toml +++ b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-2/env_config.toml @@ -3,7 +3,7 @@ gating_bitmap = "./bitmaps/gating_mask.bmp" # filename for gating bitmap # gating_bitmap = "../scenario-1/gating_mask.bmp" # filename for gating bitmap # lists are converted to 1D np.arrays and floats/ints are broadcast -# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) +# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) # state constraints min_state = [-3.0, -2.0] max_state = [3.0, 3.0] diff --git a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-3/env_config.toml b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-3/env_config.toml index d69237d9..acf030bc 100644 --- a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-3/env_config.toml +++ b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-3/env_config.toml @@ -3,7 +3,7 @@ gating_bitmap = "./bitmaps/gating_mask.bmp" # filename for gating bitmap # gating_bitmap = "../scenario-1/gating_mask.bmp" # filename for gating bitmap # lists are converted to 1D np.arrays and floats/ints are broadcast -# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) +# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) # state constraints min_state = [-3.0, -2.0] max_state = [3.0, 3.0] diff --git a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-4/env_config.toml b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-4/env_config.toml index 5e2ab578..ad522d0d 100644 --- a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-4/env_config.toml +++ b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-4/env_config.toml @@ -3,7 +3,7 @@ gating_bitmap = "./bitmaps/gating_mask.bmp" # filename for gating bitmap # gating_bitmap = "../scenario-1/gating_mask.bmp" # filename for gating bitmap # lists are converted to 1D np.arrays and floats/ints are broadcast -# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) +# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) # state constraints min_state = [-3.0, -2.0] max_state = [3.0, 3.0] diff --git a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-5/env_config.toml b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-5/env_config.toml index c0c26213..5f8beb01 100644 --- a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-5/env_config.toml +++ b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-5/env_config.toml @@ -3,7 +3,7 @@ gating_bitmap = "./bitmaps/gating_mask.bmp" # filename for gating bitmap # gating_bitmap = "../scenario-1/gating_mask.bmp" # filename for gating bitmap # lists are converted to 1D np.arrays and floats/ints are broadcast -# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) +# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) # state constraints min_state = [-3.1, -3.0] # min_state = [-3.0, -3.0] diff --git a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-6/env_config.toml b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-6/env_config.toml index c1cce75f..165a9f45 100644 --- a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-6/env_config.toml +++ b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-6/env_config.toml @@ -3,7 +3,7 @@ gating_bitmap = "./bitmaps/gating_mask.bmp" # filename for gating bitmap # gating_bitmap = "../scenario-1/gating_mask.bmp" # filename for gating bitmap # lists are converted to 1D np.arrays and floats/ints are broadcast -# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) +# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) # state constraints min_state = [-3.0, -2.0] max_state = [3.0, 3.0] diff --git a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-7/env_config.toml b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-7/env_config.toml index 3231649d..d1487eb5 100644 --- a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-7/env_config.toml +++ b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-7/env_config.toml @@ -3,7 +3,7 @@ gating_bitmap = "./bitmaps/gating_mask.bmp" # filename for gating bitmap # gating_bitmap = "../scenario-1/gating_mask.bmp" # filename for gating bitmap # lists are converted to 1D np.arrays and floats/ints are broadcast -# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) +# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) # state constraints min_state = [-3.0, -3.0] max_state = [3.0, 3.0] diff --git a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-8/env_config.toml b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-8/env_config.toml index 6a49fd4e..a5746936 100644 --- a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-8/env_config.toml +++ b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-8/env_config.toml @@ -3,7 +3,7 @@ gating_bitmap = "./bitmaps/gating_mask.bmp" # filename for gating bitmap # gating_bitmap = "../scenario-1/gating_mask.bmp" # filename for gating bitmap # lists are converted to 1D np.arrays and floats/ints are broadcast -# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) +# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) # state constraints min_state = [-3.0, -3.0] max_state = [3.0, 3.0] diff --git a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-9/env_config.toml b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-9/env_config.toml index e0313037..661e3545 100644 --- a/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-9/env_config.toml +++ b/subtrees/simenvs/simenvs/velocity_controlled_point_mass/scenario-9/env_config.toml @@ -3,7 +3,7 @@ gating_bitmap = "./bitmaps/gating_mask.bmp" # filename for gating bitmap # gating_bitmap = "../scenario-1/gating_mask.bmp" # filename for gating bitmap # lists are converted to 1D np.arrays and floats/ints are broadcast -# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) +# e.g min_state = [-3.0, -2.0] is converted with np.array(min_state) # state constraints min_state = [-3.0, -3.0] max_state = [3.0, 3.0]