From c114cf11271dc6196b016af157dfb8f974b9326d Mon Sep 17 00:00:00 2001 From: christian-B Date: Fri, 7 Aug 2026 14:12:06 +0100 Subject: [PATCH] replace dict() and list() with {} and [] --- .../live_examples/spike_io.py | 4 ++-- .../spike_io_interactive_demo_with_c_vis.py | 4 ++-- .../live_examples/synfire_if_curr_exp_live.py | 6 +++--- .../external_devices_examples/motor_example.py | 4 ++-- .../stdp_associative_memory.py | 10 +++++----- ..._recurrent_pre_stochastic_multiplicative.py | 10 +++++----- .../synfire_if_curr_dual_exp.py | 6 +++--- examples/synfire_if_cond_exp.py | 2 +- examples/synfire_if_curr_exp.py | 6 +++--- examples/synfire_if_curr_exp_get_weights.py | 6 +++--- examples/synfire_if_curr_exp_large_array.py | 4 ++-- examples/synfire_if_curr_exp_random.py | 2 +- examples/synfire_izk_curr_exp.py | 6 +++--- spiNNaker_start/spinnaker_start.py | 18 +++++++++--------- sudoku/set_numbers.py | 2 +- sudoku/sudoku_main.py | 2 +- sudoku/utils.py | 2 +- 17 files changed, 47 insertions(+), 47 deletions(-) diff --git a/examples/external_devices_examples/live_examples/spike_io.py b/examples/external_devices_examples/live_examples/spike_io.py index bb4546cd..d4a9d764 100644 --- a/examples/external_devices_examples/live_examples/spike_io.py +++ b/examples/external_devices_examples/live_examples/spike_io.py @@ -194,8 +194,8 @@ def receive_spikes(label, _time, neuron_ids): # Synfire chain connections where each neuron is connected to its next neuron # NOTE: there is no recurrent connection so that each chain stops once it # reaches the end -loop_forward = list() -loop_backward = list() +loop_forward = [] +loop_backward = [] for i in range(0, n_neurons - 1): loop_forward.append((i, (i + 1) % n_neurons, weight_to_spike, 3)) loop_backward.append(((i + 1) % n_neurons, i, weight_to_spike, 3)) diff --git a/examples/external_devices_examples/live_examples/spike_io_interactive_demo_with_c_vis.py b/examples/external_devices_examples/live_examples/spike_io_interactive_demo_with_c_vis.py index 222abe0d..b27af19c 100644 --- a/examples/external_devices_examples/live_examples/spike_io_interactive_demo_with_c_vis.py +++ b/examples/external_devices_examples/live_examples/spike_io_interactive_demo_with_c_vis.py @@ -173,8 +173,8 @@ def __init__(self): # neuron # NOTE: there is no recurrent connection so that each chain stops once # it reaches the end - loop_forward = list() - loop_backward = list() + loop_forward = [] + loop_backward = [] for i in range(0, self.n_neurons - 1): loop_forward.append((i, (i + 1) % self.n_neurons, weight_to_spike, 3)) diff --git a/examples/external_devices_examples/live_examples/synfire_if_curr_exp_live.py b/examples/external_devices_examples/live_examples/synfire_if_curr_exp_live.py index ed734a97..c3616fbc 100644 --- a/examples/external_devices_examples/live_examples/synfire_if_curr_exp_live.py +++ b/examples/external_devices_examples/live_examples/synfire_if_curr_exp_live.py @@ -35,13 +35,13 @@ 'v_thresh': -50.0 } -populations = list() -projections = list() +populations = [] +projections = [] weight_to_spike = 2.0 delay = 17 -loopConnections = list() +loopConnections = [] for i in range(0, nNeurons): singleConnection = (i, ((i + 1) % nNeurons), weight_to_spike, delay) loopConnections.append(singleConnection) diff --git a/examples/external_devices_examples/motor_example.py b/examples/external_devices_examples/motor_example.py index f1082675..5a07817e 100644 --- a/examples/external_devices_examples/motor_example.py +++ b/examples/external_devices_examples/motor_example.py @@ -26,8 +26,8 @@ connected_chip_coords = {'x': 0, 'y': 0} link = 4 -populations = list() -projections = list() +populations = [] +projections = [] input_population = p.Population(6, p.SpikeSourcePoisson(rate=10)) diff --git a/examples/extra_models_examples/stdp_associative_memory.py b/examples/extra_models_examples/stdp_associative_memory.py index e1bb2dd3..81bbb1ec 100644 --- a/examples/extra_models_examples/stdp_associative_memory.py +++ b/examples/extra_models_examples/stdp_associative_memory.py @@ -54,8 +54,8 @@ 'v_rest': -70.0, 'v_thresh': -50.0} -populations = list() -projections = list() +populations = [] +projections = [] stimulus = 0 inhib = 1 @@ -85,8 +85,8 @@ p_to_inhib_connect = 1.0 p_from_inhib_connect = 1.0 -spikes0 = list() -teachingSpikes = list() +spikes0 = [] +teachingSpikes = [] for i in range(runTime//40): spikes0.append(i*40) for i in range(runTime//80): @@ -106,7 +106,7 @@ arrayEntries.append(newEntry) spikeArray = {'spike_times': arrayEntries} -teachlist = list() +teachlist = [] for i in range(nSourceNeurons): teachlist.append(teachingSpikes) teachingSpikeArray = {'spike_times': teachlist} diff --git a/examples/extra_models_examples/stdp_mad_recurrent_pre_stochastic_multiplicative.py b/examples/extra_models_examples/stdp_mad_recurrent_pre_stochastic_multiplicative.py index b9d7f6c3..a41155aa 100644 --- a/examples/extra_models_examples/stdp_mad_recurrent_pre_stochastic_multiplicative.py +++ b/examples/extra_models_examples/stdp_mad_recurrent_pre_stochastic_multiplicative.py @@ -41,8 +41,8 @@ 'v_rest': -70.0, 'v_thresh': -50.0} -populations = list() -projections = list() +populations = [] +projections = [] stimulus = 0 inhib = 1 @@ -52,8 +52,8 @@ weight_to_force_firing = 15.0 baseline_excit_weight = 2.0 -spikes0 = list() -teachingSpikes = list() +spikes0 = [] +teachingSpikes = [] for i in range(runTime//40): spikes0.append(i*40) for i in range(runTime//80): @@ -67,7 +67,7 @@ arrayEntries.append(newEntry) spikeArray = {'spike_times': arrayEntries} -teachlist = list() +teachlist = [] for i in range(nSourceNeurons): teachlist.append(teachingSpikes) teachingSpikeArray = {'spike_times': teachlist} diff --git a/examples/extra_models_examples/synfire_if_curr_dual_exp.py b/examples/extra_models_examples/synfire_if_curr_dual_exp.py index bcc84c41..03e2262a 100644 --- a/examples/extra_models_examples/synfire_if_curr_dual_exp.py +++ b/examples/extra_models_examples/synfire_if_curr_dual_exp.py @@ -48,13 +48,13 @@ def run_script(*, split: bool = False) -> None: 'v_thresh': -50.0 } - populations = list() - projections = list() + populations = [] + projections = [] weight_to_spike = 2.0 delay = 17 - loopConnections = list() + loopConnections = [] for i in range(0, nNeurons): singleConnection = ((i, (i + 1) % nNeurons, weight_to_spike, delay)) loopConnections.append(singleConnection) diff --git a/examples/synfire_if_cond_exp.py b/examples/synfire_if_cond_exp.py index 1eb3b861..2fcaa04e 100644 --- a/examples/synfire_if_cond_exp.py +++ b/examples/synfire_if_cond_exp.py @@ -40,7 +40,7 @@ weight_to_spike = 0.035 delay = 17 -loopConnections = list() +loopConnections = [] for i in range(0, nNeurons): singleConnection = ((i, (i + 1) % nNeurons, weight_to_spike, delay)) loopConnections.append(singleConnection) diff --git a/examples/synfire_if_curr_exp.py b/examples/synfire_if_curr_exp.py index d3b4db3a..e0aba46a 100644 --- a/examples/synfire_if_curr_exp.py +++ b/examples/synfire_if_curr_exp.py @@ -35,13 +35,13 @@ 'v_thresh': -50.0 } -populations = list() -projections = list() +populations = [] +projections = [] weight_to_spike = 2.0 delay = 17 -loopConnections = list() +loopConnections = [] for i in range(0, nNeurons): singleConnection = ((i, (i + 1) % nNeurons, weight_to_spike, delay)) loopConnections.append(singleConnection) diff --git a/examples/synfire_if_curr_exp_get_weights.py b/examples/synfire_if_curr_exp_get_weights.py index d188f2a7..94cbf22b 100644 --- a/examples/synfire_if_curr_exp_get_weights.py +++ b/examples/synfire_if_curr_exp_get_weights.py @@ -33,13 +33,13 @@ 'v_thresh': -50.0 } -populations = list() -projections = list() +populations = [] +projections = [] weight_to_spike = 2.0 delay = 17 -loopConnections = list() +loopConnections = [] for i in range(0, nNeurons): singleConnection = ((i, (i + 1) % nNeurons, weight_to_spike, delay)) loopConnections.append(singleConnection) diff --git a/examples/synfire_if_curr_exp_large_array.py b/examples/synfire_if_curr_exp_large_array.py index e4662d48..277dfedb 100644 --- a/examples/synfire_if_curr_exp_large_array.py +++ b/examples/synfire_if_curr_exp_large_array.py @@ -39,8 +39,8 @@ second_spike_start = delay * nNeurons space_between_inputs = delay * nNeurons * 2 -connections = list() -reverseConnections = list() +connections = [] +reverseConnections = [] for i in range(0, nNeurons - 1): connections.append((i, (i + 1) % nNeurons, weight_to_spike, delay)) reverseConnections.append(((i + 1) % nNeurons, i, weight_to_spike, delay)) diff --git a/examples/synfire_if_curr_exp_random.py b/examples/synfire_if_curr_exp_random.py index f13672ff..f91afec8 100644 --- a/examples/synfire_if_curr_exp_random.py +++ b/examples/synfire_if_curr_exp_random.py @@ -40,7 +40,7 @@ weight_to_spike = 2.0 delay = RandomDistribution("uniform", low=1, high=max_delay) -loopConnections = list() +loopConnections = [] for i in range(0, nNeurons): delay_value = delay.next() singleConnection = (i, ((i + 1) % nNeurons), weight_to_spike, delay_value) diff --git a/examples/synfire_izk_curr_exp.py b/examples/synfire_izk_curr_exp.py index 28efdbcc..59649068 100644 --- a/examples/synfire_izk_curr_exp.py +++ b/examples/synfire_izk_curr_exp.py @@ -35,13 +35,13 @@ 'i_offset': 0 } -populations = list() -projections = list() +populations = [] +projections = [] weight_to_spike = 30 delay = 1 -loopConnections = list() +loopConnections = [] for i in range(0, nNeurons): singleConnection = ((i, (i + 1) % nNeurons, weight_to_spike, delay)) loopConnections.append(singleConnection) diff --git a/spiNNaker_start/spinnaker_start.py b/spiNNaker_start/spinnaker_start.py index aac8e508..8e80726f 100644 --- a/spiNNaker_start/spinnaker_start.py +++ b/spiNNaker_start/spinnaker_start.py @@ -93,7 +93,7 @@ def write_data_to_file(write_file, data_list): def read_data_from_file(read_file): - data_list = list() + data_list = [] n_items = struct.unpack("