diff --git a/.github/workflows/python_actions.yml b/.github/workflows/python_actions.yml index 305c057..f6e2255 100644 --- a/.github/workflows/python_actions.yml +++ b/.github/workflows/python_actions.yml @@ -22,13 +22,13 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] + python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout SupportScripts - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: SpiNNakerManchester/SupportScripts path: support @@ -40,10 +40,10 @@ jobs: - name: Install pip, etc uses: ./support/actions/python-tools - name: Install Spinnaker Dependencies - uses: ./support/actions/checkout-spinn-deps + uses: ./support/actions/install-spinn-deps with: repositories: > - SpiNNUtils SpiNNMachine SpiNNMan PACMAN DataSpecification spalloc + SpiNNUtils SpiNNMachine SpiNNMan PACMAN spalloc SpiNNFrontEndCommon sPyNNaker install: true @@ -65,9 +65,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout SupportScripts - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: SpiNNakerManchester/SupportScripts path: support diff --git a/.ratexcludes b/.ratexcludes index e3ce47c..f63e490 100644 --- a/.ratexcludes +++ b/.ratexcludes @@ -4,7 +4,6 @@ **/SpiNNMachine/** **/SpiNNMan/** **/PACMAN/** -**/DataSpecification/** **/spalloc/** **/SpiNNFrontEndCommon/** **/sPyNNaker/** diff --git a/examples/extra_models_examples/LGN_Izhikevich.py b/examples/extra_models_examples/LGN_Izhikevich.py index 9e1dcaa..fb1515d 100644 --- a/examples/extra_models_examples/LGN_Izhikevich.py +++ b/examples/extra_models_examples/LGN_Izhikevich.py @@ -121,14 +121,10 @@ def print_synchrony(): """ Initialising Model connectivity parameters """ -intra_pop_delay = RandomDistribution('uniform', (1, 3), - rng=NumpyRNG(seed=85520)) -intra_nucleus_delay = RandomDistribution('uniform', (1, 3), - rng=NumpyRNG(seed=85521)) -inter_nucleus_delay = RandomDistribution('uniform', (1, 3), - rng=NumpyRNG(seed=85522)) -inter_pop_delay = RandomDistribution('uniform', (1, 3), - rng=NumpyRNG(seed=85523)) +intra_pop_delay = RandomDistribution('uniform', (1, 3)) +intra_nucleus_delay = RandomDistribution('uniform', (1, 3)) +inter_nucleus_delay = RandomDistribution('uniform', (1, 3)) +inter_pop_delay = RandomDistribution('uniform', (1, 3)) input_delay = inter_pop_delay # # input_delay is the delay of the spike source hitting the neuronal pops @@ -262,25 +258,25 @@ def print_synchrony(): NumCellsTRN = 4*scale_fact TCR_pop = p.Population( NumCellsTCR, p.extra_models.Izhikevich_cond, TCR_cell_params, - label='TCR_pop', initial_values=TCR_initial_values) + label='TCR_pop', initial_values=TCR_initial_values, seed=85520) IN_pop = p.Population( NumCellsIN, p.extra_models.Izhikevich_cond, IN_cell_params, - label='IN_pop', initial_values=IN_initial_values) + label='IN_pop', initial_values=IN_initial_values, seed=85521) TRN_pop = p.Population( NumCellsTRN, p.extra_models.Izhikevich_cond, TRN_cell_params, - label='TRN_pop', initial_values=TRN_initial_values) + label='TRN_pop', initial_values=TRN_initial_values, seed=85522) """ Poisson input for TCR """ spike_source_TCR = p.Population( NumCellsTCR, p.SpikeSourcePoisson(rate=10, start=Start_Inp, duration=Duration_Inp), - label='spike_source_TCR') + label='spike_source_TCR', seed=85523) """ Poisson input for IN """ spike_source_IN = p.Population( NumCellsIN, p.SpikeSourcePoisson(rate=10, start=Start_Inp, duration=Duration_Inp), - label='spike_source_IN') + label='spike_source_IN', seed=85524) """ Poisson Source to TCR population projections """ Proj0 = p.Projection( diff --git a/examples/extra_models_examples/vogel_2011/spynnaker.cfg b/examples/extra_models_examples/vogel_2011/spynnaker.cfg index ce24524..a5c114f 100644 --- a/examples/extra_models_examples/vogel_2011/spynnaker.cfg +++ b/examples/extra_models_examples/vogel_2011/spynnaker.cfg @@ -32,6 +32,3 @@ time_between_cores = 2.7 # performance controller for how much of the time step to use for sending fraction_of_time_spike_sending = 0.99 - -[Mapping] -compressor = SpynnakerMachineBitFieldPairRouterCompressor diff --git a/examples/extra_models_examples/vogel_2011/vogels_2011_live.py b/examples/extra_models_examples/vogel_2011/vogels_2011_live.py index 3b30ee4..a996888 100644 --- a/examples/extra_models_examples/vogel_2011/vogels_2011_live.py +++ b/examples/extra_models_examples/vogel_2011/vogels_2011_live.py @@ -13,7 +13,6 @@ # limitations under the License. import pyNN.spiNNaker as sim -from pyNN.random import NumpyRNG # ------------------------------------------------------------------- @@ -45,8 +44,6 @@ # Reduce number of neurons to simulate on each core sim.set_number_of_neurons_per_core(sim.IF_curr_exp, 100) -rng = NumpyRNG(seed=59) - # Create excitatory and inhibitory populations of neurons ex_pop = sim.Population(NUM_EXCITATORY, model(**cell_params), label="Excitatory", additional_parameters={"seed": 2}) @@ -57,15 +54,15 @@ ex_pop.record('spikes') # Make excitatory->inhibitory projections -sim.Projection(ex_pop, in_pop, sim.FixedProbabilityConnector(0.02, rng=rng), +sim.Projection(ex_pop, in_pop, sim.FixedProbabilityConnector(0.02), receptor_type='excitatory', synapse_type=sim.StaticSynapse(weight=0.029)) -sim.Projection(ex_pop, ex_pop, sim.FixedProbabilityConnector(0.02, rng=rng), +sim.Projection(ex_pop, ex_pop, sim.FixedProbabilityConnector(0.02), receptor_type='excitatory', synapse_type=sim.StaticSynapse(weight=0.029)) # Make inhibitory->inhibitory projections -sim.Projection(in_pop, in_pop, sim.FixedProbabilityConnector(0.02, rng=rng), +sim.Projection(in_pop, in_pop, sim.FixedProbabilityConnector(0.02), receptor_type='inhibitory', synapse_type=sim.StaticSynapse(weight=-0.29)) @@ -76,7 +73,7 @@ weight_dependence=sim.AdditiveWeightDependence(w_min=0.0, w_max=1.0)) # Make inhibitory->excitatory projections -sim.Projection(in_pop, ex_pop, sim.FixedProbabilityConnector(0.02, rng=rng), +sim.Projection(in_pop, ex_pop, sim.FixedProbabilityConnector(0.02), receptor_type='inhibitory', synapse_type=stdp_model) diff --git a/examples/pynnBrunnel.py b/examples/pynnBrunnel.py index d76e95f..9454b6f 100644 --- a/examples/pynnBrunnel.py +++ b/examples/pynnBrunnel.py @@ -16,7 +16,7 @@ import numpy as np import matplotlib.pyplot as plt -from pyNN.random import NumpyRNG, RandomDistribution +from pyNN.random import RandomDistribution from pyNN.utility.plotting import Figure, Panel simulator_Name = 'spiNNaker' @@ -136,8 +136,6 @@ def poisson_generator(_rate, _rng, _t_start=0.0, _t_stop=1000.0, _debug=False): pynn.set_number_of_neurons_per_core(pynn.IF_curr_exp, 64) pynn.set_number_of_neurons_per_core(pynn.SpikeSourcePoisson, 64) -rng = NumpyRNG(seed=1) - exc_cell_params = { 'cm': 1.0, # pf 'tau_m': tau_m, @@ -164,29 +162,29 @@ def poisson_generator(_rate, _rng, _t_start=0.0, _t_stop=1000.0, _debug=False): # Set-up pynn Populations E_pop = pynn.Population( - N_E, pynn.IF_curr_exp(**exc_cell_params), label="E_pop") + N_E, pynn.IF_curr_exp(**exc_cell_params), label="E_pop", seed=1) I_pop = pynn.Population( - N_I, pynn.IF_curr_exp(**inh_cell_params), label="I_pop") + N_I, pynn.IF_curr_exp(**inh_cell_params), label="I_pop", seed=2) Poiss_ext_E = pynn.Population( N_E, pynn.SpikeSourcePoisson(rate=10.0), label="Poisson_pop_E", - additional_parameters={"seed": int(rng.next() * 0xFFFFFFFF)}) + additional_parameters={"seed": 3}) Poiss_ext_I = pynn.Population( N_I, pynn.SpikeSourcePoisson(rate=10.0), label="Poisson_pop_I", - additional_parameters={"seed": int(rng.next() * 0xFFFFFFFF)}) + additional_parameters={"seed": 4}) # Connectors -E_conn = pynn.FixedProbabilityConnector(epsilon, rng=rng) -I_conn = pynn.FixedProbabilityConnector(epsilon, rng=rng) +E_conn = pynn.FixedProbabilityConnector(epsilon) +I_conn = pynn.FixedProbabilityConnector(epsilon) # Use random delays for the external noise and # set the inital membrance voltage below the resting potential # to avoid the overshoot of activity in the beginning of the simulation -delay_distr = RandomDistribution('uniform', low=0.1, high=12.8, rng=rng) +delay_distr = RandomDistribution('uniform', low=0.1, high=12.8) Ext_conn = pynn.OneToOneConnector() -uniformDistr = RandomDistribution('uniform', low=-10, high=0, rng=rng) +uniformDistr = RandomDistribution('uniform', low=-10, high=0) E_pop.initialize(v=uniformDistr) I_pop.initialize(v=uniformDistr) diff --git a/examples/split_examples/pynnBrunnelSplit.py b/examples/split_examples/pynnBrunnelSplit.py index 8c204a9..cea0208 100755 --- a/examples/split_examples/pynnBrunnelSplit.py +++ b/examples/split_examples/pynnBrunnelSplit.py @@ -16,7 +16,7 @@ import numpy as np import matplotlib.pyplot as plt -from pyNN.random import NumpyRNG, RandomDistribution +from pyNN.random import RandomDistribution from pyNN.utility.plotting import Figure, Panel from spynnaker.pyNN.extra_algorithms.splitter_components import ( SplitterAbstractPopulationVertexNeuronsSynapses, SplitterPoissonDelegate) @@ -139,8 +139,6 @@ def poisson_generator(rate, rng, t_start=0.0, t_stop=1000.0, array=True, pynn.set_number_of_neurons_per_core(pynn.IF_curr_exp, 64) pynn.set_number_of_neurons_per_core(pynn.SpikeSourcePoisson, 64) -rng = NumpyRNG(seed=1) - exc_cell_params = { 'cm': 1.0, # pf 'tau_m': tau_m, @@ -169,35 +167,35 @@ def poisson_generator(rate, rng, t_start=0.0, t_stop=1000.0, array=True, E_pop_splitter = SplitterAbstractPopulationVertexNeuronsSynapses(3, 128, False) E_pop = pynn.Population( N_E, pynn.IF_curr_exp(**exc_cell_params), label="E_pop", - additional_parameters={"splitter": E_pop_splitter}) + additional_parameters={"splitter": E_pop_splitter}, seed=1) I_pop_splitter = SplitterAbstractPopulationVertexNeuronsSynapses(3, 128, False) I_pop = pynn.Population( N_I, pynn.IF_curr_exp(**inh_cell_params), label="I_pop", - additional_parameters={"splitter": I_pop_splitter}) + additional_parameters={"splitter": I_pop_splitter}, seed=2) Poiss_ext_E_splitter = SplitterPoissonDelegate() Poiss_ext_E = pynn.Population( N_E, pynn.SpikeSourcePoisson(rate=10.0), label="Poisson_pop_E", - additional_parameters={"seed": int(rng.next() * 0xFFFFFFFF), + additional_parameters={"seed": 3, "splitter": Poiss_ext_E_splitter}) Poiss_ext_I_splitter = SplitterPoissonDelegate() Poiss_ext_I = pynn.Population( N_I, pynn.SpikeSourcePoisson(rate=10.0), label="Poisson_pop_I", - additional_parameters={"seed": int(rng.next() * 0xFFFFFFFF), + additional_parameters={"seed": 4, "splitter": Poiss_ext_I_splitter}) # Connectors -E_conn = pynn.FixedProbabilityConnector(epsilon, rng=rng) -I_conn = pynn.FixedProbabilityConnector(epsilon, rng=rng) +E_conn = pynn.FixedProbabilityConnector(epsilon) +I_conn = pynn.FixedProbabilityConnector(epsilon) # Use random delays for the external noise and # set the inital membrance voltage below the resting potential # to avoid the overshoot of activity in the beginning of the simulation -delay_distr = RandomDistribution('uniform', low=0.1, high=12.8, rng=rng) +delay_distr = RandomDistribution('uniform', low=0.1, high=12.8) Ext_conn = pynn.OneToOneConnector() -uniformDistr = RandomDistribution('uniform', low=-10, high=0, rng=rng) +uniformDistr = RandomDistribution('uniform', low=-10, high=0) E_pop.initialize(v=uniformDistr) I_pop.initialize(v=uniformDistr) diff --git a/examples/split_examples/va_benchmark_split.py b/examples/split_examples/va_benchmark_split.py index 83734a1..9e39e5b 100755 --- a/examples/split_examples/va_benchmark_split.py +++ b/examples/split_examples/va_benchmark_split.py @@ -28,7 +28,7 @@ """ import socket import pyNN.spiNNaker as p -from pyNN.random import NumpyRNG, RandomDistribution +from pyNN.random import RandomDistribution from pyNN.utility import Timer from pyNN.utility.plotting import Figure, Panel import matplotlib.pyplot as plt @@ -161,30 +161,29 @@ exc_cells_splitter = SplitterAbstractPopulationVertexNeuronsSynapses(2) exc_cells = p.Population( n_exc, celltype(**cell_params), label="Excitatory_Cells", - additional_parameters={"splitter": exc_cells_splitter}) + additional_parameters={"splitter": exc_cells_splitter}, seed=1) inh_cells_splitter = SplitterAbstractPopulationVertexNeuronsSynapses(3) inh_cells = p.Population( n_inh, celltype(**cell_params), label="Inhibitory_Cells", - additional_parameters={"splitter": inh_cells_splitter}) + additional_parameters={"splitter": inh_cells_splitter}, seed=2) exc_conn = None ext_stim = None if benchmark == "COBA": ext_stim = p.Population( 20, p.SpikeSourcePoisson(rate=rate, duration=stim_dur), - label="expoisson") + label="expoisson", seed=3) rconn = 0.01 ext_conn = p.FixedProbabilityConnector(rconn) ext_stim.record("spikes") print("%s Initialising membrane potential to random values..." % node_id) -rng = NumpyRNG(seed=rngseed, parallel_safe=parallel_safe) -uniformDistr = RandomDistribution('uniform', [v_reset, v_thresh], rng=rng) +uniformDistr = RandomDistribution('uniform', [v_reset, v_thresh]) exc_cells.initialize(v=uniformDistr) inh_cells.initialize(v=uniformDistr) print("%s Connecting populations..." % node_id) -exc_conn = p.FixedProbabilityConnector(pconn, rng=rng) -inh_conn = p.FixedProbabilityConnector(pconn, rng=rng) +exc_conn = p.FixedProbabilityConnector(pconn) +inh_conn = p.FixedProbabilityConnector(pconn) connections = { 'e2e': p.Projection( diff --git a/examples/va_benchmark.py b/examples/va_benchmark.py index bcca046..f6969c6 100644 --- a/examples/va_benchmark.py +++ b/examples/va_benchmark.py @@ -29,7 +29,7 @@ """ import socket import pyNN.spiNNaker as p -from pyNN.random import NumpyRNG, RandomDistribution +from pyNN.random import RandomDistribution from pyNN.utility import Timer from pyNN.utility.plotting import Figure, Panel import matplotlib.pyplot as plt @@ -157,28 +157,27 @@ print("%s Creating cell populations..." % node_id) exc_cells = p.Population( - n_exc, celltype(**cell_params), label="Excitatory_Cells") + n_exc, celltype(**cell_params), label="Excitatory_Cells", seed=1) inh_cells = p.Population( - n_inh, celltype(**cell_params), label="Inhibitory_Cells") + n_inh, celltype(**cell_params), label="Inhibitory_Cells", seed=2) exc_conn = None ext_stim = None if benchmark == "COBA": ext_stim = p.Population( 20, p.SpikeSourcePoisson(rate=rate, duration=stim_dur), - label="expoisson") + label="expoisson", seed=3) rconn = 0.01 ext_conn = p.FixedProbabilityConnector(rconn) ext_stim.record("spikes") print("%s Initialising membrane potential to random values..." % node_id) -rng = NumpyRNG(seed=rngseed, parallel_safe=parallel_safe) -uniformDistr = RandomDistribution('uniform', [v_reset, v_thresh], rng=rng) +uniformDistr = RandomDistribution('uniform', [v_reset, v_thresh]) exc_cells.initialize(v=uniformDistr) inh_cells.initialize(v=uniformDistr) print("%s Connecting populations..." % node_id) -exc_conn = p.FixedProbabilityConnector(pconn, rng=rng) -inh_conn = p.FixedProbabilityConnector(pconn, rng=rng) +exc_conn = p.FixedProbabilityConnector(pconn) +inh_conn = p.FixedProbabilityConnector(pconn) connections = { 'e2e': p.Projection( diff --git a/requirements-test.txt b/requirements-test.txt index cad7026..856e7df 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -12,10 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -coverage >= 4.4, < 5.0 -flake8 # pytest will be brought in by pytest-cov pytest-cov -sphinx >= 2 -pylint testfixtures