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..30aeb027 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 @@ -13,7 +13,7 @@ # limitations under the License. import multiprocessing -import tkinter as tk +#import tkinter as tk import pyNN.spiNNaker as Frontend from pyNN.utility.plotting import Figure, Panel import matplotlib.pyplot as plt @@ -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 diff --git a/pendulum/pendulum_follow_c_vis.py b/pendulum/pendulum_follow_c_vis.py index 72577647..6de17527 100644 --- a/pendulum/pendulum_follow_c_vis.py +++ b/pendulum/pendulum_follow_c_vis.py @@ -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(",")] diff --git a/pendulum/pendulum_follow_python_vis.py b/pendulum/pendulum_follow_python_vis.py index 6174e12d..0dc457aa 100644 --- a/pendulum/pendulum_follow_python_vis.py +++ b/pendulum/pendulum_follow_python_vis.py @@ -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(",")] diff --git a/pendulum/spike_filter.py b/pendulum/spike_filter.py index 0f0e616d..cf5914ef 100644 --- a/pendulum/spike_filter.py +++ b/pendulum/spike_filter.py @@ -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(",")] diff --git a/spiNNaker_start/spinnaker_start.py b/spiNNaker_start/spinnaker_start.py index 7b45c960..b2c6fd4f 100644 --- a/spiNNaker_start/spinnaker_start.py +++ b/spiNNaker_start/spinnaker_start.py @@ -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, @@ -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 @@ -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 @@ -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 @@ -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, @@ -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 @@ -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]) @@ -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 diff --git a/unittests/test_doc_checker.py b/unittests/test_doc_checker.py new file mode 100644 index 00000000..49a434a0 --- /dev/null +++ b/unittests/test_doc_checker.py @@ -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()