Skip to content

Commit

Permalink
typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Jan 20, 2025
1 parent aaf2b3b commit 380a9c9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions spynnaker/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def plot_spikes(spikes, title="spikes"):
spike_data = np.loadtxt("spikes.csv", delimiter=',')
plot_spikes(spike_data)
doubled_spike_data = np.loadtxt("spikes.csv", delimiter=',')
_i: int
for _i, doubled_spike_data_i in enumerate(doubled_spike_data):
doubled_spike_data_i[0] = doubled_spike_data[_i][0] + 5
plot_spikes([spike_data, doubled_spike_data])
4 changes: 2 additions & 2 deletions spynnaker/pyNN/models/neuron/population_machine_neurons.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def __in_selector(self, n: int, selector: Selector) -> bool:

def _write_current_source_parameters(
self, spec: DataSpecificationBase):
n_atoms = self._vertex_slice.n_atoms
n_atoms: int = self._vertex_slice.n_atoms

spec.comment(
f"\nWriting Current Source Parameters for {n_atoms} Neurons:\n")
Expand All @@ -350,7 +350,7 @@ def _write_current_source_parameters(
if current_sources:
# Array to keep track of the number of each type of current source
# (there are four, but they are numbered 1 to 4, so five elements)
cs_index_array = [0, 0, 0, 0, 0]
cs_index_array: List[int] = [0, 0, 0, 0, 0]

# Data sent to the machine will be current sources per neuron
# This array will have the first entry indicating the number of
Expand Down
6 changes: 3 additions & 3 deletions spynnaker/pyNN/utilities/neo_buffer_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import re
import struct
from typing import (
Any, Collection, Dict, Iterable, List, Optional, Sequence, Tuple, Union,
TYPE_CHECKING)
Any, Collection, Dict, Iterable, List, Optional, Sequence, Set, Tuple,
TYPE_CHECKING, Union)

import numpy
from numpy import floating, integer, uint8, uint32
Expand Down Expand Up @@ -785,7 +785,7 @@ def __combine_indexes(
data_set = set(data_indexes)
indexes = [i for i in view_indexes if i in data_set]
# check for missing and report
view_set = set(view_indexes)
view_set: Set[int] = set(view_indexes)
missing = view_set.difference(data_indexes)
if missing:
logger.warning("No {} available for neurons {}",
Expand Down

0 comments on commit 380a9c9

Please sign in to comment.