diff --git a/balanced_random/balanced_random.py b/balanced_random/balanced_random.py index 48bd4dbf..b61183fd 100644 --- a/balanced_random/balanced_random.py +++ b/balanced_random/balanced_random.py @@ -14,9 +14,9 @@ import matplotlib.pyplot as pylab import numpy +import pyNN.spiNNaker as p from pyNN.random import RandomDistribution from pyNN.utility.plotting import Figure, Panel -import pyNN.spiNNaker as p p.setup(timestep=0.1) p.set_number_of_neurons_per_core(p.IF_curr_exp, 64) diff --git a/balanced_random/split/balanced_random_split.py b/balanced_random/split/balanced_random_split.py index 830c7357..6bf9a73e 100755 --- a/balanced_random/split/balanced_random_split.py +++ b/balanced_random/split/balanced_random_split.py @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pylab import numpy +import pylab +import pyNN.spiNNaker as p from pyNN.random import RandomDistribution from pyNN.utility.plotting import Figure, Panel -import pyNN.spiNNaker as p p.setup(timestep=0.1) p.set_number_of_neurons_per_core(p.IF_curr_exp, 64) diff --git a/examples/current_injection_example.py b/examples/current_injection_example.py index c2a470fb..b62ab515 100644 --- a/examples/current_injection_example.py +++ b/examples/current_injection_example.py @@ -29,9 +29,9 @@ """ +import matplotlib.pyplot as plt import pyNN.spiNNaker as sim from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt from quantities import mV sim.setup(timestep=1.0) diff --git a/examples/external_devices_examples/live_examples/balanced_random_live_rate.py b/examples/external_devices_examples/live_examples/balanced_random_live_rate.py index c13b06c0..1e0b27cf 100644 --- a/examples/external_devices_examples/live_examples/balanced_random_live_rate.py +++ b/examples/external_devices_examples/live_examples/balanced_random_live_rate.py @@ -13,6 +13,7 @@ # limitations under the License. import time + import numpy import pylab import pyNN.spiNNaker as p diff --git a/examples/external_devices_examples/live_examples/spike_io.py b/examples/external_devices_examples/live_examples/spike_io.py index 6395e9f9..bb4546cd 100644 --- a/examples/external_devices_examples/live_examples/spike_io.py +++ b/examples/external_devices_examples/live_examples/spike_io.py @@ -15,9 +15,10 @@ import random import time from threading import Condition + +import matplotlib.pyplot as plt import pyNN.spiNNaker as Frontend from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt ################################### # Setup for Live Input and Output # 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 470c8f1b..222abe0d 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 @@ -14,9 +14,10 @@ import multiprocessing import tkinter as tk + +import matplotlib.pyplot as plt import pyNN.spiNNaker as Frontend from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt class PyNNScript(object): 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 185c1926..ed734a97 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 @@ -13,11 +13,11 @@ # limitations under the License. # Standard PyNN imports +import matplotlib.pyplot as plt import pyNN.spiNNaker as p # pynn plotting stuff from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt # Define a synfire chain as usual p.setup(timestep=1.0, min_delay=1.0) diff --git a/examples/external_devices_examples/pushbot_light_follower.py b/examples/external_devices_examples/pushbot_light_follower.py index a932edd0..be3941a5 100644 --- a/examples/external_devices_examples/pushbot_light_follower.py +++ b/examples/external_devices_examples/pushbot_light_follower.py @@ -18,7 +18,6 @@ import numpy import pyNN.spiNNaker as p - ########################################### # Connection and simulation specifications ########################################### diff --git a/examples/extra_models_examples/IF_cond_exp_stoc.py b/examples/extra_models_examples/IF_cond_exp_stoc.py index 4bee132b..121da656 100644 --- a/examples/extra_models_examples/IF_cond_exp_stoc.py +++ b/examples/extra_models_examples/IF_cond_exp_stoc.py @@ -28,10 +28,10 @@ $Id$ """ +import matplotlib.pyplot as plt import pylab import pyNN.spiNNaker as sim from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt def run_script(*, split: bool = False) -> None: diff --git a/examples/extra_models_examples/IF_curr_delta.py b/examples/extra_models_examples/IF_curr_delta.py index 8d2c9c45..e5676307 100644 --- a/examples/extra_models_examples/IF_curr_delta.py +++ b/examples/extra_models_examples/IF_curr_delta.py @@ -17,9 +17,9 @@ and two delta, current-based synapses, fed by two spike sources. """ +import matplotlib.pyplot as plt 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) diff --git a/examples/extra_models_examples/IF_curr_exp_ca2_adaptive.py b/examples/extra_models_examples/IF_curr_exp_ca2_adaptive.py index 43528711..29a3d0dc 100644 --- a/examples/extra_models_examples/IF_curr_exp_ca2_adaptive.py +++ b/examples/extra_models_examples/IF_curr_exp_ca2_adaptive.py @@ -21,8 +21,9 @@ # doi:10.1023/A:1008916026143 # ----------------------------------------------------------------------------- import math -import numpy + import matplotlib.pyplot as pylab +import numpy import pyNN.spiNNaker as sim diff --git a/examples/extra_models_examples/IF_curr_exp_sEMD.py b/examples/extra_models_examples/IF_curr_exp_sEMD.py index 136b91b6..c441a15c 100644 --- a/examples/extra_models_examples/IF_curr_exp_sEMD.py +++ b/examples/extra_models_examples/IF_curr_exp_sEMD.py @@ -19,8 +19,8 @@ """ # imports -import pyNN.spiNNaker as p import matplotlib.pyplot as plt +import pyNN.spiNNaker as p from pyNN.utility.plotting import Figure, Panel diff --git a/examples/extra_models_examples/LGN_Izhikevich.py b/examples/extra_models_examples/LGN_Izhikevich.py index d362ed47..696962f6 100644 --- a/examples/extra_models_examples/LGN_Izhikevich.py +++ b/examples/extra_models_examples/LGN_Izhikevich.py @@ -41,13 +41,14 @@ """ import math -import pyNN.spiNNaker as p + +import matplotlib.pyplot as plt import numpy as np -from pyNN.random import RandomDistribution, NumpyRNG +import pyNN.spiNNaker as p +from pyNN.random import NumpyRNG, RandomDistribution # for plotting from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt # pylint: disable=pointless-string-statement,disable=wrong-spelling-in-comment diff --git a/examples/extra_models_examples/stdp_associative_memory.py b/examples/extra_models_examples/stdp_associative_memory.py index 69bafc1c..e1bb2dd3 100644 --- a/examples/extra_models_examples/stdp_associative_memory.py +++ b/examples/extra_models_examples/stdp_associative_memory.py @@ -16,9 +16,10 @@ Simple Associative Memory """ import matplotlib.pyplot as plt -from pyNN.random import NumpyRNG, RandomDistribution import pyNN.spiNNaker as p +from pyNN.random import NumpyRNG, RandomDistribution from pyNN.utility.plotting import Figure, Panel + # pylint: disable=wrong-spelling-in-comment p.setup(timestep=1.0, min_delay=1.0) diff --git a/examples/extra_models_examples/stdp_example_izk_cond.py b/examples/extra_models_examples/stdp_example_izk_cond.py index c913297c..9e52f4c4 100644 --- a/examples/extra_models_examples/stdp_example_izk_cond.py +++ b/examples/extra_models_examples/stdp_example_izk_cond.py @@ -49,9 +49,9 @@ April 2013 """ +import matplotlib.pyplot as plt import pyNN.spiNNaker as sim from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt # SpiNNaker setup sim.setup(timestep=0.1, min_delay=1.0) 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 a2007663..b9d7f6c3 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 @@ -18,6 +18,7 @@ import matplotlib.pyplot as plt import pyNN.spiNNaker as p from pyNN.utility.plotting import Figure, Panel + # pylint: disable=wrong-spelling-in-comment p.setup(timestep=1.0, min_delay=1.0) diff --git a/examples/extra_models_examples/stdp_triplet.py b/examples/extra_models_examples/stdp_triplet.py index 4505dbd3..64d47acf 100644 --- a/examples/extra_models_examples/stdp_triplet.py +++ b/examples/extra_models_examples/stdp_triplet.py @@ -13,7 +13,6 @@ # limitations under the License. import matplotlib.pyplot as pylab - import pyNN.spiNNaker as sim # pylint: disable=wrong-spelling-in-comment 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 927f3412..bcc84c41 100644 --- a/examples/extra_models_examples/synfire_if_curr_dual_exp.py +++ b/examples/extra_models_examples/synfire_if_curr_dual_exp.py @@ -15,9 +15,9 @@ """ Synfirechain-like example """ +import matplotlib.pyplot as plt import pyNN.spiNNaker as p from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt def run_script(*, split: bool = False) -> None: diff --git a/examples/extra_models_examples/vogels_2011.py b/examples/extra_models_examples/vogels_2011.py index 3a029f5e..07835376 100644 --- a/examples/extra_models_examples/vogels_2011.py +++ b/examples/extra_models_examples/vogels_2011.py @@ -13,9 +13,11 @@ # limitations under the License. import os from typing import Optional -import pyNN.spiNNaker as sim -import numpy + import matplotlib.pyplot as pylab +import numpy +import pyNN.spiNNaker as sim + from spynnaker.pyNN.utilities import neo_convertor # how much slowdown to put into the network to allow it to run without any diff --git a/examples/hbp_neuroguidebook_example.py b/examples/hbp_neuroguidebook_example.py index 62b15077..5d4436e3 100644 --- a/examples/hbp_neuroguidebook_example.py +++ b/examples/hbp_neuroguidebook_example.py @@ -17,8 +17,8 @@ (example used in the HBP Neuromorphic Computing Guidebook) """ -import numpy as np import matplotlib.pyplot as plt +import numpy as np import pyNN.spiNNaker as sim sim.setup(timestep=1.0, min_delay=1.0) diff --git a/examples/if_curr_alpha.py b/examples/if_curr_alpha.py index 933ce7dc..2894df2f 100644 --- a/examples/if_curr_alpha.py +++ b/examples/if_curr_alpha.py @@ -11,9 +11,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +import matplotlib.pyplot as plt import pyNN.spiNNaker as p import pyNN.utility.plotting as plot -import matplotlib.pyplot as plt def run_script(*, split: bool = True) -> None: diff --git a/examples/if_curr_delta.py b/examples/if_curr_delta.py index 68c88be2..6d294567 100644 --- a/examples/if_curr_delta.py +++ b/examples/if_curr_delta.py @@ -17,9 +17,9 @@ and two delta, current-based synapses, fed by two spike sources. """ +import matplotlib.pyplot as plt import pyNN.spiNNaker as sim from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt sim.setup(timestep=1.0, min_delay=1.0) diff --git a/examples/partitioner_examples/splitter_usage.py b/examples/partitioner_examples/splitter_usage.py index af9e4ee2..2476e33f 100644 --- a/examples/partitioner_examples/splitter_usage.py +++ b/examples/partitioner_examples/splitter_usage.py @@ -11,14 +11,18 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +import matplotlib.pyplot as plt import pyNN.spiNNaker as p from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt + +from pacman.model.partitioner_splitters import SplitterFixedLegacy from pacman.model.partitioner_splitters import ( SplitterOneToOneLegacy as OneToOneSplitter, - SplitterFixedLegacy) +) + from spynnaker.pyNN.extra_algorithms.splitter_components import ( - SplitterPopulationVertexFixed) + SplitterPopulationVertexFixed, +) runtime = 1000 n_neurons = 100 # number of neurons in each population diff --git a/examples/pynnBrunnel.py b/examples/pynnBrunnel.py index fec0fd56..4835c6aa 100644 --- a/examples/pynnBrunnel.py +++ b/examples/pynnBrunnel.py @@ -12,9 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pyNN.spiNNaker as pynn - import matplotlib.pyplot as plt +import pyNN.spiNNaker as pynn from pyNN.random import RandomDistribution from pyNN.utility.plotting import Figure, Panel diff --git a/examples/simple_STDP.py b/examples/simple_STDP.py index 2e55dc95..b5c75279 100644 --- a/examples/simple_STDP.py +++ b/examples/simple_STDP.py @@ -29,11 +29,12 @@ so some alteration of parameters is necessary to get a similar effect. """ +import matplotlib.pyplot as plt import numpy import pyNN.spiNNaker as sim + # from quantities import ms -from pyNN.utility.plotting import Figure, Panel, DataTable -import matplotlib.pyplot as plt +from pyNN.utility.plotting import DataTable, Figure, Panel # === Parameters ============================================================ diff --git a/examples/spike_time_compare.py b/examples/spike_time_compare.py index 685da637..419f8b57 100644 --- a/examples/spike_time_compare.py +++ b/examples/spike_time_compare.py @@ -15,9 +15,9 @@ # A simple script that compares the spikes from two inputs to determine if # one spiked just before or after the other. +import matplotlib.pyplot as plt import pyNN.spiNNaker as sim import pyNN.utility.plotting as plot -import matplotlib.pyplot as plt sim.setup(timestep=1.0) diff --git a/examples/split_examples/pynnBrunnelSplit.py b/examples/split_examples/pynnBrunnelSplit.py index 213dad0c..802f9df4 100755 --- a/examples/split_examples/pynnBrunnelSplit.py +++ b/examples/split_examples/pynnBrunnelSplit.py @@ -12,9 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pyNN.spiNNaker as pynn - import matplotlib.pyplot as plt +import pyNN.spiNNaker as pynn from pyNN.random import RandomDistribution from pyNN.utility.plotting import Figure, Panel diff --git a/examples/split_examples/stdp_neuromodulated_example_split.py b/examples/split_examples/stdp_neuromodulated_example_split.py index aaca979a..2da26fb6 100644 --- a/examples/split_examples/stdp_neuromodulated_example_split.py +++ b/examples/split_examples/stdp_neuromodulated_example_split.py @@ -26,8 +26,8 @@ post-synaptic neurons to the same stimuli. """ -import pyNN.spiNNaker as sim import pylab +import pyNN.spiNNaker as sim timestep = 1.0 stim_rate = 50 diff --git a/examples/split_examples/structural_plasticity_with_stdp_neuromodulated.py b/examples/split_examples/structural_plasticity_with_stdp_neuromodulated.py index 9a504584..e015e3df 100644 --- a/examples/split_examples/structural_plasticity_with_stdp_neuromodulated.py +++ b/examples/split_examples/structural_plasticity_with_stdp_neuromodulated.py @@ -31,9 +31,9 @@ STDP, structural plasticity and neuron instructions would not fit on one core """ -import pyNN.spiNNaker as sim -import pylab import numpy as np +import pylab +import pyNN.spiNNaker as sim timestep = 1.0 stim_rate = 50 diff --git a/examples/split_examples/va_benchmark_split.py b/examples/split_examples/va_benchmark_split.py index 1e2ab753..3b958566 100755 --- a/examples/split_examples/va_benchmark_split.py +++ b/examples/split_examples/va_benchmark_split.py @@ -27,12 +27,12 @@ August 2006 """ import socket + +import matplotlib.pyplot as plt import pyNN.spiNNaker as p from pyNN.random import RandomDistribution from pyNN.utility import Timer from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt - simulator_name = 'spiNNaker' benchmark = 'CUBA' diff --git a/examples/stdp_example.py b/examples/stdp_example.py index 3527b443..9d241f7b 100644 --- a/examples/stdp_example.py +++ b/examples/stdp_example.py @@ -42,9 +42,9 @@ April 2013 """ +import matplotlib.pyplot as plt import pyNN.spiNNaker as sim from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt # SpiNNaker setup sim.setup(timestep=1.0, min_delay=1.0) diff --git a/examples/stdp_example_cond.py b/examples/stdp_example_cond.py index 224efb91..5401760f 100644 --- a/examples/stdp_example_cond.py +++ b/examples/stdp_example_cond.py @@ -42,9 +42,9 @@ April 2013 """ +import matplotlib.pyplot as plt import pyNN.spiNNaker as sim from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt # SpiNNaker setup sim.setup(timestep=1.0, min_delay=1.0) diff --git a/examples/stdp_example_izk.py b/examples/stdp_example_izk.py index 3b52d2fb..d95ae379 100644 --- a/examples/stdp_example_izk.py +++ b/examples/stdp_example_izk.py @@ -49,9 +49,9 @@ April 2013 """ +import matplotlib.pyplot as plt import pyNN.spiNNaker as sim from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt # SpiNNaker setup sim.setup(timestep=0.1, min_delay=1.0) diff --git a/examples/stdp_neuromodulated_example.py b/examples/stdp_neuromodulated_example.py index 640c70b0..f4e02a58 100644 --- a/examples/stdp_neuromodulated_example.py +++ b/examples/stdp_neuromodulated_example.py @@ -26,8 +26,8 @@ post-synaptic neurons to the same stimuli. """ -import pyNN.spiNNaker as sim import pylab +import pyNN.spiNNaker as sim timestep = 1.0 stim_rate = 50 diff --git a/examples/structural_plasticity_with_stdp_neuromodulated_separate_pops.py b/examples/structural_plasticity_with_stdp_neuromodulated_separate_pops.py index a98fbf1e..1fe98bad 100644 --- a/examples/structural_plasticity_with_stdp_neuromodulated_separate_pops.py +++ b/examples/structural_plasticity_with_stdp_neuromodulated_separate_pops.py @@ -31,9 +31,9 @@ post-synaptic neurons to the same stimuli. """ -import pyNN.spiNNaker as sim -import pylab import numpy as np +import pylab +import pyNN.spiNNaker as sim timestep = 1.0 stim_rate = 100 diff --git a/examples/synfire_if_cond_exp.py b/examples/synfire_if_cond_exp.py index a039d675..1eb3b861 100644 --- a/examples/synfire_if_cond_exp.py +++ b/examples/synfire_if_cond_exp.py @@ -15,9 +15,9 @@ """ Synfirechain-like example """ +import matplotlib.pyplot as plt import pyNN.spiNNaker as p from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt runtime = 5000 p.setup(timestep=1.0, min_delay=1.0) diff --git a/examples/synfire_if_curr_exp.py b/examples/synfire_if_curr_exp.py index 56791bce..d3b4db3a 100644 --- a/examples/synfire_if_curr_exp.py +++ b/examples/synfire_if_curr_exp.py @@ -15,9 +15,9 @@ """ Synfirechain-like example """ +import matplotlib.pyplot as plt import pyNN.spiNNaker as p from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt runtime = 5000 p.setup(timestep=1.0, min_delay=1.0) diff --git a/examples/synfire_if_curr_exp_large_array.py b/examples/synfire_if_curr_exp_large_array.py index b5587363..e4662d48 100644 --- a/examples/synfire_if_curr_exp_large_array.py +++ b/examples/synfire_if_curr_exp_large_array.py @@ -15,9 +15,9 @@ """ Synfirechain-like example """ +import matplotlib.pyplot as plt import pyNN.spiNNaker as p from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt run_time = 6000 p.setup(timestep=1.0, min_delay=1.00) diff --git a/examples/synfire_if_curr_exp_random.py b/examples/synfire_if_curr_exp_random.py index 60b7837d..f13672ff 100644 --- a/examples/synfire_if_curr_exp_random.py +++ b/examples/synfire_if_curr_exp_random.py @@ -16,11 +16,10 @@ Synfirechain-like example """ import matplotlib.pyplot as plt -from pyNN.random import RandomDistribution import pyNN.spiNNaker as p +from pyNN.random import RandomDistribution from pyNN.utility.plotting import Figure, Panel - p.setup(timestep=1.0, min_delay=1.0) nNeurons = 200 # number of neurons in each population max_delay = 50 diff --git a/examples/synfire_izk_curr_exp.py b/examples/synfire_izk_curr_exp.py index 93ac0be3..28efdbcc 100644 --- a/examples/synfire_izk_curr_exp.py +++ b/examples/synfire_izk_curr_exp.py @@ -15,9 +15,9 @@ """ Synfirechain-like example """ +import matplotlib.pyplot as plt import pyNN.spiNNaker as p from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt runtime = 500 p.setup(timestep=1.0, min_delay=1.0) diff --git a/examples/va_benchmark.py b/examples/va_benchmark.py index d17e1522..c50a075a 100644 --- a/examples/va_benchmark.py +++ b/examples/va_benchmark.py @@ -30,11 +30,12 @@ August 2006 """ import socket + +import matplotlib.pyplot as plt import pyNN.spiNNaker as p from pyNN.random import RandomDistribution from pyNN.utility import Timer from pyNN.utility.plotting import Figure, Panel -import matplotlib.pyplot as plt simulator_name = 'spiNNaker' benchmark = 'CUBA' diff --git a/examples/wta_example.py b/examples/wta_example.py index e7e6eef5..0dc247be 100644 --- a/examples/wta_example.py +++ b/examples/wta_example.py @@ -24,9 +24,9 @@ # The output graph shows the difference in the outputs of the two populations. -import pyNN.spiNNaker as sim import matplotlib.pyplot as plt import numpy +import pyNN.spiNNaker as sim sim.setup(1.0) diff --git a/learning/random_dist.py b/learning/random_dist.py index cd7ae383..c333cc5b 100644 --- a/learning/random_dist.py +++ b/learning/random_dist.py @@ -13,9 +13,9 @@ # limitations under the License. import matplotlib.pyplot as plt -from pyNN.random import RandomDistribution -import pyNN.utility.plotting as plot import pyNN.spiNNaker as sim +import pyNN.utility.plotting as plot +from pyNN.random import RandomDistribution n_neurons = 1000 n_exc = int(round(n_neurons * 0.8)) diff --git a/learning/split/stdp_split.py b/learning/split/stdp_split.py index 163c81e9..495e0051 100755 --- a/learning/split/stdp_split.py +++ b/learning/split/stdp_split.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pyNN.utility.plotting as plot import matplotlib.pyplot as plt import pyNN.spiNNaker as sim +import pyNN.utility.plotting as plot n_neurons = 192 simtime = 5000 diff --git a/learning/split/struct_pl_split.py b/learning/split/struct_pl_split.py index fd26ef89..7930ddf9 100755 --- a/learning/split/struct_pl_split.py +++ b/learning/split/struct_pl_split.py @@ -14,8 +14,8 @@ import matplotlib.pyplot as plt import numpy -import pyNN.utility.plotting as plot import pyNN.spiNNaker as sim +import pyNN.utility.plotting as plot n_neurons = 64 simtime = 5000 diff --git a/ruff.bash b/ruff.bash new file mode 100755 index 00000000..072abcc9 --- /dev/null +++ b/ruff.bash @@ -0,0 +1,57 @@ +#!/bin/bash + +# Copyright (c) 2026 The University of Manchester +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# This bash assumes that other repositories are installed in parallel +# ruffs SpiNNUtils, spinn_machine and unittests + +if [ "$#" -eq "0" ] + then + echo "Using previous setup. Provide an argument to run setup" + source ../SupportScripts/venv/ruff_runner/bin/activate +else + python3 -m venv ../SupportScripts/venv/ruff_runner + source ../SupportScripts/venv/ruff_runner/bin/activate + python3 -m pip install --upgrade ruff +fi + +echo using ruff.toml +ruff check ../SpiNNUtils/spinn_utilities ../SpiNNUtils/unittests \ + ../SpiNNMachine/spinn_machine ../SpiNNMachine/unittests \ + ../SpiNNMan/spinnman ../SpiNNMan/unittests \ + ../SpiNNMan/spinnman_integration_tests ../SpiNNMan/manual_scripts \ + ../PACMAN/pacman ../PACMAN/pacman_test_objects ../PACMAN/unittests \ + ../spalloc/spalloc_client ../spalloc/tests \ + ../SpiNNFrontEndCommon/spinn_front_end_common ../SpiNNFrontEndCommon/unittests \ + ../SpiNNFrontEndCommon/fec_integration_tests \ + ../TestBase/spinnaker_testbase ../TestBase/unittests \ + ../sPyNNaker/spynnaker ../sPyNNaker/unittests \ + ../sPyNNaker/spynnaker_integration_tests ../sPyNNaker/proxy_integration_tests \ + examples balanced_random learning sudoku synfire \ + --target-version py310 --config ../SupportScripts/actions/ruff/ruff.toml +echo using ruff_up.toml +ruff check ../SpiNNUtils/spinn_utilities ../SpiNNUtils/unittests \ + ../SpiNNMachine/spinn_machine ../SpiNNMachine/unittests \ + ../SpiNNMan/spinnman ../SpiNNMan/unittests \ + ../SpiNNMan/spinnman_integration_tests ../SpiNNMan/manual_scripts \ + ../PACMAN/pacman ../PACMAN/pacman_test_objects ../PACMAN/unittests \ + ../spalloc/spalloc_client ../spalloc/tests \ + ../SpiNNFrontEndCommon/spinn_front_end_common ../SpiNNFrontEndCommon/unittests \ + ../SpiNNFrontEndCommon/fec_integration_tests \ + ../TestBase/spinnaker_testbase ../TestBase/unittests \ + ../sPyNNaker/spynnaker ../sPyNNaker/unittests \ + ../sPyNNaker/spynnaker_integration_tests ../sPyNNaker/proxy_integration_tests \ + examples balanced_random learning sudoku synfire \ + --target-version py310 --config ../SupportScripts/actions/ruff/ruff_up.toml \ No newline at end of file diff --git a/sudoku/set_numbers.py b/sudoku/set_numbers.py index dcb45adf..276308de 100644 --- a/sudoku/set_numbers.py +++ b/sudoku/set_numbers.py @@ -12,12 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +import functools +import sys import tkinter as tk import tkinter.font as tkFont -import sys -import functools + import pyNN.spiNNaker as p -from sudoku.utils import puzzles, get_rates + +from sudoku.utils import get_rates, puzzles class GUI(object): diff --git a/sudoku/sudoku_main.py b/sudoku/sudoku_main.py index 66d0f714..a190a75e 100644 --- a/sudoku/sudoku_main.py +++ b/sudoku/sudoku_main.py @@ -18,16 +18,19 @@ # Steve Furber, November 2015 # ############################################################# -import subprocess import os +import re +import subprocess import sys import traceback -import re from threading import Thread -from pyNN.random import RandomDistribution + import pyNN.spiNNaker as p +from pyNN.random import RandomDistribution + import spynnaker.pyNN.external_devices as ext -from sudoku.utils import puzzles, get_rates + +from sudoku.utils import get_rates, puzzles run_time = 20000 # run time in milliseconds neurons_per_digit = 5 # number of neurons per digit diff --git a/synfire/synfire.py b/synfire/synfire.py index b26874b8..a4c19960 100644 --- a/synfire/synfire.py +++ b/synfire/synfire.py @@ -17,6 +17,7 @@ """ import matplotlib.pyplot as plt import pyNN.spiNNaker as sim + from spynnaker.pyNN.utilities import neo_convertor # number of neurons in each population diff --git a/synfire/synfire_collab.py b/synfire/synfire_collab.py index b34623da..0a162c6d 100644 --- a/synfire/synfire_collab.py +++ b/synfire/synfire_collab.py @@ -17,6 +17,7 @@ """ import matplotlib.pyplot as plt import pyNN.spiNNaker as sim + from spynnaker.pyNN.utilities import neo_convertor # number of neurons in each population