Skip to content

Commit

Permalink
Merge pull request #1063 from SpiNNakerManchester/flake8_tidy_up
Browse files Browse the repository at this point in the history
Add flake8 back for spynnaker_integration_tests, spynnaker8 directories
  • Loading branch information
rowleya authored May 6, 2021
2 parents 0fc70fa + c55c25f commit ff30858
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spynnaker8/models/connectors/multapse_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions spynnaker8/models/recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand All @@ -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)
tau=tau, alpha=alpha, A_plus=A_plus, A_minus=A_minus)
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ def report_file(self):
style += "advanced"
else:
style += "simple"
return "{}_test_big_connection".format()
return "{}_test_big_connection".format(style)
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion spynnaker_integration_tests/test_record_sdram/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import os
from neo.io import PickleIO
from spinn_front_end_common.utilities.exceptions import ConfigurationException
import spynnaker8 as sim
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ff30858

Please sign in to comment.