Skip to content

Commit

Permalink
typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Jan 23, 2025
1 parent 968d729 commit 563640a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion spynnaker/pyNN/models/neuron/synapse_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from numpy import floating, integer, uint32
from numpy.typing import NDArray

from pacman.model.graphs.application import ApplicationVertex
from pacman.model.graphs.common import Slice

from spinn_front_end_common.utilities.constants import BYTES_PER_WORD
Expand Down Expand Up @@ -696,7 +697,9 @@ def _convert_delayed_data(
return delayed_connections


def __convert_sources_and_targets(connections, pre_vertex, post_vertex_slice):
def __convert_sources_and_targets(
connections: ConnectionsArray, pre_vertex: ApplicationVertex,
post_vertex_slice: Slice) -> ConnectionsArray:
connections["source"] = pre_vertex.get_raster_ordered_indices(
connections["source"])
connections["target"] = post_vertex_slice.get_raster_indices(
Expand Down
4 changes: 2 additions & 2 deletions spynnaker/pyNN/models/neuron/synaptic_matrix_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def append_matrix(

def __get_padding(
self, data_to_write: List[NDArray[uint32]],
expected_offset: int, block_addr: int):
expected_offset: int, block_addr: int) -> int:
if expected_offset < block_addr:
raise ValueError(
"The block address is already beyond where is expected!:"
Expand Down Expand Up @@ -352,7 +352,7 @@ def __get_row_data(

def __update_connection_holders(
self, data: NDArray[uint32], delayed_data: NDArray[uint32],
post_vertex_slice: Slice):
post_vertex_slice: Slice) -> None:
"""
Fill in connections in the connection holders as they are created.
Expand Down

0 comments on commit 563640a

Please sign in to comment.