diff --git a/.github/workflows/python_actions.yml b/.github/workflows/python_actions.yml index 75f56dbb3e..67b0483088 100644 --- a/.github/workflows/python_actions.yml +++ b/.github/workflows/python_actions.yml @@ -70,12 +70,12 @@ jobs: coveralls-token: ${{ secrets.GITHUB_TOKEN }} - name: Lint with flake8 - run: flake8 spynnaker unittests + run: flake8 spynnaker spynnaker8 unittests spynnaker_integration_tests - name: Lint with pylint uses: ./support/actions/pylint with: - package: spynnaker + package: spynnaker spynnaker8 - name: Run rat copyright enforcement if: matrix.python-version == 3.8 diff --git a/spynnaker8/models/connectors/multapse_connector.py b/spynnaker8/models/connectors/multapse_connector.py index f5b1a1e3df..71ffe3e5a2 100644 --- a/spynnaker8/models/connectors/multapse_connector.py +++ b/spynnaker8/models/connectors/multapse_connector.py @@ -56,6 +56,6 @@ def __init__(self, n, allow_self_connections=True, "spynnaker.pyNN.models.neural_projections.connectors." "MultapseConnector") super(MultapseConnector, self).__init__( - num_synapses=n, allow_self_connections=allow_self_connections, + n=n, allow_self_connections=allow_self_connections, with_replacement=with_replacement, safe=safe, verbose=verbose, rng=rng) diff --git a/spynnaker8/models/recorder.py b/spynnaker8/models/recorder.py index 467a676e77..5f2ba9ed8e 100644 --- a/spynnaker8/models/recorder.py +++ b/spynnaker8/models/recorder.py @@ -25,11 +25,11 @@ class Recorder(_BaseClass): # DO NOT DEFINE SLOTS! Multiple inheritance problems otherwise. # __slots__ = [] - def __init__(self, population): + def __init__(self, population, vertex): """ :param population: the population to record for :type population: ~spynnaker.pyNN.models.populations.Population """ moved_in_v6("spynnaker8.models.recorder", "spynnaker.pyNN.models.recorder") - super(Recorder, self).__init__(population) + super(Recorder, self).__init__(population, vertex) diff --git a/spynnaker8/models/synapse_dynamics/timing_dependence/timing_dependence_recurrent.py b/spynnaker8/models/synapse_dynamics/timing_dependence/timing_dependence_recurrent.py index 25f883a834..f78ea5d7f6 100644 --- a/spynnaker8/models/synapse_dynamics/timing_dependence/timing_dependence_recurrent.py +++ b/spynnaker8/models/synapse_dynamics/timing_dependence/timing_dependence_recurrent.py @@ -15,9 +15,9 @@ from spynnaker.pyNN.models.neuron.plasticity.stdp.timing_dependence import ( TimingDependenceRecurrent as _BaseClass) +from spynnaker.pyNN.utilities.utility_calls import moved_in_v6 _defaults = _BaseClass.default_parameters -from spynnaker.pyNN.utilities.utility_calls import moved_in_v6 class TimingDependenceRecurrent(_BaseClass): diff --git a/spynnaker8/models/synapse_dynamics/timing_dependence/timing_dependence_spike_nearest_pair.py b/spynnaker8/models/synapse_dynamics/timing_dependence/timing_dependence_spike_nearest_pair.py index 46f5eeade3..7cd0e2775a 100644 --- a/spynnaker8/models/synapse_dynamics/timing_dependence/timing_dependence_spike_nearest_pair.py +++ b/spynnaker8/models/synapse_dynamics/timing_dependence/timing_dependence_spike_nearest_pair.py @@ -16,9 +16,9 @@ from spynnaker.pyNN.models.neuron.plasticity.stdp.timing_dependence import ( TimingDependenceSpikeNearestPair as _BaseClass) +from spynnaker.pyNN.utilities.utility_calls import moved_in_v6 _defaults = _BaseClass.default_parameters -from spynnaker.pyNN.utilities.utility_calls import moved_in_v6 class TimingDependenceSpikeNearestPair(_BaseClass): diff --git a/spynnaker8/models/synapse_dynamics/timing_dependence/timing_dependence_vogels_2011.py b/spynnaker8/models/synapse_dynamics/timing_dependence/timing_dependence_vogels_2011.py index 1ad035536b..e6697dd027 100644 --- a/spynnaker8/models/synapse_dynamics/timing_dependence/timing_dependence_vogels_2011.py +++ b/spynnaker8/models/synapse_dynamics/timing_dependence/timing_dependence_vogels_2011.py @@ -15,9 +15,10 @@ from spynnaker.pyNN.models.neuron.plasticity.stdp.timing_dependence import ( TimingDependenceVogels2011 as _BaseClass) +from spynnaker.pyNN.utilities.utility_calls import moved_in_v6 _defaults = _BaseClass.default_parameters -from spynnaker.pyNN.utilities.utility_calls import moved_in_v6 + class TimingDependenceVogels2011(_BaseClass): """ @@ -41,4 +42,4 @@ def __init__( "spynnaker.pyNN.models.neuron.plasticity.stdp." "timing_dependence.TimingDependenceVogels2011") super(TimingDependenceVogels2011, self).__init__( - tau=tau, alpha=alpha, A_plus=A_plus, A_minus=A_minus) \ No newline at end of file + tau=tau, alpha=alpha, A_plus=A_plus, A_minus=A_minus) diff --git a/spynnaker_integration_tests/test_big_connection/test_big_connection.py b/spynnaker_integration_tests/test_big_connection/test_big_connection.py index 25d1d2c958..b2637b1fb6 100644 --- a/spynnaker_integration_tests/test_big_connection/test_big_connection.py +++ b/spynnaker_integration_tests/test_big_connection/test_big_connection.py @@ -72,4 +72,4 @@ def report_file(self): style += "advanced" else: style += "simple" - return "{}_test_big_connection".format() + return "{}_test_big_connection".format(style) diff --git a/spynnaker_integration_tests/test_many_boards/many_boards.py b/spynnaker_integration_tests/test_many_boards/many_boards.py index 9578626982..f67f948f99 100644 --- a/spynnaker_integration_tests/test_many_boards/many_boards.py +++ b/spynnaker_integration_tests/test_many_boards/many_boards.py @@ -78,7 +78,6 @@ def report_file(self): return "{}_n_boards={}_n_neurons={}_simtime={}".format( style, self.n_boards, self.n_neurons, self.simtime) - def do_run(self): report_file = self.report_file() t_before = time.time() diff --git a/spynnaker_integration_tests/test_record_sdram/__init__.py b/spynnaker_integration_tests/test_record_sdram/__init__.py index 4bee965c41..d358f58a86 100644 --- a/spynnaker_integration_tests/test_record_sdram/__init__.py +++ b/spynnaker_integration_tests/test_record_sdram/__init__.py @@ -11,4 +11,4 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . \ No newline at end of file +# along with this program. If not, see . diff --git a/spynnaker_integration_tests/test_record_sdram_no_extra_mons/__init__.py b/spynnaker_integration_tests/test_record_sdram_no_extra_mons/__init__.py index 4bee965c41..d358f58a86 100644 --- a/spynnaker_integration_tests/test_record_sdram_no_extra_mons/__init__.py +++ b/spynnaker_integration_tests/test_record_sdram_no_extra_mons/__init__.py @@ -11,4 +11,4 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . \ No newline at end of file +# along with this program. If not, see . diff --git a/spynnaker_integration_tests/test_selective_recording/test_recording_on_off.py b/spynnaker_integration_tests/test_selective_recording/test_recording_on_off.py index ba68324dd5..f00cf0af7b 100644 --- a/spynnaker_integration_tests/test_selective_recording/test_recording_on_off.py +++ b/spynnaker_integration_tests/test_selective_recording/test_recording_on_off.py @@ -13,7 +13,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import os from neo.io import PickleIO from spinn_front_end_common.utilities.exceptions import ConfigurationException import spynnaker8 as sim diff --git a/spynnaker_integration_tests/test_selective_recording/test_sampling.py b/spynnaker_integration_tests/test_selective_recording/test_sampling.py index d4b8b4bd85..e62df93945 100644 --- a/spynnaker_integration_tests/test_selective_recording/test_sampling.py +++ b/spynnaker_integration_tests/test_selective_recording/test_sampling.py @@ -26,14 +26,10 @@ def medium(self): simtime = 1000 spike_rate = 5 n_neurons = 320 - spike_rec_indexes = list(range(0, 100, 2)) \ - + list(range(100, 200, 3)) \ - + list(range(200, 300, 1)) \ - + list(range(300, 320, 4)) - v_rec_indexes = list(range(0, 100, 1)) \ - + list(range(100, 200, 3)) \ - + list(range(200, 300, 4)) \ - + list(range(300, 320, 2)) + spike_rec_indexes = list(range(0, 100, 2)) + list(range(100, 200, 3)) \ + + list(range(200, 300, 1)) + list(range(300, 320, 4)) + v_rec_indexes = list(range(0, 100, 1)) + list(range(100, 200, 3)) \ + + list(range(200, 300, 4)) + list(range(300, 320, 2)) v_rate = 3 pop = ps.create_population(sim, n_neurons=n_neurons, label="test", spike_rate=spike_rate, diff --git a/spynnaker_integration_tests/test_selective_recording/test_sampling_by_compare.py b/spynnaker_integration_tests/test_selective_recording/test_sampling_by_compare.py index 0d96e86fde..4d4eae7b92 100644 --- a/spynnaker_integration_tests/test_selective_recording/test_sampling_by_compare.py +++ b/spynnaker_integration_tests/test_selective_recording/test_sampling_by_compare.py @@ -23,16 +23,17 @@ """ This is the original way of testing selective recording. -It worked by running the same seeded script twice. +It worked by running the same seeded script twice. Once recording all and once with selective recording on. -The main selective recording is now done by test_sampling +The main selective recording is now done by test_sampling based on the PatternSpiker. This is kept mainly for all the useful compare methods. Which is why most tests are commented out. """ + def run_script( simtime, n_neurons, run_split=1, record_spikes=False, spike_rate=None, spike_rec_indexes=None, diff --git a/spynnaker_integration_tests/test_stdp/test_STDP_pair_multiplicative.py b/spynnaker_integration_tests/test_stdp/test_STDP_pair_multiplicative.py index 9db90c965f..345c057509 100644 --- a/spynnaker_integration_tests/test_stdp/test_STDP_pair_multiplicative.py +++ b/spynnaker_integration_tests/test_stdp/test_STDP_pair_multiplicative.py @@ -20,7 +20,6 @@ from spinnaker_testbase import BaseTestCase - def post_spike_same_time(): """ Check that the offsets between send times of different spike source arrays don't change the outcome of STDP diff --git a/spynnaker_integration_tests/test_struct_pl/test_structural_formation_to_full.py b/spynnaker_integration_tests/test_struct_pl/test_structural_formation_to_full.py index 80199c85a9..3993e3b6ec 100644 --- a/spynnaker_integration_tests/test_struct_pl/test_structural_formation_to_full.py +++ b/spynnaker_integration_tests/test_struct_pl/test_structural_formation_to_full.py @@ -58,6 +58,7 @@ def structural_formation_to_full(): return conns, num_rewires + class TestStructuralFormationToFull(BaseTestCase): def do_run(self): conns, num_rewires = structural_formation_to_full() diff --git a/spynnaker_integration_tests/test_various/test_record_packets_per_timestep.py b/spynnaker_integration_tests/test_various/test_record_packets_per_timestep.py index 1196d5caad..64512aa410 100644 --- a/spynnaker_integration_tests/test_various/test_record_packets_per_timestep.py +++ b/spynnaker_integration_tests/test_various/test_record_packets_per_timestep.py @@ -32,9 +32,9 @@ def do_run(self): weight = 5 delay = 5 - proj = sim.Projection(pop_src, pop_lif, sim.OneToOneConnector(), - sim.StaticSynapse(weight=weight, delay=delay), - receptor_type="excitatory") + sim.Projection(pop_src, pop_lif, sim.OneToOneConnector(), + sim.StaticSynapse(weight=weight, delay=delay), + receptor_type="excitatory") pop_lif.record("packets-per-timestep") sim.run(runtime)