diff --git a/.gitignore b/.gitignore index 1bed9b3..248f617 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,7 @@ -application_generated_data_files/* -reports/* +*application_generated_data_files/ +*reports/ __pycache__/ .idea/ -spynnaker.cfg *.egg-info *.npz -*.out \ No newline at end of file +*.out diff --git a/requirements.txt b/requirements.txt index e87f664..1a96d17 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,9 @@ -numpy==1.15.4 -scipy==1.3.0 +numpy > 1.13, < 1.20; python_version == '3.6' +numpy > 1.13, < 1.21; python_version == '3.7' +numpy; python_version >= '3.8' +scipy >= 0.16.0, < 1.6; python_version == '3.6' +scipy >= 0.16.0, < 1.8; python_version == '3.7' +scipy >= 0.16.0; python_version >= '3.8' brian2 neo==0.7.1 pynn diff --git a/setup.py b/setup.py index 1d89c13..e316713 100644 --- a/setup.py +++ b/setup.py @@ -2,8 +2,12 @@ install_requires = [ - "numpy==1.15.4", - "scipy==1.3.0", + "numpy > 1.13, < 1.20; python_version == '3.6'", + "numpy > 1.13, < 1.21; python_version == '3.7'", + "numpy; python_version >= '3.8'", + "scipy >= 0.16.0, < 1.6; python_version == '3.6'", + "scipy >= 0.16.0, < 1.8; python_version == '3.7'", + "scipy >= 0.16.0; python_version >= '3.8'", "brian2", "neo==0.7.1", "pynn==0.9.5", @@ -38,7 +42,7 @@ "Programming Language :: Python :: 3" "Programming Language :: Python :: 3.7" - + "Topic :: Scientific/Engineering", ] ) diff --git a/spinncer/cerebellum.py b/spinncer/cerebellum.py index 80e060a..0b430ff 100644 --- a/spinncer/cerebellum.py +++ b/spinncer/cerebellum.py @@ -16,6 +16,9 @@ import numpy as np import h5py +from spynnaker.pyNN.extra_algorithms.splitter_components import ( + SplitterAbstractPopulationVertexNeuronsSynapses) + from spinncer.analysis_common import get_plot_order from spinncer.circuit import Circuit from spinncer.utilities.constants import * @@ -45,6 +48,9 @@ def __init__(self, sim, connectivity, stimulus_information, reporting=True, neuron_model="IF_cond_exp", force_number_of_neurons=None, input_spikes=None, rb_left_shifts=None, + use_split_model=False, + n_synapse_cores=1, + n_delay_slots=64, no_loops=3, round_input_spike_times=None, id_remap=None, @@ -78,6 +84,11 @@ def __init__(self, sim, connectivity, stimulus_information, reporting=True, self.id_remap = id_remap self.r_mem = r_mem + # Values for splitters + self.use_split_model = use_split_model + self.n_synapse_cores = n_synapse_cores + self.n_delay_slots = n_delay_slots + self.expected_max_spikes = expected_max_spikes self.implicit_shift = implicit_shift self.ensure_weight_is_representable = ensure_weight_is_representable @@ -475,6 +486,18 @@ def build_populations(self, positions): elif cell_model == "if_cond_alpha": cell_model = self.sim.IF_cond_alpha + # Add splitters everywhere except for SSP populations + if self.use_split_model: + if cell_name in ["granule", "golgi", "stellate", "basket", + "purkinjie", "dcn"]: + print("Cell {} model {} using split synapse neuron model " + "with {} synapse cores and {} delay slots".format( + cell_name, cell_model, self.n_synapse_cores, + self.n_delay_slots)) + additional_params["splitter"] = \ + SplitterAbstractPopulationVertexNeuronsSynapses( + self.n_synapse_cores, self.n_delay_slots, False) + # Adding the population to the network try: self.populations[cell_name] = self.sim.Population( diff --git a/spinncer/cerebellum_analysis.py b/spinncer/cerebellum_analysis.py index e8ce049..96d1c78 100644 --- a/spinncer/cerebellum_analysis.py +++ b/spinncer/cerebellum_analysis.py @@ -417,6 +417,8 @@ def spike_analysis(results_file, fig_folder, try: for pop in plot_order: curr_spikes = neo_all_spikes[pop].segments[0].spiketrains + print("pop, curr_spikes: ", pop, curr_spikes) + print("elephant, timestep, simtime", elephant_timestep, elephant_simtime) curr_inst_rates = \ elephant.statistics.instantaneous_rate( curr_spikes, @@ -437,6 +439,9 @@ def spike_analysis(results_file, fig_folder, except: traceback.print_exc() + print("elephant_instantaneous_rates: ", elephant_instantaneous_rates) + print("all_neurons: ", all_neurons) + stim_period_start = {} stim_period_end = {} per_pop_stim_durations = {k: [] for k in plot_order} @@ -465,6 +470,7 @@ def spike_analysis(results_file, fig_folder, # before, during and after stimulation _filtered_spike_rates = np.zeros(stimulus_periods) _spike_times = spikes[:, 1] + _spike_nids = spikes[:, 0] # Initialise per_neuron_firing per_neuron_firing[pop] = np.ones((all_neurons[pop], stimulus_periods)) * -10 @@ -498,7 +504,7 @@ def spike_analysis(results_file, fig_folder, np.count_nonzero(_filtered_spike_times) / \ (current_period_duration * ms) for nid in range(all_neurons[pop]): - _spikes_for_nid = spikes[spikes[:, 0] == nid][:, 1] + _spikes_for_nid = spikes[_spike_nids == nid][:, 1] _no_spike_for_nid = np.count_nonzero(np.logical_and( _spikes_for_nid >= time_filter_pre, _spikes_for_nid < time_filter_post)) @@ -712,8 +718,10 @@ def spike_analysis(results_file, fig_folder, print("Connection Name ") print("{:27} | {:10} | ".format("Connection Name", "Def. W"), "{:20}".format("SpiNN. W")) - sorted_keys = list(final_connectivity.keys()) - sorted_keys.sort() + sorted_keys = [] + if final_connectivity != []: + sorted_keys = list(final_connectivity.keys()) + sorted_keys.sort() for key in sorted_keys: conn = conn_dict[key] mean = np.abs(np.mean(conn[:, 2])) @@ -802,8 +810,8 @@ def spike_analysis(results_file, fig_folder, # Report statistics here for key, v in all_voltages.items(): nid, tstep = np.unravel_index(np.argmax(v, axis=None), v.shape) - print("{:20}-> neuron {:>8d} received {:>6d}".format( - key, int(nid), int(np.max(v))), + print("{:20}-> neuron {:>8d} received {:4.2f}".format( + key, int(nid), np.max(v)), "nA in timestep #{:8d}".format(int(tstep))) # THIS IS BROKEN! it will be removed soon # # Also treat voltage as if it's a piggybacked value packaging diff --git a/spinncer/cerebellum_experiment.py b/spinncer/cerebellum_experiment.py index 146b49d..a937ec6 100644 --- a/spinncer/cerebellum_experiment.py +++ b/spinncer/cerebellum_experiment.py @@ -12,11 +12,7 @@ # import simulator spinnaker_sim = False if str.lower(args.simulator) in ["spinnaker", "spynnaker"]: - try: - # this might be deprecated soon - import spynnaker8 as sim - except ImportError: - import pyNN.spynnaker as sim + import pyNN.spiNNaker as sim spinnaker_sim = True elif str.lower(args.simulator) in ["nest"]: import pyNN.nest as sim @@ -32,6 +28,7 @@ import pylab as plt import os import traceback +from spinncer.provenance_analysis import save_provenance_to_file_from_database # Record SCRIPT start time (wall clock) start_time = plt.datetime.datetime.now() @@ -137,6 +134,8 @@ expected_max_spikes = EXPECTED_MAX_SPIKES_200 canonical_rbls = RMEM_RBLS if args.r_mem else VANILLA_RBLS print("Canonical ring buffer left shifts:", canonical_rbls) +use_split_model = True +print("use_split_model is ", use_split_model) # Instantiate a Cerebellum cerebellum_circuit = Cerebellum( @@ -149,6 +148,9 @@ neuron_model=args.neuron_model, input_spikes=input_spikes, rb_left_shifts=canonical_rbls, + use_split_model=use_split_model, + n_synapse_cores=1, + n_delay_slots=64, no_loops=args.loops_grc, round_input_spike_times=round_spike_times, id_remap=args.id_remap, @@ -234,6 +236,9 @@ recorded_spikes = {} other_recordings = {} +# Store simulator name and run +sim_name = sim.name + # Record simulation start time (wall clock) sim_start_time = plt.datetime.datetime.now() current_error = None @@ -311,6 +316,11 @@ # Appropriately end the simulation sim.end() +# Get the provenance from the simulator's database +structured_provenance_filename = "structured_provenance.csv" +save_provenance_to_file_from_database( + structured_provenance_filename, sim_name) + # Analysis time! spike_analysis(results_file=results_file, fig_folder=args.figures_dir, worst_case=args.worst_case_spikes, delay_sensitive=True) diff --git a/spinncer/provenance_analysis.py b/spinncer/provenance_analysis.py index 1ac187b..5c61f50 100644 --- a/spinncer/provenance_analysis.py +++ b/spinncer/provenance_analysis.py @@ -1,10 +1,15 @@ import itertools +import pandas as pd from spinncer.analysis_common import * from os.path import join as join from numpy.polynomial.polynomial import Polynomial import traceback +from spinn_front_end_common.interface.provenance import ProvenanceReader + +from spynnaker.pyNN.data import SpynnakerDataView + def extract_per_pop_placements(df, pops): placement_results = {} @@ -56,6 +61,120 @@ def extract_per_pop_info(df, type_of_prov, pops, report=False): return pop_results +def save_provenance_to_file_from_database(in_file, sim_name): + # Here we need to get the provenance from the database and put it in + # the specified file + + # list provenance of interest + router_provenance_of_interest = [ + 'Dumped_from_a_Link', + 'Dumped_from_a_processor', + 'Local_Multicast_Packets', + 'External_Multicast_Packets', + 'Dropped_Multicast_Packets', + 'Missed_For_Reinjection' + ] + prov_of_interest = [ + 'Maximum number of spikes in a timer tick', + 'Times_synaptic_weights_have_saturated', + 'late_packets', + 'Times_the_input_buffer_lost_packets', + 'Times_the_timer_tic_over_ran', + 'Total_pre_synaptic_events', + 'Maximum number of DMAs in a timer tick', + 'Maximum pipeline restarts', + 'send_multicast_packets', + 'Maximum number of spikes flushed in a timer tick', + 'Total number of spikes flushed' + ] + + # Custom provenance presentation from SpiNNCer + # write provenance to file here in a useful way + columns = ['pop', 'label', 'min_atom', 'max_atom', 'no_atoms', + 'x', 'y', 'p', + 'prov_name', 'prov_value', + 'fixed_sdram', 'sdram_per_timestep'] + # assert (len(prov_placement) == len(prov_items)) + structured_provenance = list() + metadata = {} + # Retrieve filename from spynnaker8/spinnaker.py + provenance_filename = in_file + + if provenance_filename: + # Produce metadata from the simulator info + metadata['name'] = sim_name + metadata['no_machine_time_steps'] = \ + SpynnakerDataView.get_max_run_time_steps() + metadata['machine_time_step'] = \ + SpynnakerDataView.get_simulation_time_step_ms() + # metadata['config'] = simulator.config + metadata['machine'] = SpynnakerDataView.get_machine() + metadata['structured_provenance_filename'] = in_file + + pr = ProvenanceReader(os.path.join( + SpynnakerDataView().get_run_dir_path(), + "data.sqlite3")) + + cores_list = pr.get_cores_with_provenance() + + # router_provenance = pr.get_provenance_for_router(0, 0) + # print("router_provenance: ", router_provenance) + + # for i, (provenance, placement) in enumerate(zip(prov_items, prov_placement)): + for core in cores_list: + x = core[1] + y = core[2] + p = core[3] + structured_prov_core = get_provenance_for_core(pr, x, y, p) + + pop = structured_prov_core['pop'] + if pop == []: + continue + pop = pop[0][0] + fixed_sdram = structured_prov_core['fixed_sdram'][0][0] + sdram_per_timestep = structured_prov_core['sdram_per_timestep'][0][0] + + label = structured_prov_core['label'][0][0] + max_atom = structured_prov_core['max_atom'][0][0] + min_atom = structured_prov_core['min_atom'][0][0] + no_atoms = structured_prov_core['no_atoms'][0][0] + + for prov_name in prov_of_interest: + prov_value = get_core_provenance_value(pr, x, y, p, prov_name) + if prov_value == []: + prov_value = 0 + else: + prov_value = prov_value[0][0] + + structured_provenance.append( + [pop, label, min_atom, max_atom, no_atoms, + x, y, p, + prov_name, prov_value, + fixed_sdram, sdram_per_timestep] + ) + + for prov_name in router_provenance_of_interest: + prov_value = get_router_provenance_value(pr, x, y, prov_name) + if prov_value == []: + prov_value = 0 + else: + prov_value = prov_value[0][0] + + structured_provenance.append( + [pop, label, min_atom, max_atom, no_atoms, + x, y, p, + prov_name, prov_value, + fixed_sdram, sdram_per_timestep] + ) + + # print("structured provenance: ", structured_provenance) + + structured_provenance_df = pd.DataFrame.from_records( + structured_provenance, columns=columns) + + structured_provenance_df.to_csv("structured_provenance.csv") + + def provenance_csv_analysis(in_folder, fig_folder): write_header("Reading provenances in folder " + in_folder) prov = pd.read_csv(join(in_folder, "structured_provenance.csv")) @@ -88,6 +207,44 @@ def provenance_csv_analysis(in_folder, fig_folder): return results, types_of_provenance, prov_of_interest, placements +def get_provenance_for_core(pr, x, y, p): + structured_prov = {} + columns_to_get = ['pop', 'label', 'min_atom', 'max_atom', 'no_atoms', + 'fixed_sdram', 'sdram_per_timestep'] # add more as needed + + for column_to_get in columns_to_get: + query = """ + SELECT the_value + FROM core_provenance_view + WHERE x = ? AND y = ? AND p = ? AND description = ? + """ + # result = pr.run_query(query, [x, y, p, column_to_get]) + structured_prov[column_to_get] = pr.run_query( + query, [x, y, p, column_to_get]) + # print('x,y,p,desc: ', x, y, p, column_to_get, + # structured_prov[column_to_get]) + + return structured_prov + + +def get_core_provenance_value(pr, x, y, p, description): + query = """ + SELECT the_value + FROM core_provenance_view + WHERE x = ? AND y = ? AND p = ? AND description = ? + """ + return pr.run_query(query, [x, y, p, description]) + + +def get_router_provenance_value(pr, x, y, description): + query = """ + SELECT the_value + FROM router_provenance + WHERE x = ? AND y = ? AND description = ? + """ + return pr.run_query(query, [x, y, description]) + + def sweep_provenance_analysis(in_folder, fig_folder, group_on, group_on_name): # Check if the folders exist diff --git a/spinncer/single_cell_experiment.py b/spinncer/single_cell_experiment.py index ea60e20..acff06b 100644 --- a/spinncer/single_cell_experiment.py +++ b/spinncer/single_cell_experiment.py @@ -13,11 +13,7 @@ # import simulator spinnaker_sim = False if str.lower(args.simulator) in ["spinnaker", "spynnaker"]: - try: - # this might be deprecated soon - import spynnaker8 as sim - except ImportError: - import pyNN.spynnaker as sim + import pyNN.spiNNaker as sim spinnaker_sim = True elif str.lower(args.simulator) in ["nest"]: import pyNN.nest as sim @@ -92,7 +88,7 @@ weight_scaling=args.weight_scaling, neuron_model=args.neuron_model, input_spikes=input_spikes, - rb_left_shifts=args.rb_left_shifts + rb_left_shifts=args.rb_left_shifts, ) if args.generate_conversion_constants: diff --git a/spinncer/spynnaker.cfg b/spinncer/spynnaker.cfg new file mode 100644 index 0000000..d09bd77 --- /dev/null +++ b/spinncer/spynnaker.cfg @@ -0,0 +1,11 @@ +[Machine] +timeScaleFactor = 1000 + +[Simulation] +incoming_spike_buffer_size = 1024 + +[Mode] +violate_1ms_wall_clock_restriction = True + +#[Java] +#use_java = True diff --git a/spinncer/testing_granule_cells.py b/spinncer/testing_granule_cells.py index 6418da9..7bd2faf 100644 --- a/spinncer/testing_granule_cells.py +++ b/spinncer/testing_granule_cells.py @@ -16,11 +16,7 @@ spinnaker_sim = False if str.lower(args.simulator) in ["spinnaker", "spynnaker"]: - try: - # this might be deprecated soon - import spynnaker8 as sim - except ImportError: - import pyNN.spynnaker as sim + import pyNN.spiNNaker as sim spinnaker_sim = True elif str.lower(args.simulator) in ["nest"]: import pyNN.nest as sim diff --git a/tests/01_ms_tests/20_ms_test.py b/tests/01_ms_tests/20_ms_test.py index a6fd42c..74ee97b 100644 --- a/tests/01_ms_tests/20_ms_test.py +++ b/tests/01_ms_tests/20_ms_test.py @@ -1,11 +1,7 @@ """ This script tests whether delays are implemented correctly """ -try: - # this might be deprecated soon - import spynnaker8 as sim -except ImportError: - import pyNN.spynnaker as sim +import pyNN.spiNNaker as sim from pyNN.utility.plotting import Figure, Panel import matplotlib.pyplot as plt import numpy as np diff --git a/tests/01_ms_tests/6000_spikes_01_ms.py b/tests/01_ms_tests/6000_spikes_01_ms.py index 19e4647..ec0e61a 100644 --- a/tests/01_ms_tests/6000_spikes_01_ms.py +++ b/tests/01_ms_tests/6000_spikes_01_ms.py @@ -1,11 +1,7 @@ """ This script tests whether spike counting additional provenance is correct """ -try: - # this might be deprecated soon - import spynnaker8 as sim -except ImportError: - import pyNN.spynnaker as sim +import pyNN.spiNNaker as sim sim.setup(timestep=0.1, min_delay=0.1, max_delay=1) # Generate 6000 spikes (1 for each input neuron) diff --git a/tests/01_ms_tests/nest_testing_all_connections.py b/tests/01_ms_tests/nest_testing_all_connections.py index b468de5..94633b0 100644 --- a/tests/01_ms_tests/nest_testing_all_connections.py +++ b/tests/01_ms_tests/nest_testing_all_connections.py @@ -16,11 +16,7 @@ spinnaker_sim = False if str.lower(args.simulator) in ["spinnaker", "spynnaker"]: - try: - # this might be deprecated soon - import spynnaker8 as sim - except ImportError: - import pyNN.spynnaker as sim + import pyNN.spiNNaker as sim spinnaker_sim = True elif str.lower(args.simulator) in ["nest"]: import pyNN.nest as sim diff --git a/tests/01_ms_tests/test_long_delay_extension.py b/tests/01_ms_tests/test_long_delay_extension.py index 45a4941..61820d5 100644 --- a/tests/01_ms_tests/test_long_delay_extension.py +++ b/tests/01_ms_tests/test_long_delay_extension.py @@ -1,11 +1,7 @@ """ This script tests whether spike counting additional provenance is correct """ -try: - # this might be deprecated soon - import spynnaker8 as sim -except ImportError: - import pyNN.spynnaker as sim +import pyNN.spiNNaker as sim from pyNN.utility.plotting import Figure, Panel import matplotlib.pyplot as plt sim.setup(timestep=0.1, min_delay=0.1, max_delay=80) diff --git a/tests/01_ms_tests/testing_all_cells_dc.py b/tests/01_ms_tests/testing_all_cells_dc.py index f37716c..1ff6ef3 100644 --- a/tests/01_ms_tests/testing_all_cells_dc.py +++ b/tests/01_ms_tests/testing_all_cells_dc.py @@ -6,11 +6,7 @@ spinnaker_sim = False if str.lower(args.simulator) in ["spinnaker", "spynnaker"]: - try: - # this might be deprecated soon - import spynnaker8 as sim - except ImportError: - import pyNN.spynnaker as sim + import pyNN.spiNNaker as sim spinnaker_sim = True elif str.lower(args.simulator) in ["nest"]: import pyNN.nest as sim diff --git a/tests/01_ms_tests/testing_all_cells_single_spikes.py b/tests/01_ms_tests/testing_all_cells_single_spikes.py index f161e41..66ffcef 100644 --- a/tests/01_ms_tests/testing_all_cells_single_spikes.py +++ b/tests/01_ms_tests/testing_all_cells_single_spikes.py @@ -6,11 +6,7 @@ spinnaker_sim = False if str.lower(args.simulator) in ["spinnaker", "spynnaker"]: - try: - # this might be deprecated soon - import spynnaker8 as sim - except ImportError: - import pyNN.spynnaker as sim + import pyNN.spiNNaker as sim spinnaker_sim = True elif str.lower(args.simulator) in ["nest"]: import pyNN.nest as sim diff --git a/tests/01_ms_tests/testing_all_cells_spikes.py b/tests/01_ms_tests/testing_all_cells_spikes.py index 6245845..0acb9da 100644 --- a/tests/01_ms_tests/testing_all_cells_spikes.py +++ b/tests/01_ms_tests/testing_all_cells_spikes.py @@ -6,11 +6,7 @@ spinnaker_sim = False if str.lower(args.simulator) in ["spinnaker", "spynnaker"]: - try: - # this might be deprecated soon - import spynnaker8 as sim - except ImportError: - import pyNN.spynnaker as sim + import pyNN.spiNNaker as sim spinnaker_sim = True elif str.lower(args.simulator) in ["nest"]: import pyNN.nest as sim diff --git a/tests/01_ms_tests/testing_all_cells_spikes_realistic_conn.py b/tests/01_ms_tests/testing_all_cells_spikes_realistic_conn.py index fefbb45..417cbbb 100644 --- a/tests/01_ms_tests/testing_all_cells_spikes_realistic_conn.py +++ b/tests/01_ms_tests/testing_all_cells_spikes_realistic_conn.py @@ -6,11 +6,7 @@ spinnaker_sim = False if str.lower(args.simulator) in ["spinnaker", "spynnaker"]: - try: - # this might be deprecated soon - import spynnaker8 as sim - except ImportError: - import pyNN.spynnaker as sim + import pyNN.spiNNaker as sim spinnaker_sim = True elif str.lower(args.simulator) in ["nest"]: import pyNN.nest as sim diff --git a/tests/01_ms_tests/testing_all_connections.py b/tests/01_ms_tests/testing_all_connections.py index aa79bd4..2013f2d 100644 --- a/tests/01_ms_tests/testing_all_connections.py +++ b/tests/01_ms_tests/testing_all_connections.py @@ -16,11 +16,7 @@ spinnaker_sim = False if str.lower(args.simulator) in ["spinnaker", "spynnaker"]: - try: - # this might be deprecated soon - import spynnaker8 as sim - except ImportError: - import pyNN.spynnaker as sim + import pyNN.spiNNaker as sim spinnaker_sim = True elif str.lower(args.simulator) in ["nest"]: import pyNN.nest as sim diff --git a/tests/100_spikes.py b/tests/100_spikes.py index fd6cbfc..24e949f 100644 --- a/tests/100_spikes.py +++ b/tests/100_spikes.py @@ -1,11 +1,7 @@ """ This script tests whether spike counting additional provenance is correct """ -try: - # this might be deprecated soon - import spynnaker8 as sim -except ImportError: - import pyNN.spynnaker as sim +import pyNN.spiNNaker as sim sim.setup(timestep=1, min_delay=1, max_delay=1) # Compute 100 spike diff --git a/tests/100_spikes_0_dmas.py b/tests/100_spikes_0_dmas.py index 7140bdc..aff5fdd 100644 --- a/tests/100_spikes_0_dmas.py +++ b/tests/100_spikes_0_dmas.py @@ -1,11 +1,7 @@ """ This script tests whether spike counting additional provenance is correct """ -try: - # this might be deprecated soon - import spynnaker8 as sim -except ImportError: - import pyNN.spynnaker as sim +import pyNN.spiNNaker as sim sim.setup(timestep=1, min_delay=1, max_delay=1) # Compute 100 spike diff --git a/tests/6000_spikes.py b/tests/6000_spikes.py index c3bd447..70c829e 100644 --- a/tests/6000_spikes.py +++ b/tests/6000_spikes.py @@ -1,11 +1,7 @@ """ This script tests whether spike counting additional provenance is correct """ -try: - # this might be deprecated soon - import spynnaker8 as sim -except ImportError: - import pyNN.spynnaker as sim +import pyNN.spiNNaker as sim sim.setup(timestep=1, min_delay=1, max_delay=1) # Generate 6000 spikes (1 for each input neuron) diff --git a/tests/if_cond_alpha_tests/synfire_if_cond_alpha.py b/tests/if_cond_alpha_tests/synfire_if_cond_alpha.py index 56ed01d..f0e1b9f 100644 --- a/tests/if_cond_alpha_tests/synfire_if_cond_alpha.py +++ b/tests/if_cond_alpha_tests/synfire_if_cond_alpha.py @@ -16,7 +16,7 @@ """ Synfirechain-like example """ -import spynnaker8 as sim +import pyNN.spiNNaker as sim from pyNN.utility.plotting import Figure, Panel import matplotlib.pyplot as plt diff --git a/tests/no_spikes.py b/tests/no_spikes.py index 08cd83f..6dd3926 100644 --- a/tests/no_spikes.py +++ b/tests/no_spikes.py @@ -1,11 +1,7 @@ """ This script tests whether spike counting additional provenance is correct """ -try: - # this might be deprecated soon - import spynnaker8 as sim -except ImportError: - import pyNN.spynnaker as sim +import pyNN.spiNNaker as sim sim.setup(timestep=1, min_delay=1, max_delay=1) diff --git a/tests/one_spike.py b/tests/one_spike.py index 209606d..7e7bbd3 100644 --- a/tests/one_spike.py +++ b/tests/one_spike.py @@ -1,11 +1,7 @@ """ This script tests whether spike counting additional provenance is correct """ -try: - # this might be deprecated soon - import spynnaker8 as sim -except ImportError: - import pyNN.spynnaker as sim +import pyNN.spiNNaker as sim sim.setup(timestep=1, min_delay=1, max_delay=1) # Compute 1 spike diff --git a/tests/test_abcd_counter.py b/tests/test_abcd_counter.py index ca012b0..a30372c 100644 --- a/tests/test_abcd_counter.py +++ b/tests/test_abcd_counter.py @@ -1,11 +1,7 @@ """ This script tests whether spike counting additional provenance is correct """ -try: - # this might be deprecated soon - import spynnaker8 as sim -except ImportError: - import pyNN.spynnaker as sim +import pyNN.spiNNaker as sim from spinncer.analysis_common import * plt.viridis()