Skip to content

Commit

Permalink
More tidying up
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgait committed Jul 31, 2023
1 parent 2a11cac commit 08ed4e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
9 changes: 7 additions & 2 deletions spinn_gym/games/icub_vor_env/icub_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
16 changes: 0 additions & 16 deletions spinn_gym/games/icub_vor_env/icub_vor_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 08ed4e4

Please sign in to comment.