1616from typing import List , Optional , Tuple , Union , TYPE_CHECKING
1717
1818import numpy
19- from numpy import floating , integer , uint32
19+ from numpy import integer , uint32
2020from numpy .typing import NDArray
2121
2222from pacman .model .graphs .application import ApplicationVertex
3333 AbstractPlasticSynapseDynamics )
3434from spynnaker .pyNN .models .neuron .synapse_dynamics .types import (
3535 NUMPY_CONNECTORS_DTYPE , ConnectionsArray )
36+ from spynnaker .pyNN .types import WeightScales
3637
3738from .master_pop_table import MasterPopTableAsBinarySearch
3839
@@ -217,7 +218,7 @@ def _get_allowed_row_length(
217218def get_synapses (
218219 connections : ConnectionsArray , synapse_info : SynapseInformation ,
219220 n_delay_stages : int , n_synapse_types : int ,
220- weight_scales : NDArray [ floating ] , app_edge : ProjectionApplicationEdge ,
221+ weight_scales : WeightScales , app_edge : ProjectionApplicationEdge ,
221222 max_row_info : MaxRowInfo , gen_undelayed : bool , gen_delayed : bool ,
222223 max_atoms_per_core : int ) -> Tuple [_RowData , _RowData ]:
223224 """
@@ -233,8 +234,7 @@ def get_synapses(
233234 The number of delay stages in total to be represented
234235 :param int n_synapse_types:
235236 The number of synapse types in total to be represented
236- :param list(float) weight_scales:
237- The scaling of the weights for each synapse type
237+ :param weight_scales: The scaling of the weights for each synapse type
238238 :param ~pacman.model.graphs.application.ApplicationEdge app_edge:
239239 The incoming machine edge that the synapses are on
240240 :param MaxRowInfo max_row_info:
@@ -391,7 +391,7 @@ def _get_row_data(
391391def convert_to_connections (
392392 synapse_info : SynapseInformation , post_vertex_slice : Slice ,
393393 n_pre_atoms : int , max_row_length : int , n_synapse_types : int ,
394- weight_scales : NDArray [ floating ] , data : Union [bytes , NDArray , None ],
394+ weight_scales : WeightScales , data : Union [bytes , NDArray , None ],
395395 delayed : bool , post_vertex_max_delay_ticks : int ,
396396 max_atoms_per_core : int ) -> ConnectionsArray :
397397 """
@@ -407,7 +407,7 @@ def convert_to_connections(
407407 The length of each row in the data
408408 :param int n_synapse_types:
409409 The number of synapse types in total
410- :param list(float) weight_scales:
410+ :param weight_scales:
411411 The weight scaling of each synapse type
412412 :param bytearray data:
413413 The raw data containing the synapses
@@ -461,7 +461,7 @@ def convert_to_connections(
461461def read_all_synapses (
462462 data : NDArray [uint32 ], delayed_data : NDArray [uint32 ],
463463 synapse_info : SynapseInformation , n_synapse_types : int ,
464- weight_scales : NDArray [ floating ] , post_vertex_slice : Slice ,
464+ weight_scales : WeightScales , post_vertex_slice : Slice ,
465465 n_pre_atoms : int , post_vertex_max_delay_ticks : int ,
466466 max_row_info : MaxRowInfo , max_atoms_per_core : int
467467 ) -> ConnectionsArray :
@@ -477,7 +477,7 @@ def read_all_synapses(
477477 The synapse info that generated the synapses
478478 :param int n_synapse_types:
479479 The total number of synapse types available
480- :param list(float) weight_scales:
480+ :param weight_scales:
481481 A weight scale for each synapse type
482482 :param int n_pre_atoms: The number of atoms in the pre-vertex
483483 :param ~pacman.model.graphs.common.Slice post_vertex_slice:
@@ -638,13 +638,13 @@ def _read_plastic_data(
638638
639639
640640def _rescale_connections (
641- connections : ConnectionsArray , weight_scales : NDArray [ floating ] ,
641+ connections : ConnectionsArray , weight_scales : WeightScales ,
642642 synapse_info : SynapseInformation ) -> ConnectionsArray :
643643 """
644644 Scale the connection data into machine values.
645645
646646 :param ~numpy.ndarray connections: The connections to be rescaled
647- :param list(float) weight_scales: The weight scale of each synapse type
647+ :param weight_scales: The weight scale of each synapse type
648648 :param SynapseInformation synapse_info:
649649 The synapse information of the connections
650650 """
0 commit comments