spynnaker.pyNN.utilities package¶
Subpackages¶
- spynnaker.pyNN.utilities.random_stats package
- Module contents
AbstractRandomStats
RandomStatsBinomialImpl
RandomStatsExponentialClippedImpl
RandomStatsExponentialImpl
RandomStatsGammaImpl
RandomStatsLogNormalImpl
RandomStatsNormalClippedImpl
RandomStatsNormalImpl
RandomStatsPoissonImpl
RandomStatsRandIntImpl
RandomStatsScipyImpl
RandomStatsUniformImpl
RandomStatsVonmisesImpl
- Module contents
- spynnaker.pyNN.utilities.ranged package
Submodules¶
spynnaker.pyNN.utilities.bit_field_utilities module¶
- spynnaker.pyNN.utilities.bit_field_utilities.FILTER_HEADER_WORDS = 2¶
n_filters, pointer for array
- spynnaker.pyNN.utilities.bit_field_utilities.get_bitfield_key_map_data(incoming_projections)[source]¶
Get data for the key map region.
- Parameters:
incoming_projections (iterable(Projection)) – The projections to generate bitfields for
- Return type:
- spynnaker.pyNN.utilities.bit_field_utilities.get_sdram_for_bit_field_region(incoming_projections)[source]¶
The SDRAM for the bit field filter region.
- Parameters:
incoming_projections (iterable(Projection)) – The projections that target the vertex in question
- Returns:
the estimated number of bytes used by the bit field region
- Return type:
- spynnaker.pyNN.utilities.bit_field_utilities.get_sdram_for_keys(incoming_projections)[source]¶
Gets the space needed for keys.
- Parameters:
incoming_projections (iterable(Projection)) – The projections that target the vertex in question
- Returns:
SDRAM needed
- Return type:
spynnaker.pyNN.utilities.buffer_data_type module¶
- class spynnaker.pyNN.utilities.buffer_data_type.BufferDataType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
Different functions to retrieve the data.
This class is designed to used internally by NeoBufferDatabase
- EIEIO_SPIKES = 2¶
- MATRIX = 4¶
- MULTI_SPIKES = 3¶
- NEURON_SPIKES = 1¶
- NOT_NEO = 6¶
- REWIRES = 5¶
spynnaker.pyNN.utilities.constants module¶
- spynnaker.pyNN.utilities.constants.LIVE_POISSON_CONTROL_PARTITION_ID = 'CONTROL'¶
The partition ID used for Poisson live control data
- spynnaker.pyNN.utilities.constants.MIN_SUPPORTED_DELAY = 1¶
the minimum supported delay slot between two neurons
- spynnaker.pyNN.utilities.constants.OUT_SPIKE_BYTES = 32¶
The number of bytes for each spike line
- spynnaker.pyNN.utilities.constants.OUT_SPIKE_SIZE = 8¶
The size of each output spike line
- spynnaker.pyNN.utilities.constants.POP_TABLE_MAX_ROW_LENGTH = 256¶
The maximum row length of the master population table
- spynnaker.pyNN.utilities.constants.SPIKE_PARTITION_ID = 'SPIKE'¶
The partition ID used for spike data
- spynnaker.pyNN.utilities.constants.SYNAPSE_SDRAM_PARTITION_ID = 'SDRAM Synaptic Inputs'¶
The name of the partition for Synaptic SDRAM
- spynnaker.pyNN.utilities.constants.SYNAPTIC_ROW_HEADER_WORDS = 3¶
Words: 2 for row length and number of rows and 1 for plastic region size (which might be 0)
- spynnaker.pyNN.utilities.constants.WRITE_BANDWIDTH_BYTES_PER_SECOND = 262144000¶
The conservative amount of write bandwidth available on a chip
spynnaker.pyNN.utilities.data_population module¶
- class spynnaker.pyNN.utilities.data_population.DataPopulation(database_file, label, indexes=None)[source]¶
Bases:
object
- describe(template=None, engine=None)[source]¶
Returns a human-readable description of the population.
The output may be customized by specifying a different template together with an associated template engine (see
pyNN.descriptions
).If
template
isNone
, then a dictionary containing the template context will be returned.
- get_data(variables='all', gather=True, clear=False, annotations=None)[source]¶
Return a Neo Block containing the data (spikes, state variables) recorded from the Assembly.
- Parameters:
variables (str or list(str)) – either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised.
gather (bool) –
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.
clear (bool) – Whether recorded data will be deleted from the
Assembly
.annotations (dict(str, ...)) – annotations to put on the neo block
- Return type:
- Raises:
ConfigurationException – If the variable or variables have not been previously set to record.
- id_to_index(id)[source]¶
Given the ID(s) of cell(s) in the Population, return its (their) index (order in the Population).
Defined by https://neuralensemble.org/docs/PyNN/reference/populations.html
- index_to_id(index)[source]¶
Given the index (order in the Population) of cell(s) in the Population, return their ID(s)
- property label¶
- property local_size¶
- mean_spike_count(gather=True)[source]¶
Returns the mean number of spikes per neuron.
- Parameters:
gather (bool) –
For parallel simulators, if this is True, all data will be gathered to all nodes and the Neo Block will contain data from all nodes. Otherwise, the Neo Block will contain only data from the cells simulated on the local node.
Note
SpiNNaker always gathers.
- Return type:
- property size¶
- spinnaker_get_data(variable, as_matrix=False, view_indexes=None)[source]¶
Public accessor for getting data as a numpy array, instead of the Neo-based object
- write_data(io, variables='all', gather=True, clear=False, annotations=None)[source]¶
Write recorded data to file, using one of the file formats supported by Neo.
- Parameters:
io (neo.io.baseio.BaseIO or str) – a Neo IO instance, or a string for where to put a neo instance
variables (str or list(str)) – either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised.
gather (bool) –
Whether to bring all relevant data together.
Note
SpiNNaker always gathers.
clear (bool) – clears the storage data if set to true after reading it back
annotations (dict(str, ...)) – annotations to put on the neo block
- Raises:
ConfigurationException – If the variable or variables have not been previously set to record.
spynnaker.pyNN.utilities.extracted_data module¶
- class spynnaker.pyNN.utilities.extracted_data.ExtractedData[source]¶
Bases:
object
Data holder for all synaptic data being extracted in parallel.
- get(projection, attribute)[source]¶
Allow getting data from a given projection and attribute.
- Parameters:
projection (Projection) – the projection data was extracted from
attribute (list(int) or tuple(int) or None) – the attribute to retrieve
- Returns:
the attribute data in a connection holder
- Return type:
- set(projection, attribute, data)[source]¶
Allow the addition of data from a projection and attribute.
- Parameters:
projection (Projection) – the projection data was extracted from
attribute (list(int) or tuple(int) or None) – the attribute to store
data (ConnectionHolder) – attribute data in a connection holder
spynnaker.pyNN.utilities.fake_HBP_Portal_machine_provider module¶
spynnaker.pyNN.utilities.neo_buffer_database module¶
- class spynnaker.pyNN.utilities.neo_buffer_database.NeoBufferDatabase(database_file=None, read_only=None)[source]¶
Bases:
BufferDatabase
,NeoCsv
Extra support for Neo on top of the Database for SQLite 3.
This is the same database as used by BufferManager but with extra tables and access methods added.
- Parameters:
- add_segment(block, pop_label, variables, view_indexes=None)[source]¶
Adds a segment to the block.
- Parameters:
pop_label (str) –
The label for the population of interest
Note
This is actually the label of the Application Vertex. Typically the Population label, corrected for None or duplicate values
variables (str, list(str) or None) – One or more variable names or None for all available
view_indexes (None or list(int)) – List of neurons IDs to include or None for all
- Raises:
ConfigurationException – If the recording metadata not setup correctly
- static array_to_string(indexes)[source]¶
Converts a list of integers into a compact string. Works best if the list is sorted.
IDs are comma separated, except when a series of IDs is sequential then the start:end is used.
- csv_block_metadata(csv_file, pop_label, annotations=None)[source]¶
Writes the data including metadata to a CSV file. Overwrites any previous data in the file.
- Parameters:
csvfile (str) – Path to file to write block metadata to
pop_label (str) –
The label for the population of interest
Note
This is actually the label of the Application Vertex. Typically the Population label, corrected for None or duplicate values
annotations (None or dict(str, ...)) – annotations to put on the neo block
- Raises:
ConfigurationException – If the recording metadata not setup correctly
- csv_segment(csv_file, pop_label, variables, view_indexes=None)[source]¶
Writes the data including metadata to a CSV file.
- Parameters:
csvfile (str) – Path to file to write block metadata to
pop_label (str) –
The label for the population of interest
Note
This is actually the label of the Application Vertex. Typical the Population label, corrected for None or duplicate values
variables (str, list(str) or None) – One or more variable names or None for all available
view_indexes (None or list(int)) – List of neurons IDs to include or None for all
- Raises:
ConfigurationException – If the recording metadata not setup correctly
- get_empty_block(pop_label, annotations=None)[source]¶
Creates a block with just metadata but not data segments.
- Parameters:
pop_label (str) –
The label for the population of interest
Note
This is actually the label of the Application Vertex. Typically the Population label, corrected for None or duplicate values
variables (str, list(str) or None) – One or more variable names or None for all available
view_indexes (None or list(int)) – List of neurons IDs to include or None for all
annotations (None or dict(str, ...)) – annotations to put on the neo block
- Returns:
The Neo block
- Return type:
- Raises:
ConfigurationException – If the recording metadata not setup correctly
- get_full_block(pop_label, variables, view_indexes, annotations)[source]¶
Creates a block with metadata and data for this segment. Any previous segments will be empty.
- Parameters:
pop_label (str) –
The label for the population of interest
Note
This is actually the label of the Application Vertex. Typically the Population label, corrected for None or duplicate values
variables (str, list(str) or None) – One or more variable names or None for all available
view_indexes (None or list(int)) – List of neurons IDs to include or None for all
annotations (None or dict(str, ...)) – annotations to put on the neo block
- Returns:
The Neo block
- Return type:
- get_population(pop_label)[source]¶
Gets an Object with the same data retrieval API as a Population.
Retrieval is limited to recorded data and a little metadata needed to create a single Neo Segment wrapped in a Neo Block.
Note
As each database only includes data for one run (with resets creating another database) the structure is relatively simple.
- Parameters:
pop_label (str) –
The label for the population of interest
Note
This is actually the label of the Application Vertex. Typically the Population label, corrected for None or duplicate values
- Returns:
An Object which acts like a Population for getting neo data
- Return type:
- get_population_metdadata(pop_label)[source]¶
Gets the metadata for the population with this label
- Parameters:
pop_label (str) –
The label for the population of interest
Note
This is actually the label of the Application Vertex. Typically the Population label, corrected for None or duplicate values
- Returns:
population size, first id and description
- Return type:
- Raises:
ConfigurationException – If the recording metadata not setup correctly
- get_recording_metadeta(pop_label, variable)[source]¶
Gets the metadata ID for this population and recording label combination.
- Parameters:
- Returns:
data_type, t_start, sampling_interval_ms, first_id, pop_size, units
- Return type:
- Raises:
ConfigurationException – If the recording metadata not setup correctly
- get_recording_populations()[source]¶
Gets a list of the labels of Populations recording. Or to be exact the ones with metadata saved so likely to be recording.
Note
These are actually the labels of the Application Vertices. Typically the Population label, corrected for None or duplicate values
- get_recording_variables(pop_label)[source]¶
List of the names of variables recording. Or, to be exact, list of the names of variables with metadata so likely to be recording.
- Parameters:
pop_label (str) –
The label for the population of interest
Note
This is actually the label of the Application Vertex. Typically the Population label, corrected for None or duplicate values
- Returns:
List of variable names
- static string_to_array(string)[source]¶
Converts a string into a list of integers. Assumes the string was created by
array_to_string()
- write_metadata()[source]¶
Write the current metadata to the database.
Note
The database must be writable for this to work!
spynnaker.pyNN.utilities.neo_compare module¶
- spynnaker.pyNN.utilities.neo_compare.compare_analogsignal(as1, as2, same_length=True)[source]¶
Compares two analog signal objects to see if they are the same.
- Parameters:
as1 (AnalogSignal) – first analog signal holding list of individual analog signal objects
as2 (AnalogSignal) – second analog signal holding list of individual analog signal objects
same_length (bool) – Flag to indicate if the same length of data is held, i.e., all spikes up to the same time. If False allows one trains to have additional data after the first ends. This is used to compare data extracted part way with data extracted at the end.
- Raises:
AssertionError – If the analog signals are not equal
- spynnaker.pyNN.utilities.neo_compare.compare_blocks(neo1, neo2, same_runs=True, same_data=True, same_length=True)[source]¶
Compares two neo Blocks to see if they hold the same data.
- Parameters:
neo1 (Block) – First block to check
neo2 (Block) – Second block to check
same_runs (bool) – Flag to signal if blocks are the same length. If False extra segments in the larger block are ignored
same_data (bool) – Flag to indicate if the same type of data is held, i.e., same spikes, v, gsyn_exc and gsyn_inh. If False only data in both blocks is compared
same_length (bool) – Flag to indicate if the same length of data is held, i.e., all spikes up to the same time. If False allows one trains to have additional data after the first ends. This is used to compare data extracted part way with data extracted at the end.
- Raises:
AssertionError – If the blocks are not equal
- spynnaker.pyNN.utilities.neo_compare.compare_segments(seg1, seg2, same_data=True, same_length=True)[source]¶
- Parameters:
seg1 (Segment) – First Segment to check
seg2 (Segment) – Second Segment to check
same_data (bool) – Flag to indicate if the same type of data is held, i.e., same spikes, v, gsyn_exc and gsyn_inh. If False only data in both blocks is compared
same_length (bool) – Flag to indicate if the same length of data is held, i.e., all spikes up to the same time. If False allows one trains to have additional data after the first ends. This is used to compare data extracted part way with data extracted at the end.
- Raises:
AssertionError – If the segments are not equal
- spynnaker.pyNN.utilities.neo_compare.compare_spiketrain(spiketrain1, spiketrain2, same_length=True)[source]¶
Checks two spike trains have the exact same data.
- Parameters:
spiketrain1 (SpikeTrain) – first spike train
spiketrain2 (SpikeTrain) – second spike train
same_length (bool) – Flag to indicate if the same length of data is held, i.e., all spikes up to the same time. If False allows one trains to have additional spikes after the first ends. This is used to compare data extracted part way with data extracted at the end.
- Raises:
AssertionError – If the spike trains are not equal
- spynnaker.pyNN.utilities.neo_compare.compare_spiketrains(spiketrains1, spiketrains2, same_data=True, same_length=True)[source]¶
Check two Lists of spike trains have the exact same data.
- Parameters:
spiketrains1 (list(SpikeTrain)) – First list of spike trains to compare
spiketrains2 (list(SpikeTrain)) – Second list of spike trains to compare
same_data (bool) – Flag to indicate if the same type of data is held, i.e., same spikes, v, gsyn_exc and gsyn_inh. If False allows one or both lists to be Empty. Even if False none empty lists must be the same length
same_length (bool) – Flag to indicate if the same length of data is held, i.e., all spikes up to the same time. If False allows one trains to have additional spikes after the first ends. This is used to compare data extracted part way with data extracted at the end.
- Raises:
AssertionError – If the spike trains are not equal
spynnaker.pyNN.utilities.neo_convertor module¶
- spynnaker.pyNN.utilities.neo_convertor.convert_analog_signal(signal_array, time_unit=quantities.ms)[source]¶
Converts part of a NEO object into told spynnaker7 format.
- Parameters:
signal_array (AnalogSignal) – Extended Quantities object
time_unit (quantities.unitquantity.UnitTime) – Data time unit for time index
- Return type:
- spynnaker.pyNN.utilities.neo_convertor.convert_data(data, name, run=0)[source]¶
Converts the data into a numpy array in the format ID, time, value.
- spynnaker.pyNN.utilities.neo_convertor.convert_data_list(data, name, runs=None)[source]¶
Converts the data into a list of numpy arrays in the format ID, time, value.
- spynnaker.pyNN.utilities.neo_convertor.convert_gsyn(gsyn_exc, gsyn_inh)[source]¶
Converts two neo objects into the spynnaker7 format.
Note
It is acceptable for both neo parameters to be the same object
- spynnaker.pyNN.utilities.neo_convertor.convert_gsyn_exc_list(data, runs=None)[source]¶
Converts the gsyn_exc into a list numpy array one per segment (all runs) in the format ID, time, value.
- spynnaker.pyNN.utilities.neo_convertor.convert_gsyn_inh_list(data, runs=None)[source]¶
Converts the gsyn_inh into a list numpy array one per segment (all runs) in the format ID, time, value.
- spynnaker.pyNN.utilities.neo_convertor.convert_spikes(neo, run=0)[source]¶
Extracts the spikes for run one from a Neo Object.
- spynnaker.pyNN.utilities.neo_convertor.convert_spiketrains(spiketrains)[source]¶
Converts a list of spiketrains into spynnaker7 format.
- Parameters:
spiketrains (list(SpikeTrain)) – List of SpikeTrains
- Return type:
- spynnaker.pyNN.utilities.neo_convertor.convert_v_list(data, runs=None)[source]¶
Converts the voltage into a list numpy array one per segment (all runs) in the format ID, time, value.
- spynnaker.pyNN.utilities.neo_convertor.count_spikes(neo)[source]¶
Help function to count the number of spikes in a list of spiketrains.
Only counts run 0
- Parameters:
neo (Block) – Neo Object which has spikes in it
- Returns:
The number of spikes in the first segment
- spynnaker.pyNN.utilities.neo_convertor.count_spiketrains(spiketrains)[source]¶
Help function to count the number of spikes in a list of spiketrains.
- Parameters:
spiketrains (list(SpikeTrain)) – List of SpikeTrains
- Returns:
Total number of spikes in all the spiketrains
- Return type:
spynnaker.pyNN.utilities.neo_csv module¶
spynnaker.pyNN.utilities.running_stats module¶
- class spynnaker.pyNN.utilities.running_stats.RunningStats[source]¶
Bases:
object
Keeps running statistics. From: https://www.johndcook.com/blog/skewness_kurtosis/
- property standard_deviation¶
The population standard deviation of the items seen.
- Return type:
spynnaker.pyNN.utilities.struct module¶
- class spynnaker.pyNN.utilities.struct.Struct(fields, repeat_type=StructRepeat.PER_NEURON, default_values=None)[source]¶
Bases:
object
Represents a C code structure.
- Parameters:
- property fields¶
The types and names of the fields, ordered as they appear in the structure.
- get_data(values, vertex_slice=None)[source]¶
Get a numpy array of uint32 of data for the given values.
- get_generator_data(values, vertex_slice=None)[source]¶
Get a numpy array of uint32 of data to generate the given values.
- Parameters:
values (~dict-like) – The values to fill in the data with
vertex_slice (Slice or None) – The vertex slice or None for a structure with repeat_type global, or where a single value repeats for every neuron. If this is not the case and vertex_slice is None, an error will be raised!
- Return type:
ndarray(dtype=”uint32”)
- get_size_in_whole_words(array_size=1)[source]¶
Get the size of the structure in whole words in an array of given size (default 1 item).
- read_data(data, values, data_offset=0, vertex_slice=None)[source]¶
Read a byte string of data and write to values.
- Parameters:
values (RangeDictionary) – The values to update with the read data
data_offset (int) – Index of the byte at the start of the valid data.
offset (int) – The first index into values to write to.
array_size (int or None) – The number of structure copies to read, or None if this is a non-repeating structure.
- property repeat_type¶
How the structure repeats.
- Return type:
- class spynnaker.pyNN.utilities.struct.StructRepeat(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
How a structure repeats, or not, in memory.
- GLOBAL = 0¶
Indicates a single global struct
- PER_NEURON = 1¶
Indicates a struct that repeats per neuron
spynnaker.pyNN.utilities.utility_calls module¶
Utility package containing simple helper functions.
- spynnaker.pyNN.utilities.utility_calls.check_directory_exists_and_create_if_not(filename)[source]¶
Create a parent directory for a file if it doesn’t exist.
- Parameters:
filename (str) – The file whose parent directory is to be created
- spynnaker.pyNN.utilities.utility_calls.check_rng(rng, where)[source]¶
Check for non-None rng parameter since this is no longer compatible with sPyNNaker. If not None, warn or error depending on a config value.
- Parameters:
rng – The rng parameter value.
- spynnaker.pyNN.utilities.utility_calls.convert_param_to_numpy(param, no_atoms)[source]¶
Convert parameters into numpy arrays.
- spynnaker.pyNN.utilities.utility_calls.convert_to(value, data_type)[source]¶
Convert a value to a given data type.
- Parameters:
value – The value to convert
data_type (DataType) – The data type to convert to
- Returns:
The converted data as a numpy data type
- Return type:
ndarray(int32)
- spynnaker.pyNN.utilities.utility_calls.create_mars_kiss_seeds(rng)[source]¶
Generates and checks that the seed values generated by the given random number generator or seed to a random number generator are suitable for use as a mars 64 kiss seed.
- Parameters:
rng (RandomState) – the random number generator.
seed (int or None) – the seed to create a random number generator if not handed.
- Returns:
a list of 4 integers which are used by the mars64 kiss random number generator for seeds.
- Return type:
- spynnaker.pyNN.utilities.utility_calls.get_maximum_probable_value(distribution, n_items, chance=0.01)[source]¶
Get the likely maximum value of a RandomDistribution given a number of draws.
- spynnaker.pyNN.utilities.utility_calls.get_mean(distribution)[source]¶
Get the mean of a RandomDistribution.
- Parameters:
distribution (RandomDistribution) –
- spynnaker.pyNN.utilities.utility_calls.get_minimum_probable_value(distribution, n_items, chance=0.01)[source]¶
Get the likely minimum value of a RandomDistribution given a number of draws.
- Parameters:
distribution (RandomDistribution) –
- spynnaker.pyNN.utilities.utility_calls.get_n_bits(n_values)[source]¶
Determine how many bits are required for the given number of values.
- spynnaker.pyNN.utilities.utility_calls.get_neo_io(file_or_folder)[source]¶
Hack for https://github.com/NeuralEnsemble/python-neo/issues/1287
In Neo 0.12 neo.get_io only works with existing files
- Parameters:
file_or_folder (str) –
- spynnaker.pyNN.utilities.utility_calls.get_probability_within_range(distribution, lower, upper)[source]¶
Get the probability that a value will fall within the given range for a given RandomDistribution.
- spynnaker.pyNN.utilities.utility_calls.get_probable_maximum_selected(n_total_trials, n_trials, selection_prob, chance=0.01)[source]¶
Get the likely maximum number of items that will be selected from a set of n_trials from a total set of n_total_trials with a probability of selection of selection_prob.
- spynnaker.pyNN.utilities.utility_calls.get_probable_minimum_selected(n_total_trials, n_trials, selection_prob, chance=0.01)[source]¶
Get the likely minimum number of items that will be selected from a set of n_trials from a total set of n_total_trials with a probability of selection of selection_prob.
- spynnaker.pyNN.utilities.utility_calls.get_standard_deviation(distribution)[source]¶
Get the standard deviation of a RandomDistribution.
- Parameters:
distribution (RandomDistribution) –
- spynnaker.pyNN.utilities.utility_calls.get_time_to_write_us(n_bytes, n_cores)[source]¶
Determine how long a write of a given number of bytes will take in us.
- spynnaker.pyNN.utilities.utility_calls.get_variance(distribution)[source]¶
Get the variance of a RandomDistribution.
- Parameters:
distribution (RandomDistribution) –
- spynnaker.pyNN.utilities.utility_calls.high(distribution)[source]¶
Gets the high or maximum boundary value for this distribution.
Could return None.
- Parameters:
distribution (RandomDistribution) –
- spynnaker.pyNN.utilities.utility_calls.low(distribution)[source]¶
Gets the high or minimum boundary value for this distribution.
Could return None.
- Parameters:
distribution (RandomDistribution) –
- spynnaker.pyNN.utilities.utility_calls.read_in_data_from_file(file_path, min_atom, max_atom, min_time, max_time, extra=False)[source]¶
Read in a file of data values where the values are in a format of:
<time> <atom ID> <data value>
- Parameters:
file_path (str) – absolute path to a file containing the data
min_atom (int) – min neuron ID to which neurons to read in
max_atom (int) – max neuron ID to which neurons to read in
extra –
min_time (float or int) – min time slot to read neurons values of.
max_time (float or int) – max time slot to read neurons values of.
- Returns:
a numpy array of (time stamp, atom ID, data value)
- Return type:
- spynnaker.pyNN.utilities.utility_calls.read_spikes_from_file(file_path, min_atom=0, max_atom=inf, min_time=0, max_time=inf, split_value='\t')[source]¶
Read spikes from a file formatted as:
<time> <neuron ID>
- Parameters:
file_path (str) – absolute path to a file containing spike values
min_atom (int or float) – min neuron ID to which neurons to read in
max_atom (int or float) – max neuron ID to which neurons to read in
min_time (float or int) – min time slot to read neurons values of.
max_time (float or int) – max time slot to read neurons values of.
split_value (str) – the pattern to split by
- Returns:
a numpy array with max_atom elements each of which is a list of spike times.
- Return type: