From c001b60282ee7c557486402c403ade40f4a3d8ec Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 28 Sep 2023 10:32:34 +0100 Subject: [PATCH] Split the live connection receivers between live and time ones --- spinn_gym/games/breakout/visualise_host.py | 4 ++-- spinn_gym/games/breakout/visualise_jupyter.py | 4 ++-- spinn_gym/games/breakout/visualiser/visualiser_subsamp.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spinn_gym/games/breakout/visualise_host.py b/spinn_gym/games/breakout/visualise_host.py index 30b12ce..a71c26c 100644 --- a/spinn_gym/games/breakout/visualise_host.py +++ b/spinn_gym/games/breakout/visualise_host.py @@ -79,14 +79,14 @@ def host_visualiser( live_pops=live_spikes_pops) vis.update() - vis_connection.add_receive_callback( + vis_connection.add_receive_time_callback( breakout.breakout_pop.label, functools.partial(handle_vis_spikes, vis=vis)) vis_connection.add_pause_stop_callback( breakout.breakout_pop.label, functools.partial(stop_visualiser, vis=vis)) for label in live_pop_labels: - vis_connection.add_receive_callback( + vis_connection.add_receive_time_callback( label, functools.partial(handle_live_spikes, vis=vis)) return vis diff --git a/spinn_gym/games/breakout/visualise_jupyter.py b/spinn_gym/games/breakout/visualise_jupyter.py index 0387c29..34e52f5 100644 --- a/spinn_gym/games/breakout/visualise_jupyter.py +++ b/spinn_gym/games/breakout/visualise_jupyter.py @@ -89,7 +89,7 @@ def jupyter_visualiser( vis.update() display_handle = display.display(plt.gcf(), display_id=True) - vis_connection.add_receive_callback( + vis_connection.add_receive_time_callback( breakout.breakout_pop.label, functools.partial(handle_vis_spikes, vis=vis)) vis_connection.add_pause_stop_callback( @@ -97,7 +97,7 @@ def jupyter_visualiser( functools.partial(stop_visualiser, vis=vis, display_handle=display_handle)) for label in live_pop_labels: - vis_connection.add_receive_callback( + vis_connection.add_receive_time_callback( label, functools.partial(handle_live_spikes, vis=vis)) vis_thread = threading.Thread(target=start_visualiser, diff --git a/spinn_gym/games/breakout/visualiser/visualiser_subsamp.py b/spinn_gym/games/breakout/visualiser/visualiser_subsamp.py index e97ffa8..7d22bf9 100644 --- a/spinn_gym/games/breakout/visualiser/visualiser_subsamp.py +++ b/spinn_gym/games/breakout/visualiser/visualiser_subsamp.py @@ -59,9 +59,9 @@ def __init__(self, key_input_connection, spike_output_connection, self.y_res = y_res # setup output spikes connection callbacks - self.spike_output_connection.add_receive_callback( + self.spike_output_connection.add_receive_time_callback( on_pop_name, self.receive_spikes) - self.spike_output_connection.add_receive_callback( + self.spike_output_connection.add_receive_time_callback( off_pop_name, self.receive_spikes) # setup neuron_ids list self.neuron_ids_on = []