From 08ed4e4b54307b5e933d8127d21c6d3d6fd8d7ea Mon Sep 17 00:00:00 2001 From: Andrew Gait Date: Mon, 31 Jul 2023 12:19:31 +0100 Subject: [PATCH] More tidying up --- spinn_gym/games/icub_vor_env/icub_utilities.py | 9 +++++++-- spinn_gym/games/icub_vor_env/icub_vor_env.py | 16 ---------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/spinn_gym/games/icub_vor_env/icub_utilities.py b/spinn_gym/games/icub_vor_env/icub_utilities.py index 658af3b..199ecfb 100644 --- a/spinn_gym/games/icub_vor_env/icub_utilities.py +++ b/spinn_gym/games/icub_vor_env/icub_utilities.py @@ -34,30 +34,35 @@ # Examples of get functions for variables def get_error(icub_vor_env_pop): + # pylint: disable=protected-access b_vertex = icub_vor_env_pop._vertex error = b_vertex.get_recorded_data('error') return error.tolist() def get_l_count(icub_vor_env_pop): + # pylint: disable=protected-access b_vertex = icub_vor_env_pop._vertex left_count = b_vertex.get_recorded_data('l_count') return left_count.tolist() def get_r_count(icub_vor_env_pop): + # pylint: disable=protected-access b_vertex = icub_vor_env_pop._vertex right_count = b_vertex.get_recorded_data('r_count') return right_count.tolist() def get_eye_pos(icub_vor_env_pop): + # pylint: disable=protected-access b_vertex = icub_vor_env_pop._vertex eye_positions = b_vertex.get_recorded_data('eye_pos') return eye_positions.tolist() def get_eye_vel(icub_vor_env_pop): + # pylint: disable=protected-access b_vertex = icub_vor_env_pop._vertex eye_velocities = b_vertex.get_recorded_data('eye_vel') return eye_velocities.tolist() @@ -230,7 +235,7 @@ def write_value(msg, value): print("{:60}:{:19}".format(msg, str(value))) -def save_figure(plt, name, extensions=(".png",), **kwargs): +def save_figure(plt_fig, name, extensions=(".png",), **kwargs): for ext in extensions: write_short_msg("Plotting", name + ext) - plt.savefig(name + ext, **kwargs) + plt_fig.savefig(name + ext, **kwargs) diff --git a/spinn_gym/games/icub_vor_env/icub_vor_env.py b/spinn_gym/games/icub_vor_env/icub_vor_env.py index 4942111..1798245 100644 --- a/spinn_gym/games/icub_vor_env/icub_vor_env.py +++ b/spinn_gym/games/icub_vor_env/icub_vor_env.py @@ -118,22 +118,6 @@ def __init__(self, head_pos, head_vel, perfect_eye_pos, perfect_eye_vel, # ------------------------------------------------------------------------ # Recording overrides # ------------------------------------------------------------------------ - # @overrides(SpinnGymApplicationVertex.clear_recording_data) - # def clear_recording_data(self, name): - # if name not in self.RECORDABLE_VARIABLES: - # raise KeyError(f"Cannot clear recording for {name}") - # for machine_vertex in self.machine_vertices: - # placement = SpynnakerDataView.get_placement_of_vertex( - # machine_vertex) - # buffer_manager = SpynnakerDataView.get_buffer_manager() - # buffer_manager.clear_recorded_data( - # placement.x, placement.y, placement.p, - # self.RECORDABLE_VARIABLES.index(name)) - # - # @overrides(SpinnGymApplicationVertex.get_recordable_variables) - # def get_recordable_variables(self): - # return self.RECORDABLE_VARIABLES - @overrides(SpinnGymApplicationVertex.get_recorded_data) def get_recorded_data(self, name): if self._m_vertex is None: