Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

import multiprocessing
import tkinter as tk
#import tkinter as tk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is presumably needed?

import pyNN.spiNNaker as Frontend
from pyNN.utility.plotting import Figure, Panel
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -242,6 +242,11 @@ class GUI(object):
"""

def __init__(self, n_neurons, ready, port):
"""
:param n_neurons: Number of neurons to show
:param ready: multiprocessing.Event
:param port: multiprocessing.Value
"""
self._n_neurons = n_neurons

# Set up the live connection for sending and receiving spikes
Expand Down
3 changes: 3 additions & 0 deletions pendulum/pendulum_follow_c_vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

class CSVLine():
def __init__(self, line):
"""
:param line: A single line as read from the file
"""
if len(line) == 0:
raise EOFError
parts = [int(part.strip()) for part in line.split(",")]
Expand Down
3 changes: 3 additions & 0 deletions pendulum/pendulum_follow_python_vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

class CSVLine():
def __init__(self, line):
"""
:param line: A single line as read from the file
"""
if len(line) == 0:
raise EOFError
parts = [int(part.strip()) for part in line.split(",")]
Expand Down
3 changes: 3 additions & 0 deletions pendulum/spike_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@

class CSVLine():
def __init__(self, line):
"""
:param line: A single line as read from the file
"""
if len(line) == 0:
raise EOFError
parts = [int(part.strip()) for part in line.split(",")]
Expand Down
50 changes: 50 additions & 0 deletions spiNNaker_start/spinnaker_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ class GetVersion(AbstractSCPRequest):
__slots__ = []

def __init__(self, x, y):
"""
:param x:
:param y:
"""
super(GetVersion, self).__init__(
SDPHeader(
flags=SDPFlag.REPLY_EXPECTED_NO_P2P, destination_port=0,
Expand All @@ -121,6 +125,12 @@ class ReadSV(AbstractSCPRequest):
__slots__ = []

def __init__(self, x, y, variable, size=None):
"""
:param x:
:param y:
:param variable:
:param size:
"""
base_address = (SYSTEM_VARIABLE_BASE_ADDRESS + variable.offset)
if size is None:
size = variable.data_type.value
Expand All @@ -142,6 +152,14 @@ def get_scp_response(self):
class ReadNetinitPhaseProcess(AbstractMultiConnectionProcess):

def __init__(self, x, y, connection_selector, core_counter, save, load):
"""
:param x:
:param y:
:param connection_selector:
:param core_counter:
:param save:
:param load:
"""
super(ReadNetinitPhaseProcess, self).__init__(
connection_selector, timeout=0.5, n_retries=0)
self._x = x
Expand Down Expand Up @@ -280,6 +298,13 @@ def _run(self):
class GetP2PTableProcess(AbstractMultiConnectionProcess):

def __init__(self, connection_selector, width, height, save, load):
"""
:param connection_selector:
:param width:
:param height:
:param save:
:param load:
"""
super(GetP2PTableProcess, self).__init__(connection_selector)
self._width = width
self._height = height
Expand Down Expand Up @@ -334,6 +359,17 @@ class ReadBoardProcess(AbstractMultiConnectionProcess):
def __init__(
self, eth_x, eth_y, width, height, p2p_table, connection_selector,
core_counter, save, load):
"""
:param eth_x:
:param eth_y:
:param width:
:param height:
:param p2p_table:
:param connection_selector:
:param core_counter:
:param save:
:param load:
"""
# pylint: disable=too-many-arguments
super(ReadBoardProcess, self).__init__(
connection_selector, n_retries=10, timeout=5.0, n_channels=1,
Expand Down Expand Up @@ -412,6 +448,10 @@ def _read_board(self):
class CoreCounter(object):

def __init__(self, width, height):
"""
:param width:
:param height:
"""
self._total_cores = 0
self._update_lock = RLock()
self._ready = False
Expand Down Expand Up @@ -509,6 +549,12 @@ def add_cores(self, eth_x, eth_y, x, y, n_cores):

class MainThread(object):
def __init__(self, core_counter, job, save, load):
"""
:param core_counter:
:param job:
:param save:
:param load:
"""
self._done = False
self._thread = Thread(
target=self.run, args=[core_counter, job, save, load])
Expand Down Expand Up @@ -630,6 +676,10 @@ def run(self, core_counter, job, save, load):

class MockJob(object):
def __init__(self, width, height):
"""
:param width:
:param height:
"""
self._boards = list()
self._height = height
self._width = width
Expand Down
38 changes: 38 additions & 0 deletions unittests/test_doc_checker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (c) 2017 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.

import os
import sys
import unittest

from spinn_utilities.config_setup import unittest_setup
from spinn_utilities.testing.docs_checker import DocsChecker


class TestCfgChecker(unittest.TestCase):

def setUp(self) -> None:
unittest_setup()

def test_doc_checks(self) -> None:
class_file = sys.modules[self.__module__].__file__
assert class_file is not None
abs_class_file = os.path.abspath(class_file)
unittest_dir = os.path.dirname(abs_class_file)
repo_dir = os.path.dirname(unittest_dir)
checker = DocsChecker(
check_returns = False, # Depends on typing
check_types_in_docs = False) # Should be moved to typing
checker.check_dir(repo_dir)
checker.check_no_errors()
Loading