evspikesim.SpikeArray
- class evspikesim.SpikeArray
An array of Spike. SpikeArray objects must be sorted in time before being used for inference.
- __init__(*args, **kwargs)
Overloaded function.
__init__(self: evspikesim.SpikeArray) -> None
Constructs an empty array of spikes.
__init__(self: evspikesim.SpikeArray, indices: List[int], times: List[float]) -> None
Constructs an array of spikes with the given spike indices and spike timings.
- Parameters
indices (list[int]) – Indices of spikes.
times (list[float]) – Timings of spikes.
__init__(self: evspikesim.SpikeArray, indices: buffer, times: buffer) -> None
Constructs an array of spikes with the given spike indices and spike timings.
- Parameters
indices (buffer) – Indices of spikes. The buffer can be a numpy ndarray. The data type of the buffer must be uint32.
times (buffer) – Timings of spikes. The buffer can be a numpy ndarray. The data type of the buffer must be float32.
Methods
add(*args, **kwargs)Overloaded function.
clear(self)Empties the spike array.
is_empty(self)Checks if the spike array is empty.
sort(self)Sorts the spike array in time.
Attributes
The number of spikes in the array.
- __eq__(self: evspikesim.SpikeArray, arg0: evspikesim.SpikeArray) bool
Checks the equality between two spike arrays.
- Parameters
arg0 (SpikeArray) – The other spike array to compare.
- Returns
True if the two arrays have the same number of spikes and if all the spikes are equals.
- Return type
bool
- __iter__(self: evspikesim.SpikeArray) Iterator
Gets a constant iterator on the first spike.
- Returns
A constant iterator on the first spike.
- Return type
Iterator
- __ne__(self: evspikesim.SpikeArray, arg0: evspikesim.SpikeArray) bool
Checks the equality between two spike arrays.
- Parameters
arg0 (SpikeArray) – The other spike array to compare.
- Returns
True if the two arrays do not have the same number of spikes or if at least one spike is not equal to the corresponding one in rhs.
- Return type
bool
- __repr__(self: evspikesim.SpikeArray) str
Formats the spike array to the given output stream.
- Returns
A string containing all formated spikes.
- Return type
str
- add(*args, **kwargs)
Overloaded function.
add(self: evspikesim.SpikeArray, index: int, time: float) -> None
Adds a single spike to the array.
- Parameters
index (int) – The index of the neuron that fired the spike.
time (float) – The timing of the spike.
add(self: evspikesim.SpikeArray, indices: List[int], times: List[float]) -> None
Adds several spikes to the array given indices and timings.
- Parameters
indices (list[int]) – Neuron indices that fired the spikes.
times (list[float]) – Timings of the spikes.
- clear(self: evspikesim.SpikeArray) None
Empties the spike array.
- is_empty(self: evspikesim.SpikeArray) bool
Checks if the spike array is empty.
- Returns
True if the array is empty.
- Return type
bool
- property n_spikes
The number of spikes in the array.
- sort(self: evspikesim.SpikeArray) None
Sorts the spike array in time. Must be called before being used for inference.