Skip to content

Commit

Permalink
Merge branch 'master' into fix_connection_selection
Browse files Browse the repository at this point in the history
Conflicts:
	spinnman/processes/most_direct_connection_selector.py
  • Loading branch information
rowleya committed Nov 12, 2020
2 parents 9fafc63 + f1784d1 commit 6ff9102
Show file tree
Hide file tree
Showing 187 changed files with 2,948 additions and 3,030 deletions.
108 changes: 108 additions & 0 deletions .github/workflows/python_actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Copyright (c) 2020 The University of Manchester
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# 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/>.

# This workflow will install Python dependencies, run tests, lint and rat with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python Actions

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.6, 3.7, 3.8]

steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Checkout
uses: actions/checkout@v2
- name: Checkout SupportScripts
uses: actions/checkout@v2
with:
repository: SpiNNakerManchester/SupportScripts
path: support

- name: Checkout Spinnaker Dependencies
run: |
support/gitclone2.sh https://github.com/SpiNNakerManchester/SpiNNUtils.git
support/gitclone2.sh https://github.com/SpiNNakerManchester/SpiNNMachine.git
- name: Install -pip
run: |
python -m pip install --upgrade pip
pip install 'pylint<2.5' python-coveralls 'coverage>=4.4,<5.0'
- name: Install SpiNNUtils
run: python setup.py install
working-directory: SpiNNUtils

- name: Install SpiNNMachine
run: python setup.py install
working-directory: SpiNNMachine

- name: Install
run: |
python setup.py develop
pip install -r requirements-test.txt
- name: Test with pytest and coverage
if: matrix.python-version == 3.6
run: |
pytest unittests --cov spinnman
- name: Test with pytest
if: matrix.python-version != 3.6
run: |
pytest unittests
- name: Lint with flake8
run: |
# run flake8
flake8 spinnman unittests
- name: Lint with pylint
# Note that there's special conditioning of the return code of pylint
run: |
pylint --output-format=colorized --disable=R,C spinnman || exit $(($? & 35))
- name: Run rat copyright enforcement
if: matrix.python-version == 3.6
run: |
support/rat.sh download
support/rat.sh run
- name: Build documentation with sphinx
if: matrix.python-version == 3.6
run: |
cd doc/source
sphinx-build -W -T -E -b html -d _build/doctrees-readthedocsdirhtml -D language=en . _build/html
sphinx-build -W -T -b json -d _build/doctrees-json -D language=en . _build/json
sphinx-build -W -T -b singlehtml -d _build/doctrees-readthedocssinglehtmllocalmedia -D language=en . _build/localmedia
- name: Run coveralls and report coverage
if: matrix.python-version == 3.6
env:
COVERALLS_SERVICE_NAME: 'GitHub CI'
COVERALLS_REPO_TOKEN : ${{ secrets.COVERALLS_REPO_TOKEN }}
NODE_COVERALLS_DEBUG: 1
run: coveralls
2 changes: 2 additions & 0 deletions .ratexcludes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
**/file_data/*
**/SpiNNUtils/**
**/SpiNNMachine/**
29 changes: 19 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

language: python
python:
- 2.7
- 3.6
- 3.7
dist: xenial
os: linux
jobs:
include:
- name: Py3.6
python: 3.6
dist: bionic
- name: Py3.7
python: 3.7
dist: focal
- name: Py3.8
python: 3.8
dist: focal
- name: Py2.7 (legacy)
python: 2.7
dist: xenial
addons:
apt:
packages:
Expand All @@ -31,17 +41,16 @@ before_install:
- git clone https://github.com/SpiNNakerManchester/SupportScripts.git support
- python support/travis_blocking_stdout.py
- support/rat.sh download
# Bring pip up to date
# Bring pip up to date
- pip install --upgrade pip setuptools wheel
# SpiNNakerManchester internal dependencies; development mode
- support/pipinstall.sh git://github.com/SpiNNakerManchester/SpiNNUtils.git
- support/pipinstall.sh git://github.com/SpiNNakerManchester/SpiNNMachine.git
- support/pipinstall.sh git://github.com/SpiNNakerManchester/SpiNNStorageHandlers.git

install:
- python ./setup.py install
- pip install -r requirements-test.txt
- pip install pylint python-coveralls 'coverage>=4.4'
- pip install 'pylint<2.5' python-coveralls 'coverage>=4.4,<5.0'
- pip install spinnaker_proxy

script:
Expand All @@ -52,8 +61,8 @@ script:
- support/rat.sh run
- cd doc/source
- sphinx-build -T -E -b html -d _build/doctrees-readthedocsdirhtml -D language=en . _build/html
- sphinx-build -T -b json -d _build/doctrees-json -D language=en . _build/json
- sphinx-build -T -b singlehtml -d _build/doctrees-readthedocssinglehtmllocalmedia -D language=en . _build/localmedia
- sphinx-build -q -T -b json -d _build/doctrees-json -D language=en . _build/json
- sphinx-build -q -T -b singlehtml -d _build/doctrees-readthedocssinglehtmllocalmedia -D language=en . _build/localmedia

after_success:
- cd $TRAVIS_BUILD_DIR
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Build Status](https://api.travis-ci.org/SpiNNakerManchester/SpiNNMan.svg?branch=master)](https://travis-ci.org/SpiNNakerManchester/SpiNNMan)
[![Build Status](https://api.travis-ci.com/SpiNNakerManchester/SpiNNMan.svg?branch=master)](https://travis-ci.com/SpiNNakerManchester/SpiNNMan)
[![Documentation Status](https://readthedocs.org/projects/spinnman/badge/?version=latest)](https://spinnman.readthedocs.io/en/latest/?badge=latest)
[![Coverage Status](https://coveralls.io/repos/github/SpiNNakerManchester/SpiNNMan/badge.svg?branch=master)](https://coveralls.io/github/SpiNNakerManchester/SpiNNMan?branch=master)


Expand Down
1 change: 0 additions & 1 deletion doc/doc_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ six
enum34
-e git+https://github.com/SpiNNakerManchester/SpiNNUtils.git@master#egg=spinn_utilities
-e git+https://github.com/SpiNNakerManchester/SpiNNMachine.git@master#egg=SpiNNMachine
-e git+https://github.com/SpiNNakerManchester/SpiNNStorageHandlers.git@master#egg=spinn_storage_handlers
35 changes: 26 additions & 9 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,16 @@
'sphinx.ext.intersphinx'
]

intersphinx_mapping = {'spinn_machine':
('http://spinnmachine.readthedocs.org/en/latest/',
None),
'spinn_storage_handlers':
('http://spinnmachine.readthedocs.io/en/latest/',
None)
}
intersphinx_mapping = {
'python': ('https://docs.python.org/3.6', None),
'spinn_utilities': (
'https://spinnutils.readthedocs.io/en/latest/', None),
'spinn_machine': (
'https://spinnmachine.readthedocs.io/en/latest/', None),
# WARNING! This is a forward reference!
'spinn_front_end_common': (
'https://spinnfrontendcommon.readthedocs.io/en/latest/', None),
}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand All @@ -74,7 +77,7 @@

# General information about the project.
project = u'SpiNNMan'
copyright = u'2014-2017'
copyright = u'2014-2020'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -366,4 +369,18 @@
if (os.path.isfile(f) and f.endswith(
".rst") and f != "index.rst" and f != "modules.rst"):
os.remove(f)
apidoc.main([None, '-o', ".", "../../spinnman"])
apidoc.main([None, '-o', ".", "../../spinnman",
"../../spinnman/connections/[au]*/[a-z]*.py",
"../../spinnman/connections/[cst]*.py",
"../../spinnman/messages/eieio/*_messages/[a-z]*.py",
"../../spinnman/messages/eieio/cr*.py",
"../../spinnman/messages/eieio/ei*.py",
"../../spinnman/messages/scp/[aei]*/[a-z]*.py",
"../../spinnman/messages/scp/s*.py",
"../../spinnman/messages/sdp/[a-z]*.py",
"../../spinnman/messages/spinnaker_boot/s*.py",
"../../spinnman/model/[a-df-z]*.py",
"../../spinnman/model/en*/[a-z]*.py",
"../../spinnman/model/ex*.py",
"../../spinnman/processes/[a-z]*.py",
])
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Contents
.. toctree::
:maxdepth: 4

spinnman
modules


Indices and tables
Expand Down
2 changes: 1 addition & 1 deletion hello.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void timer_callback(uint unused0, uint unused1) {
spin1_exit(0);
}

void c_main() {
void c_main(void) {
io_printf(IO_BUF, "Starting...\n");
spin1_set_timer_tick(1000);
spin1_callback_on(TIMER_TICK, timer_callback, 1);
Expand Down
3 changes: 1 addition & 2 deletions pypi_to_import
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
SpiNNUtilities:spinn_utilities
enum34:enum
SpiNNMachine:spinn_machine
SpiNNStorageHandlers:spinn_storage_handlers
SpiNNMachine:spinn_machine
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
-r requirements.txt
flake8
numpy
coverage >= 4.4, < 5.0
# pytest will be brought in by pytest-cov
pytest-cov
sphinx==1.5.3
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ six
future
enum34
futures; python_version == "2.7"
SpiNNUtilities >= 1!5.0.1, < 1!6.0.0
SpiNNMachine >= 1!5.0.1, < 1!6.0.0
SpiNNStorageHandlers >= 1!5.0.1, < 1!6.0.0
SpiNNUtilities >= 1!5.1.1, < 1!6.0.0
SpiNNMachine >= 1!5.1.1, < 1!6.0.0
13 changes: 5 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
from setuptools import setup
except ImportError:
from distutils.core import setup
try:
from collections.abc import defaultdict
except ImportError:
from collections import defaultdict
from collections import defaultdict
import os

__version__ = None
Expand Down Expand Up @@ -59,7 +56,7 @@
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",

"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",

"Natural Language :: English",

Expand All @@ -71,13 +68,13 @@
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
packages=packages,
package_data=package_data,
install_requires=[
'SpiNNUtilities >= 1!5.0.1, < 1!6.0.0',
'SpiNNStorageHandlers >= 1!5.0.1, < 1!6.0.0',
'SpiNNMachine >= 1!5.0.1, < 1!6.0.0',
'SpiNNUtilities >= 1!5.1.1, < 1!6.0.0',
'SpiNNMachine >= 1!5.1.1, < 1!6.0.0',
'enum34',
'future',
'futures; python_version == "2.7"',
Expand Down
6 changes: 3 additions & 3 deletions spinnman/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

__version__ = "1!5.0.1"
__version_month__ = "August"
__version__ = "1!5.1.1"
__version_month__ = "November"
__version_year__ = "2019"
__version_day__ = "09"
__version_day__ = "15"
__version_name__ = "Liveware Problem"
11 changes: 4 additions & 7 deletions spinnman/connections/abstract_classes/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@

from six import add_metaclass
from spinn_utilities.abstract_base import AbstractBase, abstractmethod
from spinn_utilities.abstract_context_manager import AbstractContextManager


@add_metaclass(AbstractBase)
class Connection(object):
class Connection(AbstractContextManager):
""" An abstract connection to the SpiNNaker board over some medium
"""

Expand All @@ -30,16 +31,12 @@ def is_connected(self):
:return: True if the medium is connected, False otherwise
:rtype: bool
:raise spinnman.exceptions.SpinnmanIOException: \
If there is an error when determining the connectivity of the\
:raise SpinnmanIOException:
If there is an error when determining the connectivity of the
medium.
"""

@abstractmethod
def close(self):
""" Closes the connection
:return: Nothing is returned
:rtype: None
:raise None: No known exceptions are raised
"""
16 changes: 7 additions & 9 deletions spinnman/connections/abstract_classes/eieio_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,17 @@ def receive_eieio_message(self, timeout=None):
""" Receives an EIEIO message from this connection. Blocks until\
a message has been received, or a timeout occurs.
:param timeout: \
The time in seconds to wait for the message to arrive; if not\
:param int timeout:
The time in seconds to wait for the message to arrive; if not
specified, will wait forever, or until the connection is closed
:type timeout: int
:return: an EIEIO message
:rtype:\
:py:class:`spinnman.messages.eieio.AbstractEIEIOMessage`
:raise spinnman.exceptions.SpinnmanIOException: \
:rtype: AbstractEIEIOMessage
:raise SpinnmanIOException:
If there is an error receiving the message.
:raise spinnman.exceptions.SpinnmanTimeoutException: \
:raise SpinnmanTimeoutException:
If there is a timeout before a message is received.
:raise spinnman.exceptions.SpinnmanInvalidPacketException: \
:raise SpinnmanInvalidPacketException:
If the received packet is not a valid EIEIO message.
:raise spinnman.exceptions.SpinnmanInvalidParameterException: \
:raise SpinnmanInvalidParameterException:
If one of the fields of the EIEIO message is invalid.
"""
Loading

0 comments on commit 6ff9102

Please sign in to comment.