From 1987428fc179628e1275df0837094a9ae809a25d Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 9 Feb 2026 06:22:12 +0000 Subject: [PATCH 1/3] remove dead code --- examples/split_examples/pynnBrunnelSplit.py | 67 --------------------- 1 file changed, 67 deletions(-) diff --git a/examples/split_examples/pynnBrunnelSplit.py b/examples/split_examples/pynnBrunnelSplit.py index 31ecd10..0cf55aa 100755 --- a/examples/split_examples/pynnBrunnelSplit.py +++ b/examples/split_examples/pynnBrunnelSplit.py @@ -23,73 +23,6 @@ # exec('import pyNN.%s as pynn' % simulator_Name) -def poisson_generator(rate, rng, t_start=0.0, t_stop=1000.0, array=True, - debug=False): - """ - Returns a SpikeTrain whose spikes are a realization of a Poisson process - with the given rate (Hz) and stopping time t_stop (milliseconds). - - Note: t_start is always 0.0, thus all realizations are as if - they spiked at t=0.0, though this spike is not included in the SpikeList. - - Inputs: - rate - the rate of the discharge (in Hz) - t_start - the beginning of the SpikeTrain (in ms) - t_stop - the end of the SpikeTrain (in ms) - array - if True, a numpy array of sorted spikes is returned, - rather than a SpikeTrain object. - - Examples: - >> gen.poisson_generator(50, 0, 1000) - >> gen.poisson_generator(20, 5000, 10000, array=True) - - See also: - inh_poisson_generator, inh_gamma_generator, - inh_adaptingmarkov_generator - """ - - n = (t_stop - t_start) / 1000.0 * rate - number = np.ceil(n + 3 * np.sqrt(n)) - if number < 100: - number = min(5 + np.ceil(2 * n), 100) - - if number > 0: - isi = rng.exponential(1.0 / rate, number) * 1000.0 - if number > 1: - spikes = np.add.accumulate(isi) - else: - spikes = isi - else: - spikes = np.array([]) - - spikes += t_start - i = np.searchsorted(spikes, t_stop) - - extra_spikes = [] - if i == len(spikes): - # ISI buf overrun - - t_last = spikes[-1] + rng.exponential(1.0 / rate, 1)[0] * 1000.0 - - while (t_last < t_stop): - extra_spikes.append(t_last) - t_last += rng.exponential(1.0 / rate, 1)[0] * 1000.0 - - spikes = np.concatenate((spikes, extra_spikes)) - - if debug: - print("ISI buf overrun handled. len(spikes)=%d," - " len(extra_spikes)=%d" % (len(spikes), len(extra_spikes))) - - else: - spikes = np.resize(spikes, (i,)) - - if debug: - return spikes, extra_spikes - else: - return [round(x) for x in spikes] - - # Total number of neurons Neurons = 1000 sim_time = 1000.0 From ff06fbca63f07b055b2bca8776776e69d36b5da2 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 9 Feb 2026 06:28:42 +0000 Subject: [PATCH 2/3] remove unused import --- examples/split_examples/pynnBrunnelSplit.py | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/split_examples/pynnBrunnelSplit.py b/examples/split_examples/pynnBrunnelSplit.py index 0cf55aa..213dad0 100755 --- a/examples/split_examples/pynnBrunnelSplit.py +++ b/examples/split_examples/pynnBrunnelSplit.py @@ -14,7 +14,6 @@ import pyNN.spiNNaker as pynn -import numpy as np import matplotlib.pyplot as plt from pyNN.random import RandomDistribution from pyNN.utility.plotting import Figure, Panel From 844eca80bc39fbb5c15f062ac73470bf37a8a57b Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Mon, 9 Feb 2026 06:48:32 +0000 Subject: [PATCH 3/3] same dead code --- examples/pynnBrunnel.py | 69 ----------------------------------------- 1 file changed, 69 deletions(-) diff --git a/examples/pynnBrunnel.py b/examples/pynnBrunnel.py index 504f76a..fec0fd5 100644 --- a/examples/pynnBrunnel.py +++ b/examples/pynnBrunnel.py @@ -14,80 +14,11 @@ import pyNN.spiNNaker as pynn -import numpy as np import matplotlib.pyplot as plt from pyNN.random import RandomDistribution from pyNN.utility.plotting import Figure, Panel simulator_Name = 'spiNNaker' -# exec('import pyNN.%s as pynn' % simulator_Name) - - -def poisson_generator(_rate, _rng, _t_start=0.0, _t_stop=1000.0, _debug=False): - """ - Returns a SpikeTrain whose spikes are a realization of a Poisson process - with the given rate (Hz) and stopping time t_stop (milliseconds). - - Note: t_start is always 0.0, thus all realizations are as if - they spiked at t=0.0, though this spike is not included in the SpikeList. - - Inputs: - rate - the rate of the discharge (in Hz) - t_start - the beginning of the SpikeTrain (in ms) - t_stop - the end of the SpikeTrain (in ms) - array - if True, a numpy array of sorted spikes is returned, - rather than a SpikeTrain object. - - Examples: - >> gen.poisson_generator(50, 0, 1000) - >> gen.poisson_generator(20, 5000, 10000, array=True) - - See also: - inh_poisson_generator, inh_gamma_generator, - inh_adaptingmarkov_generator - """ - - n = (_t_stop - _t_start) / 1000.0 * _rate - number = np.ceil(n + 3 * np.sqrt(n)) - if number < 100: - number = min(5 + np.ceil(2 * n), 100) - - if number > 0: - isi = _rng.exponential(1.0 / _rate, number) * 1000.0 - if number > 1: - spikes = np.add.accumulate(isi) - else: - spikes = isi - else: - spikes = np.array([]) - - spikes += _t_start - i = np.searchsorted(spikes, _t_stop) - - extra_spikes = [] - if i == len(spikes): - # Interspike interval buffer overrun - - t_last = spikes[-1] + _rng.exponential(1.0 / _rate, 1)[0] * 1000.0 - - while (t_last < _t_stop): - extra_spikes.append(t_last) - t_last += _rng.exponential(1.0 / _rate, 1)[0] * 1000.0 - - spikes = np.concatenate((spikes, extra_spikes)) - - if _debug: - print(f"ISI buf overrun handled. {len(spikes)=}, " - f"{len(extra_spikes)=}") - - else: - spikes = np.resize(spikes, (i,)) - - if _debug: - return spikes, extra_spikes - else: - return [round(x) for x in spikes] - # Total number of neurons Neurons = 1000