From f2da3e621eec62fd8be50bf5e061424d6dc01fb3 Mon Sep 17 00:00:00 2001 From: christian-B Date: Mon, 10 Aug 2026 15:41:35 +0100 Subject: [PATCH] simplify range by removing 0 start --- .../external_devices_examples/live_examples/spike_io.py | 2 +- .../live_examples/spike_io_interactive_demo_with_c_vis.py | 6 +++--- .../live_examples/synfire_if_curr_exp_live.py | 2 +- examples/extra_models_examples/LGN_Izhikevich.py | 2 +- examples/extra_models_examples/synfire_if_curr_dual_exp.py | 2 +- examples/synfire_if_cond_exp.py | 2 +- examples/synfire_if_curr_exp.py | 2 +- examples/synfire_if_curr_exp_get_weights.py | 2 +- examples/synfire_if_curr_exp_large_array.py | 2 +- examples/synfire_if_curr_exp_random.py | 2 +- examples/synfire_izk_curr_exp.py | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/external_devices_examples/live_examples/spike_io.py b/examples/external_devices_examples/live_examples/spike_io.py index d4a9d76..ee033a4 100644 --- a/examples/external_devices_examples/live_examples/spike_io.py +++ b/examples/external_devices_examples/live_examples/spike_io.py @@ -196,7 +196,7 @@ def receive_spikes(label, _time, neuron_ids): # reaches the end loop_forward = [] loop_backward = [] -for i in range(0, n_neurons - 1): +for i in range(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)) Frontend.Projection(pop_forward, pop_forward, 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 b27af19..775edfb 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 @@ -133,7 +133,7 @@ def __init__(self): label='spike_injector_backward') else: spike_times = [] - for _ in range(0, self.n_neurons): + for _ in range(self.n_neurons): spike_times.append([]) spike_times[0] = [0] spike_times[20] = [(run_time / 100) * 20] @@ -142,7 +142,7 @@ def __init__(self): spike_times[80] = [(run_time / 100) * 80] cell_params_forward = {'spike_times': spike_times} spike_times_backwards = [] - for _ in range(0, self.n_neurons): + for _ in range(self.n_neurons): spike_times_backwards.append([]) spike_times_backwards[0] = [(run_time / 100) * 80] spike_times_backwards[20] = [(run_time / 100) * 60] @@ -175,7 +175,7 @@ def __init__(self): # it reaches the end loop_forward = [] loop_backward = [] - for i in range(0, self.n_neurons - 1): + for i in range(self.n_neurons - 1): loop_forward.append((i, (i + 1) % self.n_neurons, weight_to_spike, 3)) loop_backward.append(((i + 1) % 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 c3616fb..4c557dc 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 @@ -42,7 +42,7 @@ delay = 17 loopConnections = [] -for i in range(0, nNeurons): +for i in range(nNeurons): singleConnection = (i, ((i + 1) % nNeurons), weight_to_spike, delay) loopConnections.append(singleConnection) diff --git a/examples/extra_models_examples/LGN_Izhikevich.py b/examples/extra_models_examples/LGN_Izhikevich.py index 696962f..1190781 100644 --- a/examples/extra_models_examples/LGN_Izhikevich.py +++ b/examples/extra_models_examples/LGN_Izhikevich.py @@ -63,7 +63,7 @@ def get_mean_rate(numCells, population): """ firing_rate = [] # format = < neuron_id, rate (spikes/ms) > - for index in range(0, numCells): + for index in range(numCells): rate = len(population.segments[0].spiketrains[index])/TotalDuration firing_rate.append(rate) 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 03e2262..18860e0 100644 --- a/examples/extra_models_examples/synfire_if_curr_dual_exp.py +++ b/examples/extra_models_examples/synfire_if_curr_dual_exp.py @@ -55,7 +55,7 @@ def run_script(*, split: bool = False) -> None: delay = 17 loopConnections = [] - for i in range(0, nNeurons): + for i in range(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 2fcaa04..6f77994 100644 --- a/examples/synfire_if_cond_exp.py +++ b/examples/synfire_if_cond_exp.py @@ -41,7 +41,7 @@ delay = 17 loopConnections = [] -for i in range(0, nNeurons): +for i in range(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 e0aba46..3c1ddce 100644 --- a/examples/synfire_if_curr_exp.py +++ b/examples/synfire_if_curr_exp.py @@ -42,7 +42,7 @@ delay = 17 loopConnections = [] -for i in range(0, nNeurons): +for i in range(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 94cbf22..945df90 100644 --- a/examples/synfire_if_curr_exp_get_weights.py +++ b/examples/synfire_if_curr_exp_get_weights.py @@ -40,7 +40,7 @@ delay = 17 loopConnections = [] -for i in range(0, nNeurons): +for i in range(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 277dfed..7a9505f 100644 --- a/examples/synfire_if_curr_exp_large_array.py +++ b/examples/synfire_if_curr_exp_large_array.py @@ -41,7 +41,7 @@ connections = [] reverseConnections = [] -for i in range(0, nNeurons - 1): +for i in range(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 f91afec..2e5fe6d 100644 --- a/examples/synfire_if_curr_exp_random.py +++ b/examples/synfire_if_curr_exp_random.py @@ -41,7 +41,7 @@ delay = RandomDistribution("uniform", low=1, high=max_delay) loopConnections = [] -for i in range(0, nNeurons): +for i in range(nNeurons): delay_value = delay.next() singleConnection = (i, ((i + 1) % nNeurons), weight_to_spike, delay_value) loopConnections.append(singleConnection) diff --git a/examples/synfire_izk_curr_exp.py b/examples/synfire_izk_curr_exp.py index 5964906..2d1db9f 100644 --- a/examples/synfire_izk_curr_exp.py +++ b/examples/synfire_izk_curr_exp.py @@ -42,7 +42,7 @@ delay = 1 loopConnections = [] -for i in range(0, nNeurons): +for i in range(nNeurons): singleConnection = ((i, (i + 1) % nNeurons, weight_to_spike, delay)) loopConnections.append(singleConnection)