Skip to content

Commit

Permalink
Merge branch 'master' into minor-import-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
dkfellows committed Jun 28, 2018
2 parents 346aedf + 1c0aa89 commit 04dbb8d
Show file tree
Hide file tree
Showing 21 changed files with 209 additions and 173 deletions.
4 changes: 2 additions & 2 deletions spynnaker8/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,10 @@ def _create_overloaded_functions(spinnaker_simulator):


def end(_=True):
""" Cleans up the spiNNaker machine and software
""" Cleans up the SpiNNaker machine and software
:param _: was named compatible_output, which we don't care about,\
so is a none existent parameter
so is a non-existent parameter
:rtype: None
"""
for (population, variables, filename) in \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


class PushBotLifSpinnakerLinkDataHolder(DataHolder):
""" Control module for a pushbot connected to a SpiNNaker Link
""" Control module for a PushBot connected to a SpiNNaker Link
"""

def __init__(
Expand Down
14 changes: 8 additions & 6 deletions spynnaker8/external_devices/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
The :py:mod:`spynnaker.pynn` package contains the front end specifications
The :py:mod:`spynnaker.pyNN` package contains the front end specifications
and implementation for the PyNN High-level API
(http://neuralensemble.org/trac/PyNN)
"""
Expand Down Expand Up @@ -73,17 +73,17 @@
"MunichRetinaDevice", "MunichMotorDevice", "ArbitraryFPGADevice",
"PushBotRetinaViewer", "ExternalDeviceLifControl",

# Pushbot Parameters
# PushBot Parameters
"MunichIoSpiNNakerLinkProtocol",
"PushBotLaser", "PushBotLED", "PushBotMotor", "PushBotSpeaker",
"PushBotRetinaResolution",

# Pushbot Ethernet Parts
# PushBot Ethernet Parts
"PushBotLifEthernet", "PushBotEthernetLaserDevice",
"PushBotEthernetLEDDevice", "PushBotEthernetMotorDevice",
"PushBotEthernetSpeakerDevice", "PushBotEthernetRetinaDevice",

# Pushbot SpiNNaker Link Parts
# PushBot SpiNNaker Link Parts
"PushBotLifSpinnakerLink", "PushBotSpiNNakerLinkLaserDevice",
"PushBotSpiNNakerLinkLEDDevice", "PushBotSpiNNakerLinkMotorDevice",
"PushBotSpiNNakerLinkSpeakerDevice", "PushBotSpiNNakerLinkRetinaDevice",
Expand All @@ -103,10 +103,10 @@


def run_forever():
""" supports running forever in pynn 0.8/0.9 format
""" Supports running forever in PyNN 0.8/0.9 format
:return: returns when the application has started running on the\
SpiNNaker platform.
SpiNNaker platform.
"""
AbstractSpiNNakerCommon.run(globals_variables.get_simulator(), None)

Expand All @@ -128,6 +128,7 @@ def EthernetControlPopulation(
database_notify_port_num=None, database_ack_port_num=None):
""" Create a PyNN population that can be included in a network to\
control an external device which is connected to the host
:param n_neurons: The number of neurons in the control population
:param model: Class of a model that implements AbstractEthernetController
:param label: An optional label for the population
Expand Down Expand Up @@ -181,6 +182,7 @@ def EthernetSensorPopulation(
database_notify_port_num=None, database_ack_port_num=None):
""" Create a pyNN population which can be included in a network to\
receive spikes from a device connected to the host
:param device: Class of a model that implements AbstractEthernetController
:param local_host:\
The optional local host IP address to listen on for database\
Expand Down
4 changes: 2 additions & 2 deletions spynnaker8/extra_models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
WeightDependenceAdditiveTriplet)

__all__ = [
# spynnaker 8 models
# sPyNNaker 8 models
'IFCurDelta', 'IFCurrExpCa2Adaptive', 'IFCondExpStock',
'Izhikevich_cond', 'IF_curr_dual_exp',

# spynnaker 8 plastic stuff
# sPyNNaker 8 plastic stuff
'WeightDependenceAdditiveTriplet',
'PfisterSpikeTriplet',
'SpikeNearestPairRule',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class FixedNumberPostConnector(CommonFixedNumberPostConnector,
PyNNFixedNumberPostConnector):
""" pynn connector that puts a fixed number of connections on each of the\
""" PyNN connector that puts a fixed number of connections on each of the\
post neurons
"""
__slots__ = []
Expand Down
7 changes: 4 additions & 3 deletions spynnaker8/models/connectors/fixed_probability_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ class FixedProbabilityConnector(
def __init__(
self, p_connect, allow_self_connections=True, safe=True,
verbose=False, rng=None, callback=None):
""" For each pair of pre-post cells, the connection probability is
constant.
""" For each pair of pre-post cells, the connection probability is\
constant.
:param p_connect: a float between zero and one. Each potential\
:param p_connect: a number between zero and one. Each potential\
connection is created with this probability.
:type p_connect: float
:param allow_self_connections: if the connector is used to connect a\
Population to itself, this flag determines whether a neuron is\
allowed to connect to itself, or only to other neurons in the\
Expand Down
29 changes: 14 additions & 15 deletions spynnaker8/models/connectors/from_list_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,23 @@ class FromListConnector(CommonFromListConnector, Connector):
def __init__(
self, conn_list, safe=True, verbose=False, column_names=None,
callback=None):
""" Creates a new FromListConnector.
:param: conn_list: \
"""
:param conn_list: \
a list of tuples, one tuple for each connection. Each tuple\
should contain: (pre_idx, post_idx, p1, p2, ..., pn) where\
pre_idx is the index (i.e. order in the Population, not the ID)\
of the presynaptic neuron, post_idx is the index of the\
postsynaptic neuron, and p1, p2, etc. are the synaptic parameters\
(e.g. weight, delay, plasticity parameters).
should contain: `(pre_idx, post_idx, p1, p2, ..., pn)` where\
`pre_idx` is the index (i.e. order in the Population, not the ID)\
of the presynaptic neuron, `post_idx` is the index of the\
postsynaptic neuron, and `p1`, `p2`, etc. are the synaptic\
parameters (e.g., weight, delay, plasticity parameters).
:param column_names: \
the names of the parameters p1, p2, etc. If not provided, it is\
assumed the parameters are weight, delay (for\
backwards compatibility).
assumed the parameters are weight, delay (for\
backwards compatibility).
:param safe: \
if True, check that weights and delays have valid values. If\
False, this check is skipped.
:param callback:
if True, display a progress bar on the terminal.
:param callback: \
if given, a callable that display a progress bar on the terminal.
"""
# pylint: disable=too-many-arguments
if conn_list is None or not len(conn_list):
Expand Down Expand Up @@ -80,15 +79,15 @@ def __init__(
self.set_weights_and_delays(weights, delays)

def get_extra_parameters(self):
""" getter for the extra parameters
""" Getter for the extra parameters.
:return:
"""
return self._extra_conn_data

def _verify_extra_data_meets_constraints(self):
""" safety check for current impl, stops extra params to be\
variable per atom
""" Safety check for current implementation, stops extra parameters\
from being variable per atom.
:return: None
:raises InvalidParameterType: when the parameters are not constant
Expand Down
3 changes: 1 addition & 2 deletions spynnaker8/models/connectors/one_to_one_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ class OneToOneConnector(CommonOneToOneConnector, PyNNOneToOneConnector):
__slots__ = []

def __init__(self, safe=True, callback=None):
""" the one to one connector constructor
"""
:param safe: if True, check that weights and delays have valid values.\
If False, this check is skipped.
:param callback: a function that will be called with the fractional \
Expand Down
4 changes: 2 additions & 2 deletions spynnaker8/models/data_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def get_data(self, variable):
:param variable: name of variable to get cache for
:rtype variable: str
:return: The cache data, ids, indexes and units
:return: The cache data, IDs, indexes and units
:rtype: VariableCache
"""
return self._cache[variable]
Expand All @@ -97,7 +97,7 @@ def save_data(self, variable, data, indexes, n_neurons, units,
:param variable: name of variable data applies to
:type variable: str
:param data: raw data in spynnaker format
:param data: raw data in sPyNNaker format
:type data: nparray
:param indexes: population indexes for which data should be returned
:type indexes: nparray
Expand Down
12 changes: 9 additions & 3 deletions spynnaker8/models/populations/population.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,16 @@ def get_data(
names. Variables must have been previously recorded, otherwise an
Exception will be raised.
:type variables: str or list
:param: Whether to collect data from all MPI nodes or just the current\
node (irrelevant on sPyNNaker, which always behaves as if True)
:param gather: Whether to collect data from all MPI nodes or just the\
current node.
.. note::
This is irrelevant on sPyNNaker, which always behaves as if
this parameter is True.
:type gather: bool
:param: Whether recorded data will be deleted from the `Assembly`.
:param clear: \
Whether recorded data will be deleted from the `Assembly`.
:type clear: bool
:param annotations: annotations to put on the neo block
:type annotations: dict
Expand Down
Loading

0 comments on commit 04dbb8d

Please sign in to comment.