From 1855567acd613c13adb9f47b36582bc03e8c5cd9 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Wed, 25 Jun 2025 11:30:06 +0100 Subject: [PATCH 1/7] remove typing from docs --- spynnaker/pyNN/__init__.py | 68 ++----- .../ethernet_command_connection.py | 10 +- .../ethernet_control_connection.py | 16 +- .../spif_live_spikes_connection.py | 35 ++-- .../spynnaker_live_spikes_connection.py | 20 +- .../spynnaker_poisson_control_connection.py | 20 +- spynnaker/pyNN/data/spynnaker_data_view.py | 20 +- spynnaker/pyNN/data/spynnaker_data_writer.py | 4 - spynnaker/pyNN/external_devices/__init__.py | 32 +--- .../abstract_ethernet_controller.py | 6 - .../abstract_ethernet_sensor.py | 10 - .../abstract_ethernet_translator.py | 2 - .../abstract_multicast_controllable_device.py | 16 -- .../arbitrary_fpga_device.py | 9 +- .../external_device_lif_control.py | 27 ++- .../external_device_lif_control_vertex.py | 22 +-- ...ernal_spinnaker_link_fpga_retina_device.py | 32 ++-- .../icub_retina_device.py | 13 +- .../machine_munich_motor_device.py | 15 +- .../munich_spinnaker_link_motor_device.py | 18 +- .../munich_spinnaker_link_retina_device.py | 18 +- .../abstract_push_bot_output_device.py | 6 +- .../push_bot/control/push_bot_lif_ethernet.py | 32 ++-- .../control/push_bot_lif_spinnaker_link.py | 28 ++- .../push_bot/ethernet/push_bot_device.py | 15 +- .../ethernet/push_bot_laser_device.py | 5 +- .../push_bot/ethernet/push_bot_led_device.py | 4 +- .../ethernet/push_bot_motor_device.py | 4 +- .../ethernet/push_bot_retina_connection.py | 10 +- .../ethernet/push_bot_retina_device.py | 11 +- .../ethernet/push_bot_speaker_device.py | 13 +- .../push_bot/ethernet/push_bot_translator.py | 4 +- .../ethernet/push_bot_wifi_connection.py | 18 +- .../parameters/push_bot_retina_viewer.py | 2 - .../spinnaker_link/push_bot_laser_device.py | 16 +- .../spinnaker_link/push_bot_led_device.py | 14 +- .../spinnaker_link/push_bot_motor_device.py | 10 +- .../spinnaker_link/push_bot_retina_device.py | 10 +- .../spinnaker_link/push_bot_speaker_device.py | 14 +- .../external_devices_models/spif_devices.py | 124 +++++------- .../spif_input_device.py | 7 +- .../spif_output_device.py | 19 +- .../spif_retina_device.py | 17 +- ...threshold_type_multicast_device_control.py | 2 +- .../connection_holder_finisher.py | 2 - .../extra_algorithms/delay_support_adder.py | 23 +-- .../pyNN/extra_algorithms/neuron_expander.py | 8 +- .../abstract_spynnaker_splitter_delay.py | 3 - .../splitter_delay_vertex_slice.py | 4 - .../splitter_poisson_delegate.py | 2 - .../splitter_population_vertex.py | 2 - .../splitter_population_vertex_fixed.py | 25 +-- ...tter_population_vertex_neurons_synapses.py | 65 +++---- .../splitter_components/splitter_utils.py | 11 +- ...spynnaker_connection_holder_generations.py | 8 - ...ker_neuron_network_specification_report.py | 14 +- .../spynnaker_synaptic_matrix_report.py | 3 - .../pyNN/extra_algorithms/synapse_expander.py | 1 - .../abstract_accepts_incoming_synapses.py | 12 +- .../abstract_has_delay_stages.py | 2 - .../abstract_neuron_expandable.py | 7 +- .../abstract_synapse_expandable.py | 11 +- .../coloured_application_vertex.py | 2 - .../abstract_models/has_shape_key_fields.py | 3 +- .../models/abstract_models/has_synapses.py | 10 +- .../receives_synaptic_inputs_over_sdram.py | 4 - .../sends_synaptic_inputs_over_sdram.py | 2 - .../abstract_models/supports_structure.py | 2 +- .../models/common/eieio_spike_recorder.py | 2 +- .../models/common/local_only_2d_common.py | 12 +- .../models/common/multi_spike_recorder.py | 5 +- .../pyNN/models/common/neuron_recorder.py | 181 +++++------------- .../models/common/param_generator_data.py | 12 +- .../pyNN/models/common/parameter_holder.py | 11 -- .../common/population_application_vertex.py | 70 ++----- .../pyNN/models/common/recording_utils.py | 3 +- .../abstract_current_source.py | 18 +- .../pyNN/models/current_sources/ac_source.py | 16 +- .../pyNN/models/current_sources/dc_source.py | 6 +- .../current_sources/noisy_current_source.py | 10 +- .../current_sources/step_current_source.py | 4 +- .../connectors/abstract_connector.py | 116 +++-------- .../abstract_generate_connector_on_host.py | 9 +- .../abstract_generate_connector_on_machine.py | 22 +-- .../connectors/all_to_all_connector.py | 10 +- .../connectors/array_connector.py | 7 +- .../connectors/convolution_connector.py | 45 ++--- .../connectors/csa_connector.py | 17 +- ...istance_dependent_probability_connector.py | 19 +- .../connectors/fixed_number_post_connector.py | 30 +-- .../connectors/fixed_number_pre_connector.py | 19 +- .../connectors/fixed_probability_connector.py | 7 +- .../connectors/from_file_connector.py | 11 +- .../connectors/from_list_connector.py | 21 +- .../index_based_probability_connector.py | 18 +- .../connectors/kernel_connector.py | 52 +---- .../connectors/multapse_connector.py | 25 +-- .../connectors/pool_dense_connector.py | 41 ++-- .../connectors/small_world_connector.py | 17 +- .../delayed_application_edge.py | 19 +- .../projection_application_edge.py | 33 +--- .../neural_projections/synapse_information.py | 66 +------ .../additional_input_ca2_adaptive.py | 12 -- .../models/neuron/builds/if_cond_exp_base.py | 28 --- .../models/neuron/builds/if_cond_exp_stoc.py | 32 ---- .../models/neuron/builds/if_curr_alpha.py | 30 --- .../models/neuron/builds/if_curr_delta.py | 20 -- .../builds/if_curr_delta_ca2_adaptive.py | 26 --- .../neuron/builds/if_curr_delta_fixed_prob.py | 22 --- .../neuron/builds/if_curr_dual_exp_base.py | 28 --- .../models/neuron/builds/if_curr_exp_base.py | 24 --- .../neuron/builds/if_curr_exp_ca2_adaptive.py | 30 --- .../neuron/builds/if_curr_exp_semd_base.py | 34 ---- .../models/neuron/builds/if_trunc_delta.py | 18 -- .../neuron/builds/izk_cond_dual_exp_base.py | 30 --- .../models/neuron/builds/izk_cond_exp_base.py | 26 --- .../models/neuron/builds/izk_curr_exp_base.py | 22 --- .../implementations/abstract_neuron_impl.py | 37 +--- .../abstract_standard_neuron_component.py | 17 +- .../implementations/neuron_impl_standard.py | 15 +- .../neuron/input_types/abstract_input_type.py | 1 - .../input_types/input_type_conductance.py | 4 - .../neuron/local_only/abstract_local_only.py | 14 +- .../local_only/local_only_convolution.py | 5 +- .../local_only/local_only_pool_dense.py | 3 +- .../neuron_models/neuron_model_if_trunc.py | 26 --- .../neuron/neuron_models/neuron_model_izh.py | 28 --- .../neuron_model_leaky_integrate_and_fire.py | 28 --- .../models/neuron/plasticity/stdp/common.py | 10 +- .../abstract_synapse_structure.py | 4 - .../abstract_timing_dependence.py | 24 +-- ...timing_dependence_pfister_spike_triplet.py | 30 +-- .../timing_dependence_recurrent.py | 28 +-- .../timing_dependence_spike_pair.py | 22 +-- .../timing_dependence_vogels_2011.py | 22 +-- .../abstract_has_a_plus_a_minus.py | 8 +- .../abstract_weight_dependence.py | 21 +- .../weight_dependence_additive.py | 12 +- .../weight_dependence_additive_triplet.py | 20 +- .../weight_dependence_multiplicative.py | 12 +- .../pyNN/models/populations/population.py | 98 ++-------- .../models/populations/population_base.py | 45 +---- .../models/populations/population_view.py | 84 ++------ spynnaker/pyNN/random_distribution.py | 5 +- spynnaker/pyNN/setup_pynn.py | 7 +- spynnaker/pyNN/spinnaker.py | 17 +- ...pynnaker_external_device_plugin_manager.py | 86 ++++----- spynnaker/spike_checker.py | 10 +- spynnaker/spynnaker_plotting.py | 46 +++-- 149 files changed, 783 insertions(+), 2366 deletions(-) diff --git a/spynnaker/pyNN/__init__.py b/spynnaker/pyNN/__init__.py index 81a8583654a..1f38898f6b0 100644 --- a/spynnaker/pyNN/__init__.py +++ b/spynnaker/pyNN/__init__.py @@ -243,13 +243,13 @@ def distance(src_cell: IDMixin, tgt_cell: IDMixin, :param src_cell: Measure from this cell :param tgt_cell: To this cell - :param ~numpy.ndarray mask: + :param mask: allows only certain dimensions to be considered, e.g.: * to ignore the z-dimension, use ``mask=array([0,1])`` * to ignore y, ``mask=array([0,2])`` * to just consider z-distance, ``mask=array([2])`` - :param float scale_factor: + :param scale_factor: allows for different units in the pre- and post-position (the post-synaptic position is multiplied by this quantity). :param float offset: @@ -358,8 +358,6 @@ def setup(timestep: Optional[Union[float, Literal["auto"]]] = None, def name() -> str: """ Returns the name of the simulator. - - :rtype: str """ return SpynnakerDataView.get_sim_name() @@ -377,23 +375,16 @@ def Projection( Used to support PEP 8 spelling correctly. :param presynaptic_population: the source pop - :type presynaptic_population: - ~spynnaker.pyNN.models.populations.Population :param postsynaptic_population: the destination population - :type postsynaptic_population: - ~spynnaker.pyNN.models.populations.Population - :param AbstractConnector connector: the connector type - :param AbstractStaticSynapseDynamics synapse_type: the synapse type - :param None source: Unsupported; must be ``None`` - :param str receptor_type: the receptor type + :param connector: the connector type + :param synapse_type: the synapse type + :param source: Unsupported; must be ``None`` + :param receptor_type: the receptor type :param space: the space object - :type space: ~pyNN.space.Space or None :param label: the label - :type label: str or None - :param bool download_synapses: whether to download synapses - :param str partition_id: the partition id to use for the projection + :param download_synapses: whether to download synapses + :param partition_id: the partition id to use for the projection :return: a projection object for SpiNNaker - :rtype: ~spynnaker.pyNN.models.projection.Projection """ return SpiNNakerProjection( pre_synaptic_population=presynaptic_population, @@ -457,8 +448,6 @@ def list_standard_models() -> List[str]: """ Return a list of all the StandardCellType classes available for this simulator. - - :rtype: list(str) """ return [ key @@ -482,9 +471,8 @@ def set_number_of_neurons_per_core( dimensions, it is recommended to set this to `None` here and then set the maximum on each Population. - :param type(PopulationVertex) neuron_type: neuron type + :param neuron_type: neuron type :param max_permitted: the number to set to - :type max_permitted: int or tuple or None """ if isinstance(neuron_type, str): raise ConfigurationException( @@ -546,13 +534,13 @@ def connect(pre: Population, post: Population, weight: float = 0.0, """ Builds a projection. - :param ~spynnaker.pyNN.models.populations.Population pre: source pop - :param ~spynnaker.pyNN.models.populations.Population post: destination pop - :param float weight: weight of the connections - :param float delay: the delay of the connections - :param str receptor_type: excitatory / inhibitory - :param float p: probability - :param ~pyNN.random.NumpyRNG rng: random number generator + :param pre: source pop + :param post: destination pop + :param weight: weight of the connections + :param delay: the delay of the connections + :param receptor_type: excitatory / inhibitory + :param p: probability + :param rng: random number generator """ SpynnakerDataView.check_user_can_act() __pynn["connect"](pre, post, weight, delay, receptor_type, p, rng) @@ -566,10 +554,8 @@ def create( Builds a population with certain parameters. :param cellclass: population class - :type cellclass: type or AbstractPyNNModel :param cellparams: population parameters. - :param int n: number of neurons - :rtype: ~spynnaker.pyNN.models.populations.Population + :param n: number of neurons """ SpynnakerDataView.check_user_can_act() return __pynn["create"](cellclass, cellparams, n) @@ -580,7 +566,6 @@ def NativeRNG(seed_value: Union[int, List[int], NDArray]) -> None: Fixes the random number generator's seed. :param seed_value: - :type seed_value: int or list(int) or ~numpy.ndarray(int32) """ __numpy.random.seed(seed_value) @@ -601,7 +586,6 @@ def get_min_delay() -> int: least this. :return: returns the min delay of the simulation - :rtype: int """ SpynnakerDataView.check_user_can_act() return __pynn["get_min_delay"]() @@ -626,7 +610,6 @@ def get_time_step() -> float: The integration time step. :return: get the time step of the simulation (in ms) - :rtype: float """ SpynnakerDataView.check_user_can_act() return float(__pynn["get_time_step"]()) @@ -637,8 +620,6 @@ def initialize(cells: PopulationBase, **initial_values: Any) -> None: Sets cells to be initialised to the given values. :param cells: the cells to change parameters on - :type cells: ~spynnaker.pyNN.models.populations.Population or - ~spynnaker.pyNN.models.populations.PopulationView :param initial_values: the parameters and their values to change """ SpynnakerDataView.check_user_can_act() @@ -653,7 +634,6 @@ def num_processes() -> int: Always 1 on SpiNNaker, which doesn't use MPI. :return: the number of MPI processes - :rtype: int """ SpynnakerDataView.check_user_can_act() return __pynn["num_processes"]() @@ -667,7 +647,6 @@ def rank() -> int: Always 0 on SpiNNaker, which doesn't use MPI. :return: MPI rank - :rtype: int """ SpynnakerDataView.check_user_can_act() return __pynn["rank"]() @@ -682,17 +661,12 @@ def record(variables: Union[str, Sequence[str]], source: PopulationBase, :param variables: may be either a single variable name or a list of variable names. For a given `celltype` class, `celltype.recordable` contains a list of variables that can be recorded for that `celltype`. - :type variables: str or list(str) :param source: where to record from - :type source: ~spynnaker.pyNN.models.populations.Population or - ~spynnaker.pyNN.models.populations.PopulationView :param str filename: file name to write data to :param sampling_interval: how often to sample the recording, not ignored so far :param annotations: the annotations to data writers - :type annotations: dict(str, ...) :return: neo object - :rtype: ~neo.core.Block """ SpynnakerDataView.check_user_can_act() return __pynn["record"](variables, source, filename, sampling_interval, @@ -704,7 +678,6 @@ def reset(annotations: Optional[Dict[str, Any]] = None) -> None: Resets the simulation to t = 0. :param annotations: the annotations to the data objects - :type annotations: dict(str, ...) """ if annotations is None: annotations = {} @@ -717,10 +690,9 @@ def run(simtime: float, callbacks: Optional[Callable] = None) -> float: The run() function advances the simulation for a given number of milliseconds. - :param float simtime: time to run for (in milliseconds) + :param simtime: time to run for (in milliseconds) :param callbacks: callbacks to run :return: the actual simulation time that the simulation stopped at - :rtype: float """ SpynnakerDataView.check_user_can_act() return __pynn["run"](simtime, callbacks) @@ -735,9 +707,8 @@ def run_until(tstop: float) -> float: """ Run until a (simulation) time period has completed. - :param float tstop: the time to stop at (in milliseconds) + :param tstop: the time to stop at (in milliseconds) :return: the actual simulation time that the simulation stopped at - :rtype: float """ SpynnakerDataView.check_user_can_act() return __pynn["run_until"](tstop, None) @@ -748,7 +719,6 @@ def get_machine() -> Machine: Get the SpiNNaker machine in use. :return: the machine object - :rtype: ~spinn_machine.Machine """ SpynnakerDataView.check_user_can_act() return SpynnakerDataView.get_machine() diff --git a/spynnaker/pyNN/connections/ethernet_command_connection.py b/spynnaker/pyNN/connections/ethernet_command_connection.py index deaa0a68d87..7c3155194a3 100644 --- a/spynnaker/pyNN/connections/ethernet_command_connection.py +++ b/spynnaker/pyNN/connections/ethernet_command_connection.py @@ -36,16 +36,14 @@ def __init__( local_host: Optional[str] = None, local_port: Optional[int] = NOTIFY_PORT): """ - :param AbstractEthernetTranslator translator: + :param translator: A translator of multicast commands to device commands :param command_containers: A list of vertices that have commands to be sent at the start and end of simulation - :type command_containers: - list(~spinn_front_end_common.abstract_models.AbstractSendMeMulticastCommandsVertex) - :param str local_host: + :param local_host: The optional host to listen on for the start/resume message - :param int local_port: + :param local_port: The optional port to listen on for the stop/pause message """ super().__init__( @@ -69,8 +67,6 @@ def add_command_container( :param command_container: A vertex that has commands to be sent at the start and end of simulation - :type command_container: - ~spinn_front_end_common.abstract_models.AbstractSendMeMulticastCommandsVertex """ if not isinstance( command_container, AbstractSendMeMulticastCommandsVertex): diff --git a/spynnaker/pyNN/connections/ethernet_control_connection.py b/spynnaker/pyNN/connections/ethernet_control_connection.py index b7e0dad97b8..6fcd46bcc78 100644 --- a/spynnaker/pyNN/connections/ethernet_control_connection.py +++ b/spynnaker/pyNN/connections/ethernet_control_connection.py @@ -30,13 +30,12 @@ def __init__( live_packet_gather_label: str, local_host: Optional[str] = None, local_port: Optional[int] = None): """ - :param AbstractEthernetTranslator translator: - The translator of multicast to control commands - :param str label: The label of the vertex to attach the translator to - :param str live_packet_gather_label: The label of the LPG vertex that + :param translator: The translator of multicast to control commands + :param label: The label of the vertex to attach the translator to + :param live_packet_gather_label: The label of the LPG vertex that this control connection will listen to. - :param str local_host: The optional host to listen on - :param int local_port: The optional port to listen on + :param local_host: The optional host to listen on + :param local_port: The optional port to listen on """ super().__init__( live_packet_gather_label, receive_labels=[label], @@ -51,9 +50,8 @@ def add_translator( """ Add another translator that routes via the LPG. - :param str label: The label of the vertex to attach the translator to - :param AbstractEthernetTranslator translator: - The translator of multicast to control commands + :param label: The label of the vertex to attach the translator to + :param translator: The translator of multicast to control commands """ super().add_receive_label(label) self.__translators[label] = translator diff --git a/spynnaker/pyNN/connections/spif_live_spikes_connection.py b/spynnaker/pyNN/connections/spif_live_spikes_connection.py index 9735c9466f8..fcdc1583d22 100644 --- a/spynnaker/pyNN/connections/spif_live_spikes_connection.py +++ b/spynnaker/pyNN/connections/spif_live_spikes_connection.py @@ -85,22 +85,22 @@ def __init__(self, receive_labels: Optional[Iterable[str]], local_host: Optional[str] = None, local_port: Optional[int] = None): """ - :param iterable(str) receive_labels: + :param receive_labels: Labels of vertices from which live events will be received. - :param str spif_host: The location of the SPIF board receiving packets - :param int spif_port: The port of the SPIF board (default 3332) - :param int events_per_packet: + :param spif_host: The location of the SPIF board receiving packets + :param spif_port: The port of the SPIF board (default 3332) + :param events_per_packet: The maximum number of events in each packet. SPIF will be configured to send a packet as soon as it reaches this size if not before (default is 32) - :param int time_per_packet: + :param time_per_packet: The maximum time between sending non-empty packets. SPIF will be configured to send a packet that isn't empty after this many microseconds (default is 500) - :param str local_host: + :param local_host: Optional specification of the local hostname or IP address of the interface to listen on - :param int local_port: + :param local_port: Optional specification of the local port to listen on. Must match the port that the toolchain will send the notification on (19999 by default) @@ -149,7 +149,7 @@ def add_init_callback(self, label: str, init_callback: _INIT) -> None: """ Add a callback to be called to initialise a vertex. - :param str label: + :param abel: The label of the vertex to be notified about. Must be one of the vertices listed in the constructor :param init_callback: A function to be called to initialise the @@ -157,7 +157,6 @@ def add_init_callback(self, label: str, init_callback: _INIT) -> None: the number of neurons in the population, the run time of the simulation in milliseconds, and the simulation timestep in milliseconds - :type init_callback: callable(str, int, float, float) -> None """ self.__init_callbacks[label].append(init_callback) @@ -167,13 +166,12 @@ def add_receive_callback( """ Add a callback for the reception of live events from a vertex. - :param str label: The label of the vertex to be notified about. + :param label: The label of the vertex to be notified about. Must be one of the vertices listed in the constructor :param live_event_callback: A function to be called when events are received. This should take as parameters the label of the vertex, and an array-like of atom IDs. - :type live_event_callback: callable(str, list(int)) -> None - :param bool translate_key: + :param translate_key: True if the key is to be converted to an atom ID, False if the key should stay a key """ @@ -189,14 +187,11 @@ def add_start_resume_callback( """ Add a callback for the start and resume state of the simulation. - :param str label: the label of the function to be sent + :param label: the label of the function to be sent :param start_resume_callback: A function to be called when the start or resume message has been received. This function should take the label of the referenced vertex, and an instance of this class, which can be used to send events. - :type start_resume_callback: callable(str, - ~spinn_front_end_common.utilities.connections.LiveEventConnection) - -> None """ self.__start_resume_callbacks[label].append(start_resume_callback) @@ -205,21 +200,15 @@ def add_pause_stop_callback( """ Add a callback for the pause and stop state of the simulation. - :param str label: the label of the function to be sent + :param label: the label of the function to be sent :param pause_stop_callback: A function to be called when the pause or stop message has been received. This function should take the label of the referenced vertex, and an instance of this class, which can be used to send events. - :type pause_stop_callback: callable(str, - ~spinn_front_end_common.utilities.connections.LiveEventConnection) - -> None """ self.__pause_stop_callbacks[label].append(pause_stop_callback) def __read_database_callback(self, db_reader: DatabaseReader) -> None: - """ - :param DatabaseReader db_reader: - """ self.__handle_possible_rerun_state() vertex_sizes: Dict[str, int] = dict() diff --git a/spynnaker/pyNN/connections/spynnaker_live_spikes_connection.py b/spynnaker/pyNN/connections/spynnaker_live_spikes_connection.py index 3e535c64458..a8404f58d13 100644 --- a/spynnaker/pyNN/connections/spynnaker_live_spikes_connection.py +++ b/spynnaker/pyNN/connections/spynnaker_live_spikes_connection.py @@ -35,14 +35,14 @@ def __init__(self, receive_labels: Optional[Iterable[str]] = None, local_port: Optional[int] = NOTIFY_PORT, live_packet_gather_label: str = "LiveSpikeReceiver"): """ - :param iterable(str) receive_labels: + :param receive_labels: Labels of population from which live spikes will be received. - :param iterable(str) send_labels: + :param send_labels: Labels of population to which live spikes will be sent - :param str local_host: + :param local_host: Optional specification of the local hostname or IP address of the interface to listen on - :param int local_port: + :param local_port: Optional specification of the local port to listen on. Must match the port that the toolchain will send the notification on (19999 by default) @@ -56,10 +56,10 @@ def send_spike(self, label: str, neuron_id: int, """ Send a spike from a single neuron. - :param str label: + :param label: The label of the population from which the spike will originate - :param int neuron_id: The ID of the neuron sending a spike - :param bool send_full_keys: Determines whether to send full 32-bit + :param neuron_id: The ID of the neuron sending a spike + :param send_full_keys: Determines whether to send full 32-bit keys, getting the key for each neuron from the database, or whether to send 16-bit neuron IDs directly """ @@ -71,10 +71,10 @@ def send_spikes( """ Send a number of spikes. - :param str label: + :param label: The label of the population from which the spikes will originate - :param list(int) neuron_ids: array-like of neuron IDs sending spikes - :param bool send_full_keys: Determines whether to send full 32-bit + :param neuron_ids: array-like of neuron IDs sending spikes + :param send_full_keys: Determines whether to send full 32-bit keys, getting the key for each neuron from the database, or whether to send 16-bit neuron IDs directly """ diff --git a/spynnaker/pyNN/connections/spynnaker_poisson_control_connection.py b/spynnaker/pyNN/connections/spynnaker_poisson_control_connection.py index f10deacd1f5..83ceed8e25f 100644 --- a/spynnaker/pyNN/connections/spynnaker_poisson_control_connection.py +++ b/spynnaker/pyNN/connections/spynnaker_poisson_control_connection.py @@ -40,15 +40,15 @@ def __init__( local_port: Optional[int] = NOTIFY_PORT, control_label_extension: str = "_control"): """ - :param iterable(str) poisson_labels: + :param poisson_labels: Labels of Poisson populations to be controlled - :param str local_host: Optional specification of the local hostname or + :param local_host: Optional specification of the local hostname or IP address of the interface to listen on - :param int local_port: + :param local_port: Optional specification of the local port to listen on. Must match the port that the toolchain will send the notification on (19999 by default) - :param str control_label_extension: + :param control_label_extension: The extra name added to the label of each Poisson source """ self.__control_label_extension = control_label_extension @@ -74,7 +74,7 @@ def __init__( def add_poisson_label(self, label: str) -> None: """ - :param str label: The label of the Poisson source population. + :param label: The label of the Poisson source population. """ control = self.__convert_to_control_label(label) self.__control_label_to_label[control] = label @@ -150,9 +150,9 @@ def set_rate(self, label: str, neuron_id: int, rate: float) -> None: """ Set the rate of a Poisson neuron within a Poisson source. - :param str label: The label of the Population to set the rates of - :param int neuron_id: The neuron ID to set the rate of - :param float rate: The rate to set in Hz + :param label: The label of the Population to set the rates of + :param neuron_id: The neuron ID to set the rate of + :param rate: The rate to set in Hz """ self.set_rates(label, [(neuron_id, rate)]) @@ -161,8 +161,8 @@ def set_rates(self, label: str, """ Set the rates of multiple Poisson neurons within a Poisson source. - :param str label: The label of the Population to set the rates of - :param list(tuple(int,float)) neuron_id_rates: + :param label: The label of the Population to set the rates of + :param neuron_id_rates: A list of tuples of (neuron ID, rate) to be set """ control = self.__control_label(label) diff --git a/spynnaker/pyNN/data/spynnaker_data_view.py b/spynnaker/pyNN/data/spynnaker_data_view.py index 3500d1da539..e5e45ae01f1 100644 --- a/spynnaker/pyNN/data/spynnaker_data_view.py +++ b/spynnaker/pyNN/data/spynnaker_data_view.py @@ -109,7 +109,6 @@ def get_min_delay(cls) -> float: Typically `simulation_time_step_per_ms` but may be a positive multiple of it. - :rtype: float :raises ~spinn_utilities.exceptions.SpiNNUtilsException: If the min_delay is currently unavailable """ @@ -121,8 +120,6 @@ def get_min_delay(cls) -> float: def has_min_delay(cls) -> bool: """ Report if there is a minimum supported delay available. - - :rtype: bool """ if cls.__spy_data._min_delay is not None: return True @@ -136,8 +133,6 @@ def iterate_projections(cls) -> Iterator[Projection]: The iteration will be empty if no projections added. Note: This method is backed by a set so does not guarantee order - - :rtype: iterable(Projection) """ return iter(cls.__spy_data._projections) @@ -145,8 +140,6 @@ def iterate_projections(cls) -> Iterator[Projection]: def get_n_projections(cls) -> int: """ The number of projections previously added. - - rtype: int """ return len(cls.__spy_data._projections) @@ -158,8 +151,7 @@ def add_projection(cls, projection: Projection) -> None: Usage other than from `Projection.__init__` is not supported and likely to raise an exception - :param ~spynnaker.pyNN.models.projection.Projection projection: - Projection to add + :param projection: Projection to add :raises ~spinn_utilities.exceptions.SpiNNUtilsException: If projections should not be added in the current state """ @@ -182,8 +174,6 @@ def iterate_populations(cls) -> Iterator[Population]: The iteration will be empty if no populations added. Note: This method is backed by a set so does not guarantee order - - :rtype: iterable(~spynnaker.pyNN.models.populations.Population) """ return iter(cls.__spy_data._populations) @@ -191,8 +181,6 @@ def iterate_populations(cls) -> Iterator[Population]: def get_n_populations(cls) -> int: """ The number of populations previously added. - - :rtype: int """ return len(cls.__spy_data._populations) @@ -206,10 +194,8 @@ def add_population(cls, population: Population) -> Tuple[int, int]: Increments the all population ID counter by the size of the population. - :param ~spynnaker.pyNN.models.populations.Population population: - Population to add + :param population: Population to add :return: The first and last global IDs for this Population - :rtype: tuple(int, int) :raises ~spinn_utilites.exceptions.SimulatorRunningException: If `sim.run` is currently running :raises ~spinn_utilites.exceptions.SimulatorNotSetupException: @@ -236,7 +222,5 @@ def add_population(cls, population: Population) -> Tuple[int, int]: def get_sim_name(cls) -> str: """ Gets the name to be returned by `pyNN.spiNNaker.name`. - - :rtype: str """ return _version.NAME diff --git a/spynnaker/pyNN/data/spynnaker_data_writer.py b/spynnaker/pyNN/data/spynnaker_data_writer.py index 3e4893f7992..49484b9765b 100644 --- a/spynnaker/pyNN/data/spynnaker_data_writer.py +++ b/spynnaker/pyNN/data/spynnaker_data_writer.py @@ -66,14 +66,11 @@ def set_up_timings_and_delay( An explicitly specified time step for the simulation in microseconds. If `None`, the value is read from the configuration - :type simulation_time_step_us: int or None :param time_scale_factor: An explicitly specified time scale factor for the simulation. If `None`, the value is read from the configuration - :type time_scale_factor: float or None :param min_delay: new value or `None` to say use simulation_time_step_ms - :type min_delay: int, float or None """ try: @@ -108,7 +105,6 @@ def _set_min_delay(self, min_delay: Optional[Union[int, float]]) -> None: :param min_delay: new value or `None` to say use simulation_time_step_ms - :type min_delay: int, float or None """ if min_delay is None: min_delay = self.get_simulation_time_step_ms() diff --git a/spynnaker/pyNN/external_devices/__init__.py b/spynnaker/pyNN/external_devices/__init__.py index f49db19b442..ce612ee0117 100644 --- a/spynnaker/pyNN/external_devices/__init__.py +++ b/spynnaker/pyNN/external_devices/__init__.py @@ -139,8 +139,8 @@ def run_sync(run_time: float, sync_time: float) -> None: Run in steps of the given number of milliseconds pausing between for a signal to be sent from the host. - :param float run_time: The time in milliseconds to run the simulation for - :param float sync_time: The time in milliseconds to pause before allowing + :param run_time: The time in milliseconds to run the simulation for + :param sync_time: The time in milliseconds to pause before allowing """ SpynnakerDataView.check_user_can_act() assert __simulator is not None, "no simulator set up" @@ -171,9 +171,9 @@ def register_database_notification_request( """ Adds a socket system which is registered with the notification protocol. - :param str hostname: hostname to connect to - :param int notify_port: UDP port number for the notify command - :param int ack_port: UDP port number for the acknowledge command + :param hostname: hostname to connect to + :param notify_port: UDP port number for the notify command + :param ack_port: UDP port number for the acknowledge command """ SpynnakerDataView.add_database_socket_address( SocketAddress(hostname, notify_port, ack_port)) @@ -211,32 +211,26 @@ def EthernetControlPopulation( Create a PyNN population that can be included in a network to control an external device which is connected to the host. - :param int n_neurons: The number of neurons in the control population + :param n_neurons: The number of neurons in the control population :param type model: Class of a model that creates a vertex of type :py:class:`AbstractEthernetController` :param label: An optional label for the population - :type label: str or None :param local_host: The optional local host IP address to listen on for commands - :type local_host: str or None :param local_port: The optional local port to listen on for commands - :type local_port: int or None :param database_ack_port_num: The optional port to which responses to the database notification protocol are to be sent - :type database_ack_port_num: int or None :param database_notify_port_num: The optional port to which notifications from the database notification protocol are to be sent - :type database_notify_port_num: int or None :return: A pyNN Population which can be used as the target of a Projection. .. note:: The Population can also be used as the source of a Projection, but it might not send spikes. - :rtype: ~spynnaker.pyNN.models.populations.Population :raises TypeError: If an invalid model class is used. """ # pylint: disable=global-statement @@ -284,25 +278,21 @@ def EthernetSensorPopulation( Create a pyNN population which can be included in a network to receive spikes from a device connected to the host. - :param AbstractEthernetSensor device: The sensor model + :param device: The sensor model :param local_host: The optional local host IP address to listen on for database notification - :type local_host: str or None :param database_ack_port_num: The optional port to which responses to the database notification protocol are to be sent - :type database_ack_port_num: int or None :param database_notify_port_num: The optional port to which notifications from the database notification protocol are to be sent - :type database_notify_port_num: int or None :return: A pyNN Population which can be used as the source of a Projection. .. note:: The Population cannot be used as the target of a Projection. - :rtype: ~spynnaker.pyNN.models.populations.Population :raises TypeError: If an invalid model class is used. """ if not isinstance(device, AbstractEthernetSensor): @@ -338,20 +328,16 @@ def SpikeInjector( Supports creating a spike injector that can be added to the application graph. - :param bool notify: Whether to register for notifications + :param notify: Whether to register for notifications :param database_notify_host: the hostname for the device which is listening to the database notification. - :type database_notify_host: str or None :param database_ack_port_num: the port number to which a external device will acknowledge that they have finished reading the database and are ready for it to start execution - :type database_ack_port_num: int or None :param database_notify_port_num: The port number to which a external device will receive the database is ready command - :type database_notify_port_num: int or None :return: The spike injector model object that can be placed in a pyNN :py:class:`~spynnaker.pyNN.models.populations.Population`. - :rtype: AbstractPyNNModel """ if notify: Plugins.add_database_socket_address( @@ -366,7 +352,7 @@ def _set_simulator(simulator: SpiNNaker) -> None: Any other uses is not supported. - :param spynnaker.pyNN.spinnaker.SpiNNaker simulator: + :param simulator: """ global __simulator # pylint: disable=global-statement __simulator = simulator diff --git a/spynnaker/pyNN/external_devices_models/abstract_ethernet_controller.py b/spynnaker/pyNN/external_devices_models/abstract_ethernet_controller.py index 0267305cadb..cb7d449714f 100644 --- a/spynnaker/pyNN/external_devices_models/abstract_ethernet_controller.py +++ b/spynnaker/pyNN/external_devices_models/abstract_ethernet_controller.py @@ -32,8 +32,6 @@ class AbstractEthernetController(object, metaclass=AbstractBase): def get_message_translator(self) -> AbstractEthernetTranslator: """ Get the translator of messages. - - :rtype: AbstractEthernetTranslator """ raise NotImplementedError @@ -42,8 +40,6 @@ def get_external_devices(self) -> Iterable[ AbstractMulticastControllableDevice]: """ Get the external devices that are to be controlled by the controller. - - :rtype: iterable(AbstractMulticastControllableDevice) """ raise NotImplementedError @@ -51,7 +47,5 @@ def get_external_devices(self) -> Iterable[ def get_outgoing_partition_ids(self) -> List[str]: """ Get the partition IDs of messages coming out of the controller. - - :rtype: list(str) """ raise NotImplementedError diff --git a/spynnaker/pyNN/external_devices_models/abstract_ethernet_sensor.py b/spynnaker/pyNN/external_devices_models/abstract_ethernet_sensor.py index 365f14b541b..f8536f4e7b4 100644 --- a/spynnaker/pyNN/external_devices_models/abstract_ethernet_sensor.py +++ b/spynnaker/pyNN/external_devices_models/abstract_ethernet_sensor.py @@ -31,8 +31,6 @@ class AbstractEthernetSensor(object, metaclass=AbstractBase): def get_n_neurons(self) -> int: """ Get the number of neurons that will be sent out by the device. - - :rtype: int """ raise NotImplementedError @@ -40,8 +38,6 @@ def get_n_neurons(self) -> int: def get_injector_parameters(self) -> Dict[str, Any]: """ Get the parameters of the Spike Injector to use with this device. - - :rtype: dict(str,Any) """ raise NotImplementedError @@ -49,8 +45,6 @@ def get_injector_parameters(self) -> Dict[str, Any]: def get_injector_label(self) -> str: """ Get the label to give to the Spike Injector. - - :rtype: str """ raise NotImplementedError @@ -58,8 +52,6 @@ def get_injector_label(self) -> str: def get_translator(self) -> AbstractEthernetTranslator: """ Get a translator of multicast commands to Ethernet commands. - - :rtype: AbstractEthernetTranslator """ raise NotImplementedError @@ -68,7 +60,5 @@ def get_database_connection(self) -> SpynnakerLiveSpikesConnection: """ Get a Database Connection instance that this device uses to inject packets. - - :rtype: SpynnakerLiveSpikesConnection """ raise NotImplementedError diff --git a/spynnaker/pyNN/external_devices_models/abstract_ethernet_translator.py b/spynnaker/pyNN/external_devices_models/abstract_ethernet_translator.py index de33634d6fe..79505fddd96 100644 --- a/spynnaker/pyNN/external_devices_models/abstract_ethernet_translator.py +++ b/spynnaker/pyNN/external_devices_models/abstract_ethernet_translator.py @@ -32,7 +32,5 @@ def translate_control_packet( appropriate messages to the external device. :param multicast_packet: A received multicast packet - :type multicast_packet: - ~spinnman.messages.eieio.data_messages.AbstractDataElement """ raise NotImplementedError diff --git a/spynnaker/pyNN/external_devices_models/abstract_multicast_controllable_device.py b/spynnaker/pyNN/external_devices_models/abstract_multicast_controllable_device.py index f2b3ae6b9e3..6aa835c51d2 100644 --- a/spynnaker/pyNN/external_devices_models/abstract_multicast_controllable_device.py +++ b/spynnaker/pyNN/external_devices_models/abstract_multicast_controllable_device.py @@ -49,8 +49,6 @@ def device_control_partition_id(self) -> str: """ A partition ID to give to an outgoing edge partition that will control this device. - - :rtype: str """ raise NotImplementedError @@ -59,8 +57,6 @@ def device_control_partition_id(self) -> str: def device_control_key(self) -> int: """ The key that must be sent to the device to control it. - - :rtype: int """ raise NotImplementedError @@ -70,8 +66,6 @@ def device_control_uses_payload(self) -> bool: """ Whether the control of the device accepts an arbitrary valued payload, the value of which will change the devices behaviour. - - :rtype: bool """ raise NotImplementedError @@ -80,8 +74,6 @@ def device_control_uses_payload(self) -> bool: def device_control_min_value(self) -> float: """ The minimum value to send to the device. - - :rtype: float """ raise NotImplementedError @@ -90,8 +82,6 @@ def device_control_min_value(self) -> float: def device_control_max_value(self) -> Decimal: """ The maximum value to send to the device. - - :rtype: float """ raise NotImplementedError @@ -101,8 +91,6 @@ def device_control_timesteps_between_sending(self) -> Optional[int]: """ The number of timesteps between sending commands to the device. This defines the "sampling interval" for the device. - - :rtype: int """ raise NotImplementedError @@ -111,8 +99,6 @@ def device_control_timesteps_between_sending(self) -> Optional[int]: def device_control_send_type(self) -> SendType: """ The type of data to be sent. - - :rtype: SendType """ raise NotImplementedError @@ -120,8 +106,6 @@ def device_control_send_type(self) -> SendType: def device_control_scaling_factor(self) -> int: # pragma: no cover """ The scaling factor used to send the payload to this device. - - :rtype: int """ return 1 diff --git a/spynnaker/pyNN/external_devices_models/arbitrary_fpga_device.py b/spynnaker/pyNN/external_devices_models/arbitrary_fpga_device.py index 213ec9e24a3..1d13767b925 100644 --- a/spynnaker/pyNN/external_devices_models/arbitrary_fpga_device.py +++ b/spynnaker/pyNN/external_devices_models/arbitrary_fpga_device.py @@ -31,15 +31,12 @@ def __init__( board_address: Optional[str] = None, chip_coords: Optional[XY] = None, label: Optional[str] = None): """ - :param int n_neurons: Number of neurons - :param int fpga_link_id: - :param int fpga_id: + :param n_neurons: Number of neurons + :param fpga_link_id: + :param fpga_id: :param board_address: - :type board_address: str or None :param chip_coords: - :type chip_coords: tuple(int, int) or None :param label: - :type label: str or None """ conn = FPGAConnection( fpga_id, fpga_link_id, board_address, chip_coords) diff --git a/spynnaker/pyNN/external_devices_models/external_device_lif_control.py b/spynnaker/pyNN/external_devices_models/external_device_lif_control.py index 676defcf75d..d70fc64c9f0 100644 --- a/spynnaker/pyNN/external_devices_models/external_device_lif_control.py +++ b/spynnaker/pyNN/external_devices_models/external_device_lif_control.py @@ -59,28 +59,27 @@ def __init__( i_offset: float = 0.0, v: float = 0.0, isyn_exc: float = 0.0, isyn_inh: float = 0.0): """ - :param list(AbstractMulticastControllableDevice) devices: + :param devices: The AbstractMulticastControllableDevice instances to be controlled by the population - :param bool create_edges: + :param create_edges: True if edges to the devices should be added by this device (set to False if using the device over Ethernet using a translator) :param translator: Translator to be used when used for Ethernet communication. Must be provided if the device is to be controlled over Ethernet. - :type translator: AbstractEthernetTranslator or None - :param float tau_m: (defaulted LIF neuron parameter) - :param float cm: (defaulted LIF neuron parameter) - :param float v_rest: (defaulted LIF neuron parameter) - :param float v_reset: (defaulted LIF neuron parameter) - :param float tau_syn_E: (defaulted LIF neuron parameter) - :param float tau_syn_I: (defaulted LIF neuron parameter) - :param float tau_refrac: (defaulted LIF neuron parameter) - :param float i_offset: (defaulted LIF neuron parameter) - :param float v: (defaulted LIF neuron state variable initial value) - :param float isyn_exc: + :param tau_m: (defaulted LIF neuron parameter) + :param cm: (defaulted LIF neuron parameter) + :param v_rest: (defaulted LIF neuron parameter) + :param v_reset: (defaulted LIF neuron parameter) + :param tau_syn_E: (defaulted LIF neuron parameter) + :param tau_syn_I: (defaulted LIF neuron parameter) + :param tau_refrac: (defaulted LIF neuron parameter) + :param i_offset: (defaulted LIF neuron parameter) + :param v: (defaulted LIF neuron state variable initial value) + :param isyn_exc: (defaulted LIF neuron state variable initial value) - :param float isyn_inh: + :param isyn_inh: (defaulted LIF neuron state variable initial value) """ if not devices: diff --git a/spynnaker/pyNN/external_devices_models/external_device_lif_control_vertex.py b/spynnaker/pyNN/external_devices_models/external_device_lif_control_vertex.py index 2f0a8a2bc74..1e200fe5f8b 100644 --- a/spynnaker/pyNN/external_devices_models/external_device_lif_control_vertex.py +++ b/spynnaker/pyNN/external_devices_models/external_device_lif_control_vertex.py @@ -72,26 +72,24 @@ def __init__( splitter: Optional[SplitterPopulationVertex] = None, seed: Optional[int] = None, n_colour_bits: Optional[int] = None): """ - :param list(AbstractMulticastControllableDevice) devices: + :param devices: The AbstractMulticastControllableDevice instances to be controlled by the population - :param bool create_edges: + :param create_edges: True if edges to the devices should be added by this device (set to False if using the device over Ethernet using a translator) - :param tuple(int, ...) max_atoms_per_core: - :param AbstractNeuronImpl neuron_impl: - :param AbstractPyNNNeuronModel pynn_model: + :param max_atoms_per_core: + :param neuron_impl: + :param pynn_model: :param translator: Translator to be used when used for Ethernet communication. Must be provided if the device is to be controlled over Ethernet. - :type translator: AbstractEthernetTranslator or None - :param float spikes_per_second: - :param str label: - :param float ring_buffer_sigma: - :param int incoming_spike_buffer_size: + :param spikes_per_second: + :param label: + :param ring_buffer_sigma: + :param incoming_spike_buffer_size: :param splitter: splitter from application vertices to machine vertices - :type splitter: SplitterPopulationVertex or None - :param int n_colour_bits: The number of colour bits to use + :param n_colour_bits: The number of colour bits to use """ if drop_late_spikes is None: drop_late_spikes = False diff --git a/spynnaker/pyNN/external_devices_models/external_spinnaker_link_fpga_retina_device.py b/spynnaker/pyNN/external_devices_models/external_spinnaker_link_fpga_retina_device.py index 6138d4bb581..dff308d51fa 100644 --- a/spynnaker/pyNN/external_devices_models/external_spinnaker_link_fpga_retina_device.py +++ b/spynnaker/pyNN/external_devices_models/external_spinnaker_link_fpga_retina_device.py @@ -24,9 +24,8 @@ def get_y_from_fpga_retina(key: int, mode: int) -> Optional[int]: """ - :param int key: - :param int mode: - :rtype: int or None + :param key: + :param mode: """ if mode == 128: return key & 0x7f @@ -41,9 +40,8 @@ def get_y_from_fpga_retina(key: int, mode: int) -> Optional[int]: def get_x_from_fpga_retina(key: int, mode: int) -> Optional[int]: """ - :param int key: - :param int mode: - :rtype: int or None + :param key: + :param mode: """ if mode == 128: return (key >> 7) & 0x7f @@ -58,9 +56,8 @@ def get_x_from_fpga_retina(key: int, mode: int) -> Optional[int]: def get_spike_value_from_fpga_retina(key: int, mode: int) -> Optional[int]: """ - :param int key: - :param int mode: - :rtype: int or None + :param key: + :param mode: """ if mode == 128: return (key >> 14) & 0x1 @@ -96,13 +93,13 @@ def __init__( polarity: str, label: Optional[str] = None, board_address: Optional[str] = None): """ - :param str mode: The retina "mode" - :param int retina_key: The value of the top 16-bits of the key - :param int spinnaker_link_id: + :param mode: The retina "mode" + :param retina_key: The value of the top 16-bits of the key + :param spinnaker_link_id: The SpiNNaker link to which the retina is connected - :param str polarity: The "polarity" of the retina data - :param str label: - :param str board_address: + :param polarity: The "polarity" of the retina data + :param label: + :param board_address: """ fixed_n_neurons = self.get_n_neurons(mode, polarity) super().__init__( @@ -136,9 +133,8 @@ def _get_mask(self, mode: str) -> int: @staticmethod def get_n_neurons(mode: str, polarity: str) -> int: """ - :param str mode: ``128`` or ``64`` or ``32`` or ``16`` - :param str parity: ``UP`` or ``DOWN`` or ``MERGED`` - :rtype: int + :param mode: ``128`` or ``64`` or ``32`` or ``16`` + :param parity: ``UP`` or ``DOWN`` or ``MERGED`` """ if mode == ExternalFPGARetinaDevice.MODE_128: if (polarity == ExternalFPGARetinaDevice.UP_POLARITY or diff --git a/spynnaker/pyNN/external_devices_models/icub_retina_device.py b/spynnaker/pyNN/external_devices_models/icub_retina_device.py index 14738738b00..3506bb3ffb0 100644 --- a/spynnaker/pyNN/external_devices_models/icub_retina_device.py +++ b/spynnaker/pyNN/external_devices_models/icub_retina_device.py @@ -45,21 +45,20 @@ def __init__(self, base_key: int = 0, width: int = DEFAULT_WIDTH, spinnaker_link_id: int = 0, board_address: Optional[str] = None): """ - :param int base_key: The key that is common over the whole vertex - :param int width: The width of the retina in pixels - :param int height: The height of the retina in pixels - :param int sub_width: + :param base_key: The key that is common over the whole vertex + :param width: The width of the retina in pixels + :param height: The height of the retina in pixels + :param sub_width: The width of rectangles to split the retina into for efficiency of sending - :param int sub_height: + :param sub_height: The height of rectangles to split the retina into for efficiency of sending - :param int spinnaker_link_id: + :param spinnaker_link_id: The ID of the SpiNNaker link that the device is connected to :param board_address: The board to which the device is connected, or `None` for the first board - :type board_address: str or None """ # Fake the width if not a power of 2, as we need this for the sake # of passing on to other 2D vertices. This will map the pixels onto diff --git a/spynnaker/pyNN/external_devices_models/machine_munich_motor_device.py b/spynnaker/pyNN/external_devices_models/machine_munich_motor_device.py index fd1f2c194ca..1ad62657187 100644 --- a/spynnaker/pyNN/external_devices_models/machine_munich_motor_device.py +++ b/spynnaker/pyNN/external_devices_models/machine_munich_motor_device.py @@ -79,14 +79,14 @@ def __init__( continue_if_not_different: bool, label: Optional[str] = None, app_vertex: Optional[ApplicationVertex] = None): """ - :param int speed: - :param int sample_time: - :param int update_time: - :param int delay_time: - :param int delta_threshold: - :param bool continue_if_not_different: + :param speed: + :param sample_time: + :param update_time: + :param delay_time: + :param delta_threshold: + :param continue_if_not_different: :param label: - :param ~pacman.model.graphs.application.ApplicationVertex app_vertex: + :param app_vertex: """ super().__init__( label=label, app_vertex=app_vertex, @@ -185,7 +185,6 @@ def reserve_memory_regions(self, spec: DataSpecificationGenerator) -> None: #. area for end commands :param spec: The data specification to write to - :type spec: ~data_specification.DataSpecificationGenerator """ spec.comment("\nReserving memory space for data regions:\n\n") diff --git a/spynnaker/pyNN/external_devices_models/munich_spinnaker_link_motor_device.py b/spynnaker/pyNN/external_devices_models/munich_spinnaker_link_motor_device.py index 163c0e10642..ef1e828008b 100644 --- a/spynnaker/pyNN/external_devices_models/munich_spinnaker_link_motor_device.py +++ b/spynnaker/pyNN/external_devices_models/munich_spinnaker_link_motor_device.py @@ -55,18 +55,16 @@ def __init__( continue_if_not_different: bool = True, label: Optional[str] = None): """ - :param int spinnaker_link_id: + :param spinnaker_link_id: The SpiNNaker link to which the motor is connected :param board_address: - :type board_address: str or None - :param int speed: - :param int sample_time: - :param int update_time: - :param int delay_time: - :param int delta_threshold: - :param bool continue_if_not_different: - :param str label: - :type label: str or None + :param speed: + :param sample_time: + :param update_time: + :param delay_time: + :param delta_threshold: + :param continue_if_not_different: + :param label: """ m_vertex = MachineMunichMotorDevice( speed, sample_time, update_time, delay_time, delta_threshold, diff --git a/spynnaker/pyNN/external_devices_models/munich_spinnaker_link_retina_device.py b/spynnaker/pyNN/external_devices_models/munich_spinnaker_link_retina_device.py index 825787ad159..9dc852e5355 100644 --- a/spynnaker/pyNN/external_devices_models/munich_spinnaker_link_retina_device.py +++ b/spynnaker/pyNN/external_devices_models/munich_spinnaker_link_retina_device.py @@ -32,24 +32,21 @@ def get_x_from_robot_retina(key: int) -> int: """ - :param int key: - :rtype: int + :param key: """ return (key >> 7) & 0x7f def get_y_from_robot_retina(key: int) -> int: """ - :param int key: - :rtype: int + :param key: """ return key & 0x7f def get_spike_value_from_robot_retina(key: int) -> int: """ - :param int key: - :rtype: int + :param key: """ return (key >> 14) & 0x1 @@ -94,14 +91,13 @@ def __init__( polarity: _T_POLARITY = None, board_address: Optional[str] = None): """ - :param int retina_key: - :param int spinnaker_link_id: + :param retina_key: + :param spinnaker_link_id: The SpiNNaker link to which the retina is connected - :param str position: ``LEFT`` or ``RIGHT`` + :param position: ``LEFT`` or ``RIGHT`` :param label: - :param str polarity: ``UP``, ``DOWN`` or ``MERGED`` + :param polarity: ``UP``, ``DOWN`` or ``MERGED`` :param board_address: - :type board_address: str or None """ if polarity is None: polarity = MunichRetinaDevice.MERGED_POLARITY diff --git a/spynnaker/pyNN/external_devices_models/push_bot/abstract_push_bot_output_device.py b/spynnaker/pyNN/external_devices_models/push_bot/abstract_push_bot_output_device.py index 67038cd4ded..919b2160a59 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/abstract_push_bot_output_device.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/abstract_push_bot_output_device.py @@ -38,14 +38,14 @@ def __init__( @property def protocol_property(self) -> property: """ - :rtype: property + The protocol property of the output device """ return self._protocol_property @property def min_value(self) -> int: """ - :rtype: int + The minimum value of the output device """ return self._min_value @@ -66,6 +66,6 @@ def time_between_send(self) -> int: @property def send_type(self) -> SendType: """ - :rtype: SendType + The time between sends """ return self._send_type diff --git a/spynnaker/pyNN/external_devices_models/push_bot/control/push_bot_lif_ethernet.py b/spynnaker/pyNN/external_devices_models/push_bot/control/push_bot_lif_ethernet.py index 69da2e7031b..67677678716 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/control/push_bot_lif_ethernet.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/control/push_bot_lif_ethernet.py @@ -30,23 +30,21 @@ class PushBotLifEthernet(ExternalDeviceLifControl): Leaky integrate and fire neuron with an exponentially decaying current input. - :param MunichIoSpiNNakerLinkProtocol protocol: - How to talk to the bot. - :param iterable(AbstractMulticastControllableDevice) devices: - The devices on the bot that we are interested in. - :param str pushbot_ip_address: Where is the pushbot? - :param int pushbot_port: (defaulted) - :param float tau_m: LIF neuron parameter (defaulted) - :param float cm: LIF neuron parameter (defaulted) - :param float v_rest: LIF neuron parameter (defaulted) - :param float v_reset: LIF neuron parameter (defaulted) - :param float tau_syn_E: LIF neuron parameter (defaulted) - :param float tau_syn_I: LIF neuron parameter (defaulted) - :param float tau_refrac: LIF neuron parameter (defaulted) - :param float i_offset: LIF neuron parameter (defaulted) - :param float v: LIF neuron parameter (defaulted) - :param float isyn_exc: LIF neuron parameter (defaulted) - :param float isyn_inh: LIF neuron parameter (defaulted) + :param protocol: How to talk to the bot. + :param devices: The devices on the bot that we are interested in. + :param pushbot_ip_address: Where is the pushbot? + :param pushbot_port: (defaulted) + :param tau_m: LIF neuron parameter (defaulted) + :param cm: LIF neuron parameter (defaulted) + :param v_rest: LIF neuron parameter (defaulted) + :param v_reset: LIF neuron parameter (defaulted) + :param tau_syn_E: LIF neuron parameter (defaulted) + :param tau_syn_I: LIF neuron parameter (defaulted) + :param tau_refrac: LIF neuron parameter (defaulted) + :param i_offset: LIF neuron parameter (defaulted) + :param v: LIF neuron parameter (defaulted) + :param isyn_exc: LIF neuron parameter (defaulted) + :param isyn_inh: LIF neuron parameter (defaulted) """ __slots__ = () diff --git a/spynnaker/pyNN/external_devices_models/push_bot/control/push_bot_lif_spinnaker_link.py b/spynnaker/pyNN/external_devices_models/push_bot/control/push_bot_lif_spinnaker_link.py index 1d0aa0870a6..97f788a1664 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/control/push_bot_lif_spinnaker_link.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/control/push_bot_lif_spinnaker_link.py @@ -25,21 +25,19 @@ class PushBotLifSpinnakerLink(ExternalDeviceLifControl): """ Control module for a PushBot connected to a SpiNNaker Link. - :param MunichIoSpiNNakerLinkProtocol protocol: - How to talk to the bot. - :param iterable(AbstractMulticastControllableDevice) devices: - The devices on the bot that we are interested in. - :param float tau_m: LIF neuron parameter (defaulted) - :param float cm: LIF neuron parameter (defaulted) - :param float v_rest: LIF neuron parameter (defaulted) - :param float v_reset: LIF neuron parameter (defaulted) - :param float tau_syn_E: LIF neuron parameter (defaulted) - :param float tau_syn_I: LIF neuron parameter (defaulted) - :param float tau_refrac: LIF neuron parameter (defaulted) - :param float i_offset: LIF neuron parameter (defaulted) - :param float v: LIF neuron parameter (defaulted) - :param float isyn_exc: LIF neuron parameter (defaulted) - :param float isyn_inh: LIF neuron parameter (defaulted) + :param protocol: How to talk to the bot. + :param devices: The devices on the bot that we are interested in. + :param tau_m: LIF neuron parameter (defaulted) + :param cm: LIF neuron parameter (defaulted) + :param v_rest: LIF neuron parameter (defaulted) + :param v_reset: LIF neuron parameter (defaulted) + :param tau_syn_E: LIF neuron parameter (defaulted) + :param tau_syn_I: LIF neuron parameter (defaulted) + :param tau_refrac: LIF neuron parameter (defaulted) + :param i_offset: LIF neuron parameter (defaulted) + :param v: LIF neuron parameter (defaulted) + :param isyn_exc: LIF neuron parameter (defaulted) + :param isyn_inh: LIF neuron parameter (defaulted) """ __slots__ = () diff --git a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_device.py b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_device.py index cc801e50956..ddc5374b3b7 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_device.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_device.py @@ -40,14 +40,14 @@ def __init__( uses_payload: bool, time_between_send: Optional[int], first_send_timestep: Optional[int] = _DEFAULT_FIRST_SEND_TIMESTEP): """ - :param MunichIoSpiNNakerLinkProtocol protocol: + :param protocol: The protocol instance to get commands from - :param AbstractPushBotOutputDevice device: + :param device: The Enum instance of the device to control - :param bool uses_payload: + :param uses_payload: True if the device uses a payload for control - :param int time_between_send: The timesteps between sending - :param int first_send_timestep: The first timestep to send + :param time_between_send: The timesteps between sending + :param first_send_timestep: The first timestep to send """ self.__protocol = protocol self.__device = device @@ -104,8 +104,6 @@ def device_control_first_send_timestep(self) -> Optional[int]: def protocol(self) -> MunichIoSpiNNakerLinkProtocol: """ The protocol instance, for use in the subclass. - - :rtype: MunichIoSpiNNakerLinkProtocol """ return self.__protocol @@ -116,7 +114,6 @@ def set_command_protocol( Set the protocol use to send setup and shutdown commands, separately from the protocol used to control the device. - :param MunichIoSpiNNakerLinkProtocol command_protocol: - The protocol to use for this device + :param command_protocol: The protocol to use for this device """ raise NotImplementedError diff --git a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_laser_device.py b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_laser_device.py index 2e8f1b9382f..087f46e4e3e 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_laser_device.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_laser_device.py @@ -41,9 +41,8 @@ def __init__( start_frequency: Optional[int] = None, timesteps_between_send: Optional[int] = None): """ - :param PushBotLaser laser: The PushBotLaser value to control - :param MunichIoEthernetProtocol protocol: - The protocol instance to get commands from + :param laser: The PushBotLaser value to control + :param protocol: The protocol instance to get commands from :param start_active_time: The "active time" value to send at the start :param start_total_period: diff --git a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_led_device.py b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_led_device.py index 867199574d9..1034d674547 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_led_device.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_led_device.py @@ -42,8 +42,8 @@ def __init__( start_frequency: Optional[int] = None, timesteps_between_send: Optional[int] = None): """ - :param PushBotLED led: The LED to control - :param MunichIoSpiNNakerLinkProtocol protocol: + :param led: The LED to control + :param protocol: The protocol instance to get commands from :param start_active_time_front: The "active time" to set for the front LED at the start diff --git a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_motor_device.py b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_motor_device.py index 2180c38ec40..a18f012d46e 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_motor_device.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_motor_device.py @@ -37,8 +37,8 @@ def __init__(self, motor: PushBotMotor, protocol: MunichIoSpiNNakerLinkProtocol, timesteps_between_send: Optional[int] = None): """ - :param PushBotMotor motor: indicates which motor to control - :param MunichIoSpiNNakerLinkProtocol protocol: + :param motor: indicates which motor to control + :param protocol: The protocol used to control the device :param timesteps_between_send: The number of timesteps between sending commands to the device, diff --git a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_retina_connection.py b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_retina_connection.py index b10d57a955e..48a6558e587 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_retina_connection.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_retina_connection.py @@ -69,13 +69,11 @@ def __init__( local_host: Optional[str] = None, local_port: Optional[int] = None): """ - :param str retina_injector_label: - :param PushBotWIFIConnection pushbot_wifi_connection: - :param PushBotRetinaResolution resolution: + :param retina_injector_label: + :param pushbot_wifi_connection: + :param resolution: :param local_host: - :type local_host: str or None :param local_port: - :type local_port: int or None """ super().__init__( send_labels=[retina_injector_label], local_host=local_host, @@ -123,7 +121,7 @@ def _receive_retina_data(self, data: bytearray) -> None: Receive retina packets from the PushBot and converts them into neuron spikes within the spike injector system. - :param bytearray data: Data to be processed + :param data: Data to be processed """ with self.__lock: if not self.__ready: diff --git a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_retina_device.py b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_retina_device.py index 3a15c39b68b..294b202dbc0 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_retina_device.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_retina_device.py @@ -41,14 +41,14 @@ def __init__( local_port: Optional[int] = None, retina_injector_label: str = "PushBotRetinaInjector"): """ - :param MunichIoEthernetProtocol protocol: + :param protocol: :param PushBotRetinaResolution resolution: - :param str pushbot_ip_address: - :param int pushbot_port: + :param pushbot_ip_address: + :param pushbot_port: :param injector_port: :param local_host: :param local_port: - :param str retina_injector_label: + :param retina_injector_label: """ super().__init__(protocol, None) pushbot_wifi_connection = get_pushbot_wifi_connection( @@ -81,7 +81,4 @@ def get_translator(self) -> PushBotTranslator: @overrides(AbstractEthernetSensor.get_database_connection) def get_database_connection(self) -> PushBotRetinaConnection: - """ - :rtype: PushBotRetinaConnection - """ return self.__database_connection diff --git a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_speaker_device.py b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_speaker_device.py index f6ed7abe1a1..a842cc50bae 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_speaker_device.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_speaker_device.py @@ -42,14 +42,13 @@ def __init__( start_melody: Optional[int] = None, timesteps_between_send: Optional[int] = None): """ - :param PushBotSpeaker speaker: The speaker to control - :param MunichIoSpiNNakerLinkProtocol protocol: - The protocol instance to get commands from - :param int start_active_time: The "active time" to set at the start - :param int start_total_period: The "total period" to set at the start + :param speaker: The speaker to control + :param protocol: The protocol instance to get commands from + :param start_active_time: The "active time" to set at the start + :param start_total_period: The "total period" to set at the start :param start_frequency: The "frequency" to set at the start - :param int start_melody: The "melody" to set at the start - :param int timesteps_between_send: + :param start_melody: The "melody" to set at the start + :param timesteps_between_send: The number of timesteps between sending commands to the device, or `None` to use the default """ diff --git a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_translator.py b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_translator.py index 4412159926b..f2c38ac3ca9 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_translator.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_translator.py @@ -52,9 +52,9 @@ class PushBotTranslator(AbstractEthernetTranslator): def __init__(self, protocol: MunichIoSpiNNakerLinkProtocol, pushbot_wifi_connection: PushBotWIFIConnection): """ - :param MunichIoEthernetProtocol protocol: + :param protocol: The instance of the PushBot protocol to get keys from - :param PushBotWIFIConnection pushbot_wifi_connection: + :param pushbot_wifi_connection: A Wi-Fi connection to the PushBot """ self.__protocol = protocol diff --git a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_wifi_connection.py b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_wifi_connection.py index dde5123dc1d..34285d10231 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_wifi_connection.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_wifi_connection.py @@ -37,8 +37,8 @@ def get_pushbot_wifi_connection( """ Get an existing connection to a PushBot, or make a new one. - :param str remote_host: The IP address of the PushBot - :param int remote_port: The port number of the PushBot (default 56000) + :param remote_host: The IP address of the PushBot + :param remote_port: The port number of the PushBot (default 56000) """ key = (remote_host, remote_port) if key not in _existing_connections: @@ -62,8 +62,8 @@ class PushBotWIFIConnection(Connection, Listenable): def __init__(self, remote_host: str, remote_port: int = 56000): """ - :param str remote_host: The IP address of the PushBot - :param int remote_port: The port number of the PushBot (default 56000) + :param remote_host: The IP address of the PushBot + :param remote_port: The port number of the PushBot (default 56000) :raise ~spinnman.exceptions.SpinnmanIOException: If there is an error setting up the communication channel """ @@ -106,8 +106,6 @@ def local_ip_address(self) -> str: """ The local IP address to which the connection is bound, as a dotted string, e.g. `0.0.0.0`. - - :rtype: str """ return self.__local_ip_address @@ -115,8 +113,6 @@ def local_ip_address(self) -> str: def local_port(self) -> int: """ The local port to which the connection is bound. - - :rtype: int """ return self.__local_port @@ -125,8 +121,6 @@ def remote_ip_address(self) -> Optional[str]: """ The remote IP address to which the connection is connected, as a dotted string, or `None` if not connected remotely. - - :rtype: str or None """ return self.__remote_ip_address @@ -144,9 +138,7 @@ def receive(self, timeout: Optional[float] = None) -> bytes: Receive data from the connection :param timeout: The timeout, or `None` to wait forever - :type timeout: float or None :return: The data received - :rtype: bytes :raise SpinnmanTimeoutException: If a timeout occurs before any data is received :raise ~spinnman.exceptions.SpinnmanIOException: @@ -158,7 +150,7 @@ def send(self, data: bytes) -> None: """ Send data down this connection - :param bytearray data: The data to be sent + :param data: The data to be sent :raise ~spinnman.exceptions.SpinnmanIOException: If there is an error sending the data """ diff --git a/spynnaker/pyNN/external_devices_models/push_bot/parameters/push_bot_retina_viewer.py b/spynnaker/pyNN/external_devices_models/push_bot/parameters/push_bot_retina_viewer.py index 6643c46ecee..cc9654c4a84 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/parameters/push_bot_retina_viewer.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/parameters/push_bot_retina_viewer.py @@ -73,8 +73,6 @@ def __init__(self, retina_resolution: PushBotRetinaResolution, def port(self) -> int: """ The port the connection is listening on. - - :rtype: int """ return self.__conn.local_port diff --git a/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_laser_device.py b/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_laser_device.py index 30b31803003..9c3c0a40f52 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_laser_device.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_laser_device.py @@ -41,21 +41,19 @@ def __init__( start_total_period: int = 0, start_frequency: int = 0): """ - :param PushBotLaser laser: Which laser device to control - :param MunichIoSpiNNakerLinkProtocol protocol: - The protocol instance to get commands from - :param int spinnaker_link_id: + :param laser: Which laser device to control + :param protocol: The protocol instance to get commands from + :param spinnaker_link_id: The SpiNNakerLink that the PushBot is connected to - :param int n_neurons: The number of neurons in the device + :param n_neurons: The number of neurons in the device :param label: A label for the device :param board_address: The IP address of the board that the device is connected to - :type board_address: str or None - :param int start_active_time: + :param start_active_time: The "active time" value to send at the start - :param int start_total_period: + :param start_total_period: The "total period" value to send at the start - :param int start_frequency: The "frequency" to send at the start + :param start_frequency: The "frequency" to send at the start """ super().__init__( laser, protocol, start_active_time, diff --git a/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_led_device.py b/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_led_device.py index e51e3a39af9..bca2bd12c52 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_led_device.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_led_device.py @@ -41,25 +41,19 @@ def __init__( start_total_period: Optional[int] = None, start_frequency: Optional[int] = None): """ - :param PushBotLED led: The LED device to control - :param MunichIoSpiNNakerLinkProtocol protocol: - The protocol instance to get commands from - :param int spinnaker_link_id: The SpiNNakerLink connected to - :param int n_neurons: The number of neurons in the device + :param led: The LED device to control + :param protocol: The protocol instance to get commands from + :param spinnaker_link_id: The SpiNNakerLink connected to + :param n_neurons: The number of neurons in the device :param label: The label of the device :param board_address: The IP address of the board that the device is connected to - :type board_address: str or None :param start_active_time_front: The "active time" to set for the front LED at the start - :type start_active_time_front: int or None :param start_active_time_back: The "active time" to set for the back LED at the start - :type start_active_time_back: int or None :param start_total_period: The "total period" to set at the start - :type start_total_period: int or None :param start_frequency: The "frequency" to set at the start - :type start_frequency: int or None """ super().__init__( led, protocol, start_active_time_front, start_active_time_back, diff --git a/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_motor_device.py b/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_motor_device.py index 9885f8205e4..eb135303b88 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_motor_device.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_motor_device.py @@ -36,15 +36,13 @@ def __init__( spinnaker_link_id: int, n_neurons: int = 1, label: Optional[str] = None, board_address: Optional[str] = None): """ - :param PushBotMotor motor: the motor to control - :param MunichIoSpiNNakerLinkProtocol protocol: - The protocol used to control the device - :param int spinnaker_link_id: The SpiNNakerLink connected to - :param int n_neurons: The number of neurons in the device + :param motor: the motor to control + :param protocol: The protocol used to control the device + :param spinnaker_link_id: The SpiNNakerLink connected to + :param n_neurons: The number of neurons in the device :param label: The label of the device :param board_address: The IP address of the board that the device is connected to - :type board_address: str or None """ super().__init__(motor, protocol) ApplicationSpiNNakerLinkVertex.__init__( diff --git a/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_retina_device.py b/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_retina_device.py index 67f3f2f65cb..d907f6ed971 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_retina_device.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_retina_device.py @@ -64,12 +64,12 @@ def __init__( label: Optional[str] = None, n_machine_vertices: int = 1): """ - :param int spinnaker_link_id: - :param MunichIoSpiNNakerLinkProtocol protocol: - :param PushBotRetinaResolution resolution: + :param spinnaker_link_id: + :param protocol: + :param resolution: :param board_address: :param label: - :param int n_machine_vertices: + :param n_machine_vertices: """ super().__init__(protocol, resolution) ApplicationSpiNNakerLinkVertex.__init__( @@ -86,9 +86,7 @@ def new_key_command_payload(self) -> int: """ Support method to obtain the key after the key allocator has run - :param routing_info: :return: the key - :rtype: int """ routing_info = SpynnakerDataView.get_routing_infos() key = routing_info.get_key_from( diff --git a/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_speaker_device.py b/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_speaker_device.py index 8303df71e94..aeb325e1d35 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_speaker_device.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/spinnaker_link/push_bot_speaker_device.py @@ -43,17 +43,15 @@ def __init__( start_frequency: Optional[int] = None, start_melody: Optional[int] = None): """ - :param PushBotSpeaker speaker: Which speaker device to control - :param MunichIoSpiNNakerLinkProtocol protocol: - The protocol instance to get commands from - :param int spinnaker_link_id: The SpiNNakerLink connected to - :param int n_neurons: The number of neurons in the device + :param speaker: Which speaker device to control + :param protocol: The protocol instance to get commands from + :param spinnaker_link_id: The SpiNNakerLink connected to + :param n_neurons: The number of neurons in the device :param label: The label of the device :param board_address: The IP address of the board that the device is connected to - :type board_address: str or None - :param int start_active_time: The "active time" to set at the start - :param int start_total_period: The "total period" to set at the start + :param start_active_time: The "active time" to set at the start + :param start_total_period: The "total period" to set at the start :param start_frequency: The "frequency" to set at the start :param start_melody: The "melody" to set at the start """ diff --git a/spynnaker/pyNN/external_devices_models/spif_devices.py b/spynnaker/pyNN/external_devices_models/spif_devices.py index 3a590e955be..c076de6d6cd 100644 --- a/spynnaker/pyNN/external_devices_models/spif_devices.py +++ b/spynnaker/pyNN/external_devices_models/spif_devices.py @@ -122,11 +122,9 @@ def cmd(self, payload: Optional[int] = None, :param payload: The payload to use in the command, or `None` for no payload - :type payload: int or None - :param int index: + :param index: The index of the register to send to when there are multiple registers starting from a base - :rtype: ~spinn_front_end_common.utility_models.MultiCastCommand """ return MultiCastCommand( _RC_KEY + self.value + index, payload, time=None, repeat=_REPEATS, @@ -138,12 +136,11 @@ def delayed_command( """ Make a command to send to a SPIF device to set a register value, where the value itself is currently unknown - :param callable()->int get_payload: + :param get_payload: A function to call to get the payload later - :param int index: + :param index: The index of the register to use when using a multi-indexed register (default is 0 which works for all registers) - :rtype: MultiCastCommand """ return _DelayedMultiCastCommand( _RC_KEY + self.value + index, get_payload, repeat=_REPEATS, @@ -155,9 +152,8 @@ def set_mapper_key(pipe: int, key: int) -> MultiCastCommand: Get a command to set the output base key for packets from SPIF. This will be added to the keys determined by the mapper output. - :param int pipe: The SPIF pipe to set the key of (0-1) - :param int key: The output key to set - :rtype: ~spinn_front_end_common.utility_models.MultiCastCommand + :param pipe: The SPIF pipe to set the key of (0-1) + :param key: The output key to set """ return SPIFRegister.MP_KEY_BASE.cmd(key, pipe) @@ -168,10 +164,9 @@ def set_field_mask(pipe: int, index: int, mask: int) -> MultiCastCommand: off the bits of the field from the incoming UDP or USB packet values (which are 32-bits each). - :param int pipe: The SPIF pipe to set the mask of (0-1) - :param int index: The index of the field to set (0-3) - :param int mask: The mask to set - :rtype: ~spinn_front_end_common.utility_models.MultiCastCommand + :param pipe: The SPIF pipe to set the mask of (0-1) + :param index: The index of the field to set (0-3) + :param mask: The mask to set """ return SPIFRegister.MP_FLD_MASK_BASE.cmd(mask, (pipe * N_FIELDS) + index) @@ -182,11 +177,10 @@ def set_field_shift(pipe: int, index: int, shift: int) -> MultiCastCommand: the masked bits of the field from the incoming UDP or USB packet values (which are 32-bits each). - :param int pipe: The SPIF pipe to set the shift of (0-1) - :param int index: The index of the field to set (0-3) - :param int shift: + :param pipe: The SPIF pipe to set the shift of (0-1) + :param index: The index of the field to set (0-3) + :param shift: The shift value to set (0-31); positive = right, negative = left - :rtype: ~spinn_front_end_common.utility_models.MultiCastCommand """ return SPIFRegister.MP_FLD_SHIFT_BASE.cmd( shift, (pipe * N_FIELDS) + index) @@ -197,10 +191,9 @@ def set_field_limit(pipe: int, index: int, limit: int) -> MultiCastCommand: Get a command to set the limit of a mapper field on SPIF. This sets a limit on the value of the field after shifting and masking. - :param int pipe: The SPIF pipe to set the limit of (0-1) - :param int index: The index of the field to set (0-3) - :param int limit: The maximum value of the field - :rtype: ~spinn_front_end_common.utility_models.MultiCastCommand + :param pipe: The SPIF pipe to set the limit of (0-1) + :param index: The index of the field to set (0-3) + :param limit: The maximum value of the field """ return SPIFRegister.MP_FLD_LIMIT_BASE.cmd( limit, (pipe * N_FIELDS) + index) @@ -212,10 +205,9 @@ def set_filter_value(pipe: int, index: int, value: int) -> MultiCastCommand: input events from the UDP or USB packets where filter value == filter mask & event value. - :param int pipe: The SPIF pipe to set the filter of (0-1) - :param int index: The index of the filter to set (0-7) - :param int value: The filter value to set - :rtype: ~spinn_front_end_common.utility_models.MultiCastCommand + :param pipe: The SPIF pipe to set the filter of (0-1) + :param index: The index of the filter to set (0-7) + :param value: The filter value to set """ return SPIFRegister.FL_VALUE_BASE.cmd( value, (pipe * N_FILTERS) + index) @@ -227,10 +219,9 @@ def set_filter_mask(pipe: int, index: int, mask: int) -> MultiCastCommand: input events from the UDP or USB packets where filter value == filter mask & event value. - :param int pipe: The SPIF pipe to set the filter of (0-1) - :param int index: The index of the filter to set (0-7) - :param int mask: The filter mask to set - :rtype: ~spinn_front_end_common.utility_models.MultiCastCommand + :param pipe: The SPIF pipe to set the filter of (0-1) + :param index: The index of the filter to set (0-7) + :param mask: The filter mask to set """ return SPIFRegister.FL_MASK_BASE.cmd( mask, (pipe * N_FILTERS) + index) @@ -243,10 +234,9 @@ def set_input_key(pipe: int, index: int, key: int) -> MultiCastCommand: by the mapper; when incoming key & input mask == input_key, the packet will be routed to input_route. - :param int pipe: The SPIF pipe to set the input of (0-1) - :param int index: The index of the input to set (0-7) - :param int key: The key to set - :rtype: ~spinn_front_end_common.utility_models.MultiCastCommand + :param pipe: The SPIF pipe to set the input of (0-1) + :param index: The index of the input to set (0-7) + :param key: The key to set """ return SPIFRegister.IR_KEY_BASE.cmd(key, (pipe * N_INPUTS) + index) @@ -258,10 +248,9 @@ def set_input_mask(pipe: int, index: int, mask: int) -> MultiCastCommand: by the mapper; when incoming key & input mask == input_key, the packet will be routed to input_route. - :param int pipe: The SPIF pipe to set the input of (0-1) - :param int index: The index of the input to set (0-7) - :param int mask: The mask to set - :rtype: ~spinn_front_end_common.utility_models.MultiCastCommand + :param pipe: The SPIF pipe to set the input of (0-1) + :param index: The index of the input to set (0-7) + :param mask: The mask to set """ return SPIFRegister.IR_MASK_BASE.cmd(mask, (pipe * N_INPUTS) + index) @@ -276,10 +265,9 @@ def set_input_route(pipe: int, index: int, route: int) -> MultiCastCommand: .. note:: route 0 refers to FPGA link 15, 1 to 13 and so on in twos. - :param int pipe: The SPIF pipe to set the input of (0-1) - :param int index: The index of the input to set (0-7) - :param int route: The route to set - :rtype: ~spinn_front_end_common.utility_models.MultiCastCommand + :param pipe: The SPIF pipe to set the input of (0-1) + :param index: The index of the input to set (0-7) + :param route: The route to set """ return SPIFRegister.IR_ROUTE_BASE.cmd(route, (pipe * N_INPUTS) + index) @@ -290,9 +278,8 @@ def set_distiller_key(index: int, key: int) -> MultiCastCommand: each spike received on the given distiller channel, defined by the peripheral routes in the SpiNNaker FPGA. - :param int index: The index of the channel to set (0-5) - :param int key: The key to set - :rtype: MulticastCommand + :param index: The index of the channel to set (0-5) + :param key: The key to set """ return SPIFRegister.DIST_KEY_BASE.cmd(key, index) @@ -303,9 +290,8 @@ def set_distiller_mask(index: int, mask: int) -> MultiCastCommand: each spike received on the given distiller channel, defined by the peripheral routes in the SpiNNaker FPGA. - :param int index: The index of the channel to set (0-5) - :param int mask: The mask to set - :rtype: MulticastCommand + :param index: The index of the channel to set (0-5) + :param mask: The mask to set """ return SPIFRegister.DIST_MASK_BASE.cmd(mask, index) @@ -317,10 +303,9 @@ def set_distiller_mask_delayed( each spike received on the given distiller channel, defined by the peripheral routes in the SpiNNaker FPGA. - :param int index: The index of the channel to set (0-5) - :param callable(int)->int mask_func: + :param index: The index of the channel to set (0-5) + :param mask_func: The function to call to set the mask - takes index as argument - :rtype: MulticastCommand """ return SPIFRegister.DIST_MASK_BASE.delayed_command(mask_func, index) @@ -330,9 +315,8 @@ def set_distiller_shift(index: int, shift: int) -> MultiCastCommand: This tells SPIF how much to shift the key after masking but before applying the distiller key. - :param int index: The index of the channel to set (0-5) - :param int shift: The shift to set - :rtype: MulticastCommand + :param index: The index of the channel to set (0-5) + :param shift: The shift to set """ return SPIFRegister.DIST_SHIFT_BASE.cmd(shift, index) @@ -346,14 +330,14 @@ class _DelayedMultiCastCommand(MultiCastCommand): def __init__(self, key: int, get_payload: Callable[[int], int], repeat: int, delay_between_repeats: int, index: int): """ - :param int key: The key to send - :param callable()->int get_payload: + :param key: The key to send + :param get_payload: A function to call that returns a payload. May be called multiple times; should produce the same value each time. - :param int repeat: The number of times to repeat the command - :param int delay_between_repeats: The delay between the repeats - :param int index: The index to pass to get_payload when called + :param repeat: The number of times to repeat the command + :param delay_between_repeats: The delay between the repeats + :param index: The index to pass to get_payload when called """ super().__init__( key, repeat=repeat, delay_between_repeats=delay_between_repeats) @@ -418,11 +402,9 @@ def cmd(self, payload: Optional[int] = None, :param payload: The payload to use in the command, or `None` for no payload - :type payload: int or None - :param int index: + :param index: The index of the register to send to when there are multiple registers starting from a base - :rtype: ~spinn_front_end_common.utility_models.MultiCastCommand """ return MultiCastCommand( _LC_KEY + self.value + index, payload, time=None, repeat=_REPEATS, @@ -435,12 +417,11 @@ def delayed_command( Make a command to send to the FPGA to set a register value, where the value itself is currently unknown. - :param callable(int)->int get_payload: + :param get_payload: A function to call to get the payload later, passing in the index - :param int index: + :param index: The index of the register to send to when there are multiple registers starting from a base - :rtype: ~spinn_front_end_common.utility_models.MultiCastCommand """ return _DelayedMultiCastCommand( _LC_KEY + self.value + index, get_payload, repeat=_REPEATS, @@ -451,9 +432,8 @@ def set_xp_key(index: int, key: int) -> MultiCastCommand: """ Get a command to set the key of the output via the FPGA. This tells the FPGA to route this key to the external device. - :param int index: The index of the channel to set (0-5) - :param int key: The key to set - :rtype: MulticastCommand + :param index: The index of the channel to set (0-5) + :param key: The key to set """ return SpiNNFPGARegister.XP_KEY_BASE.cmd(key, index) @@ -476,9 +456,8 @@ def set_xp_mask(index: int, mask: int) -> MultiCastCommand: This tells the FPGA to route keys after using this mask to the external device. - :param int index: The index of the channel to set (0-5) - :param int mask: The mask to set - :rtype: MulticastCommand + :param index: The index of the channel to set (0-5) + :param mask: The mask to set """ return SpiNNFPGARegister.XP_MASK_BASE.cmd(mask, index) @@ -490,8 +469,7 @@ def set_xp_mask_delayed( This tells the FPGA to route keys after using this mask to the external device. - :param int index: The index of the channel to set (0-5) - :param callable(int)->int mask_func: The function to call to get the mask - :rtype: MulticastCommand + :param index: The index of the channel to set (0-5) + :param mask_func: The function to call to get the mask """ return SpiNNFPGARegister.XP_MASK_BASE.delayed_command(mask_func, index) diff --git a/spynnaker/pyNN/external_devices_models/spif_input_device.py b/spynnaker/pyNN/external_devices_models/spif_input_device.py index 6c4b3da5c2a..ed737e9ea0d 100644 --- a/spynnaker/pyNN/external_devices_models/spif_input_device.py +++ b/spynnaker/pyNN/external_devices_models/spif_input_device.py @@ -69,26 +69,23 @@ def __init__(self, pipe: int, n_neurons: int, n_neurons_per_partition: int, chip_coords: Optional[Tuple[int, int]] = None): """ - :param int pipe: Which pipe on SPIF the retina is connected to - :param int n_neurons: The number of neurons in the device + :param pipe: Which pipe on SPIF the retina is connected to + :param n_neurons: The number of neurons in the device :param n_neurons_per_partition: The number of neurons per partition :param base_key: The key that is common over the whole vertex, or None to use the pipe number as the key - :type base_key: int or None :param board_address: The IP address of the board to which the FPGA is connected, or None to use the default board or chip_coords. Note chip_coords will be used first if both are specified, with board_address then being used if the coordinates don't connect to an FPGA. - :type board_address: str or None :param chip_coords: The coordinates of the chip to which the FPGA is connected, or None to use the default board or board_address. Note chip_coords will be used first if board_address is also specified, with board_address then being used if the coordinates don't connect to an FPGA. - :type chip_coords: tuple(int, int) or None """ # Do some checks if n_neurons_per_partition < self.INPUT_MASK: diff --git a/spynnaker/pyNN/external_devices_models/spif_output_device.py b/spynnaker/pyNN/external_devices_models/spif_output_device.py index 50c4a8c0533..5908bb656ff 100644 --- a/spynnaker/pyNN/external_devices_models/spif_output_device.py +++ b/spynnaker/pyNN/external_devices_models/spif_output_device.py @@ -77,19 +77,15 @@ def __init__(self, board_address: Optional[str] = None, """ :param board_address: The board IP address of the SPIF device :param chip_coords: The chip coordinates of the SPIF device - :type chip_coords: tuple(int, int) or None :param label: The label to give the SPIF device :param bool create_database: Whether the database will be used to decode keys or not :param database_notify_host: The host that will read the database - :type database_notify_host: str or None :param database_notify_port_num: The port of the host that will read the database - :type database_notify_port_num: int or None :param database_ack_port_num: The port to listen on for responses from the host reading the database - :type database_ack_port_num: int or None :param int output_key_shift: The shift to apply to the population indices when added to the key """ @@ -121,9 +117,9 @@ def set_output_key_and_mask( will not be checked; please make sure you are using values that make sense! - :param Population population: The PyNN source Population - :param int key: The key to "or" with the incoming key *after* masking - :param int mask: The mask to "and" with the incoming SpiNNaker key + :param population: The PyNN source Population + :param key: The key to "or" with the incoming key *after* masking + :param mask: The mask to "and" with the incoming SpiNNaker key """ # pylint: disable=protected-access self.__output_key_and_mask[population._vertex] = (key, mask) @@ -131,8 +127,7 @@ def set_output_key_and_mask( def __is_power_of_2(self, v: int) -> bool: """ Determine if a value is a power of 2. - :param int v: The value to test - :rtype: bool + :param v: The value to test """ return (v & (v - 1) == 0) and (v != 0) @@ -171,8 +166,7 @@ def _get_set_key_payload(self, index: int) -> int: """ Get the payload for the command to set the router key. - :param int index: The index of key to get - :rtype: int + :param index: The index of key to get """ r_infos = SpynnakerDataView.get_routing_infos() return r_infos.get_key_from( @@ -183,8 +177,7 @@ def _get_set_mask_payload(self, index: int) -> int: """ Get the payload for the command to set the router mask. - :param int index: The index of the mask to get - :rtype: int + :param index: The index of the mask to get """ r_infos = SpynnakerDataView.get_routing_infos() return r_infos.get_info_from( diff --git a/spynnaker/pyNN/external_devices_models/spif_retina_device.py b/spynnaker/pyNN/external_devices_models/spif_retina_device.py index 359733e0354..7b9e646ba5a 100644 --- a/spynnaker/pyNN/external_devices_models/spif_retina_device.py +++ b/spynnaker/pyNN/external_devices_models/spif_retina_device.py @@ -81,22 +81,21 @@ def __init__(self, pipe: int, width: int, height: int, sub_width: int, board_address: Optional[str] = None, chip_coords: Optional[Tuple[int, int]] = None): """ - :param int pipe: Which pipe on SPIF the retina is connected to - :param int width: The width of the retina in pixels - :param int height: The height of the retina in pixels - :param int sub_width: + :param pipe: Which pipe on SPIF the retina is connected to + :param width: The width of the retina in pixels + :param height: The height of the retina in pixels + :param sub_width: The width of rectangles to split the retina into for efficiency of sending - :param int sub_height: + :param sub_height: The height of rectangles to split the retina into for efficiency of sending :param base_key: The key that is common over the whole vertex, or `None` to use the pipe number as the key - :type base_key: int or None - :param int input_x_shift: + :param input_x_shift: The shift to get the x coordinate from the input keys sent to SPIF - :param int input_y_shift: + :param input_y_shift: The shift to get the y coordinate from the input keys sent to SPIF :param board_address: The IP address of the board to which the FPGA is connected, @@ -106,7 +105,6 @@ def __init__(self, pipe: int, width: int, height: int, sub_width: int, chip_coords will be used first if both are specified, with board_address then being used if the coordinates don't connect to an FPGA. - :type board_address: str or None :param chip_coords: The coordinates of the chip to which the FPGA is connected, or `None` to use the default board or board_address. @@ -115,7 +113,6 @@ def __init__(self, pipe: int, width: int, height: int, sub_width: int, chip_coords will be used first if board_address is also specified, with board_address then being used if the coordinates don't connect to an FPGA. - :type chip_coords: tuple(int, int) or None """ # Do some checks if sub_width < self.X_MASK + 1 or sub_height < self.Y_MASK + 1: diff --git a/spynnaker/pyNN/external_devices_models/threshold_type_multicast_device_control.py b/spynnaker/pyNN/external_devices_models/threshold_type_multicast_device_control.py index 0e56a37c83c..8f50b1e5cad 100644 --- a/spynnaker/pyNN/external_devices_models/threshold_type_multicast_device_control.py +++ b/spynnaker/pyNN/external_devices_models/threshold_type_multicast_device_control.py @@ -43,7 +43,7 @@ class ThresholdTypeMulticastDeviceControl(AbstractThresholdType): def __init__(self, devices: Sequence[AbstractMulticastControllableDevice]): """ - :param list(AbstractMulticastControllableDevice) device: + :param device: """ super().__init__( [Struct([ diff --git a/spynnaker/pyNN/extra_algorithms/connection_holder_finisher.py b/spynnaker/pyNN/extra_algorithms/connection_holder_finisher.py index a51c7b5831a..039d7f8ac42 100644 --- a/spynnaker/pyNN/extra_algorithms/connection_holder_finisher.py +++ b/spynnaker/pyNN/extra_algorithms/connection_holder_finisher.py @@ -20,8 +20,6 @@ def finish_connection_holders() -> None: """ Finishes the connection holders after data has been generated within them, allowing any waiting callbacks to be called. - - :param ~pacman.model.graphs.application.ApplicationGraph application_graph: """ edges = SpynnakerDataView.get_edges() progress = ProgressBar(len(edges), "Finalising Retrieved Connections") diff --git a/spynnaker/pyNN/extra_algorithms/delay_support_adder.py b/spynnaker/pyNN/extra_algorithms/delay_support_adder.py index 83bbc1a78dd..d6155c34a04 100644 --- a/spynnaker/pyNN/extra_algorithms/delay_support_adder.py +++ b/spynnaker/pyNN/extra_algorithms/delay_support_adder.py @@ -64,9 +64,6 @@ def add_delays(self) -> Tuple[ """ Adds the delay extensions to the application graph, now that all the splitter objects have been set. - - :rtype: tuple(list(DelayExtensionVertex), - list(Tuple(DelayedApplicationEdge, str))) """ progress = ProgressBar(1 + SpynnakerDataView.get_n_partitions(), "Adding delay extensions as required") @@ -95,9 +92,6 @@ def __examine_edge_for_delays_to_add( """ Look at a particular edge to see if it needs a delay vertex+edge inserted, and add it in if it does. - - :param ProjectionApplicationEdge edge: - :param ApplicationEdgePartition partition: """ # figure the max delay and if we need a delay extension n_stages, steps_per_stage, need_delay_ext = self._check_delay_values( @@ -120,10 +114,10 @@ def _create_post_delay_edge( Creates the edge between delay extension and post vertex. Stores for future loading to the application graph when safe to do so. - :param DelayExtensionVertex delay_app_vertex: delay extension vertex - :param ProjectionApplicationEdge app_edge: + :param delay_app_vertex: delay extension vertex + :param app_edge: the undelayed application edge this is associated with. - :param str partition_id: the partition id of the edge + :param partition_id: the partition id of the edge """ # check for post edge delayed_edge = self._delay_post_edge_map.get( @@ -151,13 +145,12 @@ def _create_delay_app_vertex_and_pre_edge( source vertex to this delay extension. Adds to the graph, as safe to do so. - :param ApplicationEdgePartition app_outgoing_edge_partition: + :param app_outgoing_edge_partition: the original outgoing edge partition. - :param ApplicationEdge app_edge: the undelayed application edge. - :param int delay_per_stage: delay for each delay stage - :param int n_delay_stages: the number of delay stages needed + :param app_edge: the undelayed application edge. + :param delay_per_stage: delay for each delay stage + :param n_delay_stages: the number of delay stages needed :return: the DelayExtensionAppVertex - :rtype: DelayExtensionVertex """ # get delay extension vertex if it already exists. delay_app_vertex = self._app_to_delay_map.get( @@ -192,7 +185,7 @@ def _check_delay_values(self, app_edge: ProjectionApplicationEdge)\ Checks the delay required from the user defined max, the max delay supported by the post vertex splitter and the delay Extensions. - :param ApplicationEdge app_edge: the undelayed application edge + :param app_edge: the undelayed application edge :return: tuple(n_delay_stages, delay_steps_per_stage, extension_needed) """ # get max delay required diff --git a/spynnaker/pyNN/extra_algorithms/neuron_expander.py b/spynnaker/pyNN/extra_algorithms/neuron_expander.py index d4c64c01a4a..53590528062 100644 --- a/spynnaker/pyNN/extra_algorithms/neuron_expander.py +++ b/spynnaker/pyNN/extra_algorithms/neuron_expander.py @@ -55,8 +55,6 @@ def _plan_expansion() -> Tuple[ ExecutableTargets, List[Tuple[AbstractNeuronExpandable, Placement]]]: """ Plan the expansion of neurons and set up the regions using USER1. - - :rtype: tuple(ExecutableTargets, list(tuple(MachineVertex, Placement))) """ neuron_bin = SpynnakerDataView.get_executable_path(NEURON_EXPANDER_APLX) txrx = SpynnakerDataView.get_transceiver() @@ -89,10 +87,8 @@ def _fill_in_initial_data(expanded_pop_vertices: List[ """ Once expander has run, fill in the connection data. - :param list(MachineVertex, Placement) expanded_pop_vertices: - List of machine vertices to read data from - :param ~spinnman.transceiver.Transceiver transceiver: - How to talk to the machine + :param expanded_pop_vertices: List of machine vertices to read data from + :param transceiver: How to talk to the machine """ progress = ProgressBar( len(expanded_pop_vertices), "Getting initial values") diff --git a/spynnaker/pyNN/extra_algorithms/splitter_components/abstract_spynnaker_splitter_delay.py b/spynnaker/pyNN/extra_algorithms/splitter_components/abstract_spynnaker_splitter_delay.py index 499f76e77c9..4b10b7cb40c 100644 --- a/spynnaker/pyNN/extra_algorithms/splitter_components/abstract_spynnaker_splitter_delay.py +++ b/spynnaker/pyNN/extra_algorithms/splitter_components/abstract_spynnaker_splitter_delay.py @@ -32,7 +32,6 @@ def max_support_delay(self) -> int: returns the max amount of delay this post vertex can support. :return: max delay supported in ticks - :rtype: int """ raise NotImplementedError @@ -44,7 +43,5 @@ def accepts_edges_from_delay_vertex(self) -> bool: If this method returns False and the users ask for a delay larger than that allowed by :py:meth:`max_support_delay`, an exception will be raised saying a different splitter is required. - - :rtype: bool """ return True diff --git a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_delay_vertex_slice.py b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_delay_vertex_slice.py index 5026b20fc47..bffe4dfeeaa 100644 --- a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_delay_vertex_slice.py +++ b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_delay_vertex_slice.py @@ -118,7 +118,6 @@ def create_machine_vertex( :param ~pacman.model.graphs.machine.MachineVertex source_vertex: The source of the delay :return: machine vertex - :rtype: DelayExtensionMachineVertex """ label = f"Delay extension for {source_app_vertex}" sdram = self.get_sdram_used_by_atoms() @@ -132,8 +131,6 @@ def create_machine_vertex( def get_sdram_used_by_atoms(self) -> AbstractSDRAM: """ Gets the amount of SDRAM used by the delay extension. - - :rtype: ~pacman.model.resources.ConstantSDRAM """ return ConstantSDRAM( SYSTEM_BYTES_REQUIREMENT + @@ -158,6 +155,5 @@ def get_machine_vertex( :param ~pacman.model.graphs.common.Slice vertex_slice: The slice to get the data for - :rtype: DelayExtensionMachineVertex """ return self._machine_vertex_by_slice[vertex_slice] diff --git a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_poisson_delegate.py b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_poisson_delegate.py index 70e64b612fc..be5e1b508be 100644 --- a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_poisson_delegate.py +++ b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_poisson_delegate.py @@ -35,8 +35,6 @@ class SplitterPoissonDelegate(SplitterFixedLegacy[SpikeSourcePoissonVertex]): def send_over_sdram(self) -> bool: """ Whether this vertex is to be sent using SDRAM. - - :rtype: bool """ # If there is only one outgoing projection, and it is one-to-one # connected to the target, and the target knows what to do, leave diff --git a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex.py b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex.py index 4e6984a5411..4a54796a3dd 100644 --- a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex.py +++ b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex.py @@ -67,8 +67,6 @@ def accepts_edges_from_delay_vertex(self) -> bool: def _get_fixed_slices(self) -> List[Slice]: """ Get a list of fixed slices from the Application vertex. - - :rtype: list(~pacman.model.graphs.common.Slice) """ if self.__slices is not None: return self.__slices diff --git a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex_fixed.py b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex_fixed.py index 62d05eaef3e..4bb3f675695 100644 --- a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex_fixed.py +++ b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex_fixed.py @@ -147,18 +147,6 @@ def create_machine_vertex( neuron_data: NeuronData) -> PopulationMachineCommon: """ Create the machine vertex for a slice. - - :param Slice vertex_slice: - :param AbstractSDRAM sdram: - :param str label: - :param int structural_sz: - :param list(list) ring_buffer_shifts: - :param ndarray weight_scales: - :param int index: - :param int max_atoms_per_core: - :param SynapticMatrices synaptic_matrices: - :param NeuronData neuron_data: - :rtype: PopulationMachineCommon """ # If using local-only create a local-only vertex s_dynamics = self.governed_app_vertex.synapse_dynamics @@ -180,9 +168,6 @@ def get_sdram_used_by_atoms( structural_sz: int) -> AbstractSDRAM: """ Gets the resources of a slice of atoms. - - :param int n_atoms: - :rtype: ~pacman.model.resources.MultiRegionSDRAM """ variable_sdram = self.__get_variable_sdram(n_atoms) constant_sdram = self.__get_constant_sdram( @@ -198,9 +183,8 @@ def __get_variable_sdram(self, n_atoms: int) -> AbstractSDRAM: """ Returns the variable SDRAM from the recorders. - :param int n_atoms: The number of atoms to account for + :param n_atoms: The number of atoms to account for :return: the variable SDRAM used by the neuron recorder - :rtype: VariableSDRAM """ s_dynamics = self.governed_app_vertex.synapse_dynamics if isinstance(s_dynamics, AbstractSynapseDynamicsStructural): @@ -218,8 +202,7 @@ def __get_constant_sdram( """ Returns the constant SDRAM used by the atoms. - :param int n_atoms: The number of atoms to account for - :rtype: ~pacman.model.resources.MultiRegionSDRAM + :param n_atoms: The number of atoms to account for """ s_dynamics = self.governed_app_vertex.synapse_dynamics n_record = ( @@ -272,9 +255,7 @@ def __get_synapse_constant_sdram( """ Get the amount of fixed SDRAM used by synapse parts. - :param int n_atoms: The number of atoms to account for - - :rtype: ~pacman.model.resources.MultiRegionSDRAM + :param n_atoms: The number of atoms to account for """ regions = PopulationMachineVertex.SYNAPSE_REGIONS sdram = MultiRegionSDRAM() diff --git a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex_neurons_synapses.py b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex_neurons_synapses.py index 1377d03eab4..09d8dddb9b7 100644 --- a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex_neurons_synapses.py +++ b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex_neurons_synapses.py @@ -262,18 +262,17 @@ def __add_neuron_core( """ Add a neuron core for for a slice of neurons. - :param ~pacman.model.graphs.common.Slice vertex_slice: + :param vertex_slice: The slice of neurons to put on the core - :param ~pacman.model.resources.MultiRegionSDRAM sdram: - :param str label: The name to give the core - :param int index: The index of the slice in the ordered list of slices - :param list(int) rb_shifts: + :param sdram: + :param label: The name to give the core + :param index: The index of the slice in the ordered list of slices + :param rb_shifts: The computed ring-buffer shift values to use to get the weights back to S1615 values - :param list(int) weight_scales: + :param weight_scales: The scale to apply to weights to encode them in the 16-bit synapses :return: The neuron vertex created and the resources used - :rtype: PopulationNeuronsMachineVertex """ neuron_vertex = PopulationNeuronsMachineVertex( sdram, @@ -298,22 +297,20 @@ def __add_lead_synapse_core( Add the first synapse core for a neuron core. This core will generate all the synaptic data required. - :param ~pacman.model.graphs.common.Slice vertex_slice: + :param vertex_slice: The slice of neurons on the neuron core - :param AbstractSDRAM lead_synapse_core_sdram: + :param lead_synapse_core_sdram: The SDRAM that will be used by every lead synapse core - :param str label: The name to give the core - :param list(int) rb_shifts: + :param label: The name to give the core + :param rb_shifts: The computed ring-buffer shift values to use to get the weights back to S1615 values - :param list(int) weight_scales: + :param weight_scales: The scale to apply to weights to encode them in the 16-bit synapses :param synapse_vertices: A list to add the core to - :type synapse_vertices: - list(~pacman.model.graphs.machine.MachineVertex) - :param PopulationNeuronsMachineVertex neuron_vertex: + :param neuron_vertex: The neuron vertex the synapses will feed into - :param int atoms_per_core: The maximum atoms per core + :param atoms_per_core: The maximum atoms per core :return: References to the synapse regions that can be used by a shared synapse core, the basic label for the synapse cores, the feedback partition (if needed), and the lead synapse core @@ -348,17 +345,13 @@ def __add_shared_synapse_core( Add a second or subsequent synapse core. This will reference the synaptic data generated by the lead synapse core. - :param str syn_label: The basic synapse core label to be extended - :param int s_index: The index of the synapse core (0 is the lead core) - :param ~pacman.model.graphs.common.Slice vertex_slice: - The slice of neurons on the neuron core - :param SynapseRegionReferences synapse_references: - References to the synapse regions - :param ~pacman.model.resources.AbstractSDRAM shared_synapse_sdram: + :param syn_label: The basic synapse core label to be extended + :param s_index: The index of the synapse core (0 is the lead core) + :param vertex_slice: The slice of neurons on the neuron core + :param synapse_references: References to the synapse regions + :param shared_synapse_sdram: :param feedback_partition: :param synapse_vertices: A list to add the core to - :type synapse_vertices: - list(~pacman.model.graphs.machine.MachineVertex) :param PopulationNeuronsMachineVertex neuron_vertex: The neuron vertex the synapses will feed into :return: The @@ -387,11 +380,8 @@ def __add_plastic_feedback( Add an edge if needed from the neuron core back to the synapse core to allow the synapse core to process plastic synapses. - :param PopulationNeuronsMachineVertex neuron_vertex: - The neuron vertex to start the edge at - :param PopulationSynapsesMachineVertexCommon synapse_vertex: - A synapse vertex to feed the spikes back to - :rtype: MulticastEdgePartition + :param neuron_vertex: The neuron vertex to start the edge at + :param synapse_vertex: A synapse vertex to feed the spikes back to """ # If synapse dynamics is not simply static, link the neuron vertex # back to the synapse vertex @@ -427,7 +417,7 @@ def __handle_poisson_sources(self, label: str) -> Dict[Slice, List[Tuple[ splitters that work with us, and one-to-one connections that will then work with SDRAM. - :param str label: Base label to give to the Poisson cores + :param label: Base label to give to the Poisson cores """ # The only way to avoid circular imports is to import here # pylint: disable=import-outside-toplevel @@ -593,8 +583,7 @@ def __get_neuron_sdram( Gets the resources of the neurons of a slice of atoms from a given application vertex. - :param ~pacman.model.graphs.common.Slice vertex_slice: the slice - :rtype: ~pacman.model.resources.MultiRegionSDRAM + :param vertex_slice: the slice """ n_record = len(self.governed_app_vertex.neuron_recordables) variable_sdram = \ @@ -654,10 +643,9 @@ def __get_synapse_sdram( Get the resources of the synapses of a slice of atoms from a given application vertex. - :param ~pacman.model.graphs.common.Slice vertex_slice: the slice - :param ~pacman.model.resources.MultiRegionSDRAM shared_sdram: + :param vertex_slice: the slice + :param shared_sdram: The SDRAM shared between cores, if this is to be included - :rtype: ~pacman.model.resources.MultiRegionSDRAM """ n_record = len(self.governed_app_vertex.synapse_recordables) variable_sdram = \ @@ -686,8 +674,6 @@ def __get_synapse_sdram( def __independent_synapse_sdram(self) -> MultiRegionSDRAM: """ Get the SDRAM used by all synapse cores independent of projections. - - :rtype: ~pacman.model.resources.MultiRegionSDRAM """ regions = PopulationSynapsesMachineVertexLead.SYNAPSE_REGIONS sdram = MultiRegionSDRAM() @@ -701,9 +687,8 @@ def __proj_dependent_synapse_sdram(self) -> MultiRegionSDRAM: """ Get the SDRAM used by synapse cores dependent on the projections. - :param list(~spynnaker.pyNN.models.Projection) incoming_projections: + :param incoming_projections: The projections to consider in the calculations - :rtype: ~pacman.model.resources.MultiRegionSDRAM """ regions = PopulationSynapsesMachineVertexLead.SYNAPSE_REGIONS sdram = MultiRegionSDRAM() diff --git a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_utils.py b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_utils.py index d647733a46c..43c4e05f3bd 100644 --- a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_utils.py +++ b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_utils.py @@ -31,19 +31,12 @@ def is_direct_poisson_source( """ Determine if a given Poisson source can be created by this splitter. - :param ~pacman.model.graphs.application.ApplicationVertex pre_vertex: - The vertex sending into the Projection - :param connector: - The connector in use in the Projection - :type connector: - ~spynnaker.pyNN.models.neural_projections.connectors.AbstractConnector + :param pre_vertex: The vertex sending into the Projection + :param connector: The connector in use in the Projection :param dynamics: The synapse dynamics in use in the Projection - :type dynamics: - ~spynnaker.pyNN.models.neuron.synapse_dynamics.AbstractSynapseDynamics :param delay: The delay in use in the Projection - :rtype: bool """ return (isinstance(pre_vertex, SpikeSourcePoissonVertex) and isinstance(pre_vertex.splitter, SplitterPoissonDelegate) and diff --git a/spynnaker/pyNN/extra_algorithms/spynnaker_connection_holder_generations.py b/spynnaker/pyNN/extra_algorithms/spynnaker_connection_holder_generations.py index 646a8bb8bd5..450ecd6126e 100644 --- a/spynnaker/pyNN/extra_algorithms/spynnaker_connection_holder_generations.py +++ b/spynnaker/pyNN/extra_algorithms/spynnaker_connection_holder_generations.py @@ -29,13 +29,9 @@ def __call__(self, application_graph: ApplicationGraph) -> Mapping[ ConnectionHolder]: """ :param application_graph: application graph - :type application_graph: - ~pacman.model.graphs.application.ApplicationGraph :return: the set of connection holders for after data specification generation - :rtype: dict(tuple(ProjectionApplicationEdge, SynapseInformation), - ConnectionHolder) """ progress = ProgressBar( application_graph.n_outgoing_edge_partitions, @@ -61,10 +57,6 @@ def _generate_holder_for_edge( edge: ProjectionApplicationEdge, data_holders: Dict[ Tuple[ProjectionApplicationEdge, SynapseInformation], ConnectionHolder]) -> None: - """ - :param ProjectionApplicationEdge edge: - :param dict data_holders: - """ # build connection holders connection_holder = ConnectionHolder( None, True, edge.pre_vertex.n_atoms, edge.post_vertex.n_atoms) diff --git a/spynnaker/pyNN/extra_algorithms/spynnaker_neuron_network_specification_report.py b/spynnaker/pyNN/extra_algorithms/spynnaker_neuron_network_specification_report.py index 9dde48cf804..5d8ea01dc0b 100644 --- a/spynnaker/pyNN/extra_algorithms/spynnaker_neuron_network_specification_report.py +++ b/spynnaker/pyNN/extra_algorithms/spynnaker_neuron_network_specification_report.py @@ -35,10 +35,6 @@ def _get_diagram(label: str) -> Tuple[gv.Digraph, Type[gv.ExecutableNotFound]]: - """ - :param str label: - :rtype: tuple(~graphviz.Digraph, type) - """ # pylint: disable=import-error,import-outside-toplevel try: import graphviz @@ -56,7 +52,7 @@ def spynnaker_neuron_graph_network_specification_report() -> None: Produces a report describing the graph created from the neural populations and projections. - :param str report_folder: the report folder to put figure into + :param report_folder: the report folder to put figure into """ # create holders for data dot_diagram, exe_not_found_exn = _get_diagram(_GRAPH_TITLE) @@ -97,10 +93,7 @@ def _generate_vertices( dot_diagram: gv.Digraph, progress: ProgressBar) -> Dict[ApplicationVertex, str]: """ - :param ~graphviz.Digraph dot_diagram: - :param ~.ProgressBar progress: :return: the mapping from vertex to ID for the generated vertices - :rtype: dict(~.ApplicationVertex,str) """ vertex_ids: Dict[ApplicationVertex, str] = dict() for vertex_counter, vertex in progress.over( @@ -116,11 +109,6 @@ def _generate_vertices( def _generate_edges( dot_diagram: gv.Digraph, vertex_ids: Dict[ApplicationVertex, str], progress: ProgressBar) -> None: - """ - :param ~graphviz.Digraph dot_diagram: - :param dict(~.ApplicationVertex,str) vertex_ids: - :param ~.ProgressBar progress: - """ for partition in progress.over( SpynnakerDataView.iterate_partitions(), False): for edge in partition.edges: diff --git a/spynnaker/pyNN/extra_algorithms/spynnaker_synaptic_matrix_report.py b/spynnaker/pyNN/extra_algorithms/spynnaker_synaptic_matrix_report.py index 76c4204d511..f6d28bd04de 100644 --- a/spynnaker/pyNN/extra_algorithms/spynnaker_synaptic_matrix_report.py +++ b/spynnaker/pyNN/extra_algorithms/spynnaker_synaptic_matrix_report.py @@ -56,9 +56,6 @@ def __call__(self, connection_holder: Dict[Tuple[ :param connection_holder: where the synaptic matrices are stored (possibly after retrieval from the machine) - :type connection_holder: - dict(tuple(ProjectionApplicationEdge, SynapseInformation), - ConnectionHolder) """ # generate folder for synaptic reports top_level_folder = os.path.join( diff --git a/spynnaker/pyNN/extra_algorithms/synapse_expander.py b/spynnaker/pyNN/extra_algorithms/synapse_expander.py index a55759e4eb7..c96442ff82f 100644 --- a/spynnaker/pyNN/extra_algorithms/synapse_expander.py +++ b/spynnaker/pyNN/extra_algorithms/synapse_expander.py @@ -65,7 +65,6 @@ def _plan_expansion() -> Tuple[ExecutableTargets, List[Placement], float]: :return: The places to load the synapse expander and delay expander executables, the target machine vertices to read synapses back from, and an estimated timeout for how long the expansion should be let run. - :rtype: tuple(~.ExecutableTargets, list(~.Placement), float) """ synapse_bin = SpynnakerDataView.get_executable_path(SYNAPSE_EXPANDER_APLX) expander_cores = ExecutableTargets() diff --git a/spynnaker/pyNN/models/abstract_models/abstract_accepts_incoming_synapses.py b/spynnaker/pyNN/models/abstract_models/abstract_accepts_incoming_synapses.py index 7cf57580771..2e56b4c7570 100644 --- a/spynnaker/pyNN/models/abstract_models/abstract_accepts_incoming_synapses.py +++ b/spynnaker/pyNN/models/abstract_models/abstract_accepts_incoming_synapses.py @@ -45,8 +45,7 @@ def get_synapse_id_by_target(self, target: str) -> Optional[int]: """ Get the ID of a synapse given the name. - :param str target: The name of the synapse - :rtype: int + :param target: The name of the synapse """ raise NotImplementedError @@ -56,7 +55,7 @@ def set_synapse_dynamics( """ Set the synapse dynamics of this vertex. - :param AbstractSynapseDynamics synapse_dynamics: + :param synapse_dynamics: """ raise NotImplementedError @@ -67,11 +66,10 @@ def get_connections_from_machine( """ Get the connections from the machine post-run. - :param ProjectionApplicationEdge app_edge: + :param ApplicationEdge app_edge: The edge for which the data is being read - :param SynapseInformation synapse_info: + :param synapse_info: The specific projection within the edge - :rtype: ~numpy.ndarray """ raise NotImplementedError @@ -91,7 +89,7 @@ def verify_splitter( Any Vertex that implements this API should override `ApplicationVertex.splitter` method to also call this function. - :param AbstractSpynnakerSplitterDelay splitter: the splitter + :param splitter: the splitter :raises PacmanConfigurationException: if the splitter is not an instance of AbstractSpynnakerSplitterDelay """ diff --git a/spynnaker/pyNN/models/abstract_models/abstract_has_delay_stages.py b/spynnaker/pyNN/models/abstract_models/abstract_has_delay_stages.py index 3c1675fe324..71bcfd8b384 100644 --- a/spynnaker/pyNN/models/abstract_models/abstract_has_delay_stages.py +++ b/spynnaker/pyNN/models/abstract_models/abstract_has_delay_stages.py @@ -33,7 +33,5 @@ def n_delay_stages(self) -> int: """ The maximum number of delay stages required by any connection out of this delay extension vertex. - - :rtype: int """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/abstract_models/abstract_neuron_expandable.py b/spynnaker/pyNN/models/abstract_models/abstract_neuron_expandable.py index 25b5d9685f1..8e7d57eca00 100644 --- a/spynnaker/pyNN/models/abstract_models/abstract_neuron_expandable.py +++ b/spynnaker/pyNN/models/abstract_models/abstract_neuron_expandable.py @@ -39,8 +39,6 @@ def gen_neurons_on_machine(self) -> bool: .. note:: The typical implementation for this method will be to ask the neuron data - - :rtype: bool """ raise NotImplementedError @@ -49,8 +47,6 @@ def gen_neurons_on_machine(self) -> bool: def neuron_generator_region(self) -> int: """ The region containing the parameters of neuron expansion. - - :rtype: int """ raise NotImplementedError @@ -59,7 +55,6 @@ def read_generated_initial_values(self, placement: Placement) -> None: """ Fill in any requested initial values. - :param ~pacman.model.placements.Placement placement: - Where the data is on the machine + :param placement: Where the data is on the machine """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/abstract_models/abstract_synapse_expandable.py b/spynnaker/pyNN/models/abstract_models/abstract_synapse_expandable.py index 79f08834bfb..3dbdf300620 100644 --- a/spynnaker/pyNN/models/abstract_models/abstract_synapse_expandable.py +++ b/spynnaker/pyNN/models/abstract_models/abstract_synapse_expandable.py @@ -44,8 +44,6 @@ def gen_on_machine(self) -> bool: .. note:: The typical implementation for this method will be to ask the app_vertex's synapse_manager - - :rtype: bool """ raise NotImplementedError @@ -54,8 +52,6 @@ def gen_on_machine(self) -> bool: def connection_generator_region(self) -> int: """ The region ID containing the parameters of synaptic expansion. - - :rtype: int """ raise NotImplementedError @@ -64,8 +60,7 @@ def read_generated_connection_holders(self, placement: Placement) -> None: """ Fill in the connection holders. - :param ~pacman.model.placements.Placement placement: - Where the data is on the machine + :param placement: Where the data is on the machine """ raise NotImplementedError @@ -75,8 +70,6 @@ def max_gen_data(self) -> int: """ The maximum amount of synaptic data to be generated. This is used to calculate the timeout of the execution. - - :rtype: int """ raise NotImplementedError @@ -86,7 +79,5 @@ def bit_field_size(self) -> int: """ The amount of bit field data to be generated. This is used to calculate the timeout of the execution. - - :rtype: int """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/abstract_models/coloured_application_vertex.py b/spynnaker/pyNN/models/abstract_models/coloured_application_vertex.py index 6962db554d6..ed3525a3fa2 100644 --- a/spynnaker/pyNN/models/abstract_models/coloured_application_vertex.py +++ b/spynnaker/pyNN/models/abstract_models/coloured_application_vertex.py @@ -30,7 +30,5 @@ def n_colour_bits(self) -> int: The number of colour bits sent by this vertex. Assumed 0 unless overridden - - :rtype: int """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/abstract_models/has_shape_key_fields.py b/spynnaker/pyNN/models/abstract_models/has_shape_key_fields.py index 2078f525c0f..38c6fce2c39 100644 --- a/spynnaker/pyNN/models/abstract_models/has_shape_key_fields.py +++ b/spynnaker/pyNN/models/abstract_models/has_shape_key_fields.py @@ -32,8 +32,7 @@ def get_shape_key_fields( given source vertex slice, as a list of start, size, mask, shift values in the order of the fields. - :param ~pacman.model.graphs.common.Slice vertex_slice: + :param vertex_slice: The slice of the source vertex - :rtype: list(tuple(int, int, int, int)) """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/abstract_models/has_synapses.py b/spynnaker/pyNN/models/abstract_models/has_synapses.py index 823ae97b738..593c0ade80b 100644 --- a/spynnaker/pyNN/models/abstract_models/has_synapses.py +++ b/spynnaker/pyNN/models/abstract_models/has_synapses.py @@ -35,12 +35,8 @@ def get_connections_from_machine( """ Get the connections from the machine for this vertex. - :param ~pacman.model.placements.Placement placement: - Where the connection data is on the machine - :param ProjectionApplicationEdge app_edge: - The edge for which the data is being read - :param SynapseInformation synapse_info: - The specific projection within the edge - :rtype: list(~numpy.ndarray) + :param placement: Where the connection data is on the machine + :param app_edge: The edge for which the data is being read + :param synapse_info: The specific projection within the edge """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/abstract_models/receives_synaptic_inputs_over_sdram.py b/spynnaker/pyNN/models/abstract_models/receives_synaptic_inputs_over_sdram.py index 1c3eda5c375..1e0cb13a597 100644 --- a/spynnaker/pyNN/models/abstract_models/receives_synaptic_inputs_over_sdram.py +++ b/spynnaker/pyNN/models/abstract_models/receives_synaptic_inputs_over_sdram.py @@ -41,8 +41,6 @@ def weight_scales(self) -> NDArray[floating]: """ A list of scale factors to be applied to weights that get passed over SDRAM, one for each synapse type. - - :rtype: list(int) """ raise NotImplementedError @@ -53,7 +51,5 @@ def n_bytes_for_transfer(self) -> int: The number of bytes to be sent over the channel. This will be calculated using the above numbers, but also rounded up to a number of words, and with the number of neurons rounded up to a power of 2. - - :rtype: int """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/abstract_models/sends_synaptic_inputs_over_sdram.py b/spynnaker/pyNN/models/abstract_models/sends_synaptic_inputs_over_sdram.py index 27b867973c3..e16ab645c10 100644 --- a/spynnaker/pyNN/models/abstract_models/sends_synaptic_inputs_over_sdram.py +++ b/spynnaker/pyNN/models/abstract_models/sends_synaptic_inputs_over_sdram.py @@ -33,7 +33,5 @@ def set_sdram_partition( :param sdram_partition: The SDRAM partition to receive synapses from - :type sdram_partition: - ~pacman.model.graphs.machine.SourceSegmentedSDRAMMachinePartition """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/abstract_models/supports_structure.py b/spynnaker/pyNN/models/abstract_models/supports_structure.py index 214666978c0..20840b52306 100644 --- a/spynnaker/pyNN/models/abstract_models/supports_structure.py +++ b/spynnaker/pyNN/models/abstract_models/supports_structure.py @@ -25,6 +25,6 @@ def set_structure(self, structure: BaseStructure) -> None: """ Set the structure of the object. - :param ~pynn.space.BaseStructure structure: The structure to set + :param structure: The structure to set """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/common/eieio_spike_recorder.py b/spynnaker/pyNN/models/common/eieio_spike_recorder.py index 8661016bb9f..5642ff1c13c 100644 --- a/spynnaker/pyNN/models/common/eieio_spike_recorder.py +++ b/spynnaker/pyNN/models/common/eieio_spike_recorder.py @@ -32,7 +32,7 @@ def __init__(self) -> None: @property def record(self) -> bool: """ - :rtype: bool + If the recorder is set to record """ return self.__record diff --git a/spynnaker/pyNN/models/common/local_only_2d_common.py b/spynnaker/pyNN/models/common/local_only_2d_common.py index eec9c7f3875..b6c316670dc 100644 --- a/spynnaker/pyNN/models/common/local_only_2d_common.py +++ b/spynnaker/pyNN/models/common/local_only_2d_common.py @@ -51,9 +51,8 @@ def get_div_const(value: int) -> int: """ Get the values used to perform fast division by an integer constant - :param int value: The value to be divided by + :param value: The value to be divided by :return: The values required encoded as fields of a 32-bit integer - :rtype: int """ log_val = int(ceil(log2(value))) log_m_val = ((2 ** log_val) - value) / value @@ -98,10 +97,9 @@ def get_rinfo_for_spike_source( Get the routing information for the source of a projection in the given partition. - :param ApplicationVertex pre_vertex: The source of incoming data - :param str partition_id: The partition ID to get the routing info from + :param pre_vertex: The source of incoming data + :param partition_id: The partition ID to get the routing info from :return: Routing information, core mask, core mask shift - :rtype: AppVertexRoutingInfo, int, int """ routing_info = SpynnakerDataView.get_routing_infos() @@ -131,7 +129,6 @@ def get_sources_for_target(app_vertex: "PopulationVertex") -> Dict[ :param PopulationVertex app_vertex: The vertex being targeted :return: A dict of source ApplicationVertex to list of source information - :rtype: dict(tuple(ApplicationVertex, str), list(Source)) """ sources = defaultdict(list) for incoming in app_vertex.incoming_projections: @@ -147,8 +144,7 @@ def get_first_and_last_slice(pre_vertex: ApplicationVertex) -> \ """ Get the first and last slice of an application vertex. - :param ApplicationVertex pre_vertex: The source vertex - :rtype: tuple(Slice, Slice) or tuple(MDSlice, MDSlice) + :param pre_vertex: The source vertex """ if isinstance(pre_vertex, ApplicationVirtualVertex): if len(pre_vertex.atoms_shape) == 1: diff --git a/spynnaker/pyNN/models/common/multi_spike_recorder.py b/spynnaker/pyNN/models/common/multi_spike_recorder.py index 521773fae0d..d963cbcc0f4 100644 --- a/spynnaker/pyNN/models/common/multi_spike_recorder.py +++ b/spynnaker/pyNN/models/common/multi_spike_recorder.py @@ -45,9 +45,8 @@ def record(self, record: bool) -> None: def get_sdram_usage_in_bytes( self, n_neurons: int, spikes_per_timestep: float) -> AbstractSDRAM: """ - :param int n_neurons: - :param float spikes_per_timestep: - :rtype: ~pacman.model.resources.AbstractSDRAM + :param n_neurons: + :param spikes_per_timestep: """ if not self.__record: return ConstantSDRAM(0) diff --git a/spynnaker/pyNN/models/common/neuron_recorder.py b/spynnaker/pyNN/models/common/neuron_recorder.py index c920189d146..21444890f1a 100644 --- a/spynnaker/pyNN/models/common/neuron_recorder.py +++ b/spynnaker/pyNN/models/common/neuron_recorder.py @@ -140,18 +140,14 @@ def __init__( events_per_core_variables: Sequence[str], events_per_core_datatypes: Mapping[str, DataType]): """ - :param list(str) allowed_variables: - :param dict(str,~data_specification.enums.DataType) data_types: - :param list(str) bitfield_variables: - :param int n_neurons: - :param list(str) per_timestep_variables: + :param allowed_variables: + :param data_types: + :param bitfield_variables: + :param n_neurons: + :param per_timestep_variables: :param per_timestep_datatypes: - :type per_timestep_datatypes: - dict(str,~data_specification.enums.DataType) - :param list(str) events_per_core_variables: + :param events_per_core_variables: :param events_per_core_datatypes: - :type events_per_core_datatypes: - dict(str,~data_specification.enums.DataType) """ self.__sampling_rates: Dict[str, int] = dict() self.__indexes: Dict[str, Optional[Sequence[int]]] = dict() @@ -188,7 +184,7 @@ def add_region_offset(self, offset: int) -> None: Add an offset to the regions. Used when there are multiple recorders on a single core. - :param int offset: The offset to add + :param offset: The offset to add """ if not self.__offset_added: self.__region_ids = dict( @@ -201,8 +197,7 @@ def get_region(self, variable: str) -> int: """ Get the region of a variable. - :param str variable: The variable to get the region of - :rtype: int + :param variable: The variable to get the region of """ return self.__region_ids[variable] @@ -227,10 +222,6 @@ def _rate_and_count_per_slice( def _max_recording_per_slice( self, variable: str, n_atoms: int) -> Optional[int]: - """ - :param str variable: - :param int n_atoms: - """ if variable not in self.__sampling_rates: return None if self.__sampling_rates[variable] == 0: @@ -249,9 +240,8 @@ def neurons_recording( self, variable: str, vertex_slice: Slice) -> Optional[Collection[int]]: """ - :param str variable: - :param ~pacman.model.graphs.common.Slice vertex_slice: - :rtype: None or iterable(int) + :param variable: + :param vertex_slice: """ if variable not in self.__sampling_rates: return None @@ -307,18 +297,15 @@ def _get_placement_matrix_data( """ Processes a placement for matrix data. - :param ~pacman.model.placements.Placements placements: - the placements object - :param ~pacman.model.graphs.machine.MachineVertex vertex: - the vertex to read from - :param int region: the recording region id - :param int expected_rows: + :param placements: the placements object + :param vertex: the vertex to read from + :param region: the recording region id + :param expected_rows: how many rows the tools think should be recorded - :param str missing_str: string for reporting missing stuff - :param int sampling_rate: the rate of sampling - :param str label: the vertex label. + :param missing_str: string for reporting missing stuff + :param sampling_rate: the rate of sampling + :param label: the vertex label. :return: placement data - :rtype: ~numpy.ndarray """ placement = SpynnakerDataView.get_placement_of_vertex(vertex) if n_per_timestep == 0: @@ -366,10 +353,7 @@ def get_recorded_indices( Get the indices being recorded for a given variable. :param application_vertex: The vertex being recorded - :type application_vertex: - ~pacman.model.graphs.application.ApplicationVertex - :param str variable: The name of the variable to get the indices of - :rtype: iterable(int) + :param variable: The name of the variable to get the indices of """ if variable not in self.__sampling_rates: return [] @@ -393,8 +377,7 @@ def get_sampling_interval_ms(self, variable: str) -> float: def get_buffer_data_type(self, variable: str) -> BufferDataType: """ - :param str variable: - :rtype: BufferDataType + :param variable: """ if variable == self.SPIKES: return BufferDataType.NEURON_SPIKES @@ -408,8 +391,7 @@ def get_buffer_data_type(self, variable: str) -> BufferDataType: def get_data_type(self, variable: str) -> Optional[DataType]: """ - :param str variable: - :rtype: ~data_specification.enums.DataType + :param variable: """ if variable in self.__per_timestep_variables: return self.__per_timestep_datatypes[variable] @@ -419,7 +401,7 @@ def get_data_type(self, variable: str) -> Optional[DataType]: def get_recordable_variables(self) -> List[str]: """ - :rtype: list(str) + Names of variables being recorded """ return [ *self.__sampling_rates.keys(), @@ -428,14 +410,13 @@ def get_recordable_variables(self) -> List[str]: def get_event_recordable_variables(self) -> List[str]: """ - :rtype: list(str) + Names of event variables being recorded """ return list(self.__events_per_core_variables) def is_recording(self, variable: str) -> bool: """ - :param str variable: - :rtype: bool + :param variable: """ try: return self.__sampling_rates[variable] > 0 @@ -449,8 +430,7 @@ def is_recordable(self, variable: str) -> bool: """ Identify if the given variable can be recorded. - :param str variable: The variable to check for - :rtype: bool + :param variable: The variable to check for """ return (variable in self.__sampling_rates or variable in self.__per_timestep_variables or @@ -474,7 +454,7 @@ def recording_variables(self) -> Iterable[str]: @property def recorded_region_ids(self) -> Iterable[int]: """ - :rtype: iterable(int) + The ids of the regions for each variable being recorded. """ for variable, rate in self.__sampling_rates.items(): if rate > 0: @@ -489,11 +469,6 @@ def recorded_region_ids(self) -> Iterable[int]: yield self.__region_ids[variable] def _is_recording(self, variable: str, vertex_slice: Slice) -> bool: - """ - :param str variable: - :param ~pacman.model.graphs.common.Slice vertex_slice: - :rtype: bool - """ # event per core and per_timestep variables are not recorded by slice, # so True if present if variable in self.__events_per_core_recording: @@ -509,8 +484,7 @@ def _is_recording(self, variable: str, vertex_slice: Slice) -> bool: def recorded_ids_by_slice(self, vertex_slice: Slice) -> List[int]: """ - :param ~pacman.model.graphs.common.Slice vertex_slice: - :rtype: list(int) + :param vertex_slice: """ # This needs to produce a new list every time; callers modify it variables = [ @@ -536,9 +510,8 @@ def _compute_rate(self, sampling_interval: Optional[float]) -> int: Convert a sampling interval into a rate. Remember, machine time step is in nanoseconds - :param int sampling_interval: interval between samples in microseconds + :param sampling_interval: interval between samples in microseconds :return: rate - :rtype: int """ if sampling_interval is None: return 1 @@ -556,9 +529,6 @@ def _compute_rate(self, sampling_interval: Optional[float]) -> int: return rate def _check_indexes(self, indexes: Optional[Collection[int]]) -> None: - """ - :param set(int) indexes: - """ if indexes is None: return @@ -588,10 +558,6 @@ def __check_per_timestep_params( """ Check if certain parameters have been provided for a per-timestep variable and if so, raise an Exception. - - :param str variable: - :param sampling_interval: - :param indexes: """ if sampling_interval is not None: raise ValueError( @@ -607,10 +573,6 @@ def __check_events_per_core_params( """ Check if certain parameters have been provided for an events-per-core variable and if so, raise an Exception. - - :param str variable: - :param sampling_interval: - :param indexes: """ if sampling_interval is not None: raise ValueError( @@ -623,11 +585,6 @@ def __check_events_per_core_params( def _turn_off_recording( self, variable: str, sampling_interval: Optional[float], remove_indexes: Optional[Collection[int]]) -> None: - """ - :param str variable: - :param sampling_interval: - :param remove_indexes: - """ # If a per-timestep variable, remove it and return if variable in self.__per_timestep_variables: if variable in self.__per_timestep_recording: @@ -679,10 +636,6 @@ def _turn_off_recording( def _check_complete_overwrite( self, variable: str, indexes: Optional[Collection[int]]) -> None: - """ - :param str variable: - :param indexes: - """ if indexes is None: # overwriting all OK! return @@ -702,11 +655,6 @@ def _check_complete_overwrite( def _turn_on_recording( self, variable: str, sampling_interval: Optional[float], indexes: Optional[Collection[int]]) -> None: - """ - :param str variable: - :param sampling_interval: - :param indexes: - """ # If a per-timestep variable, update if variable in self.__per_timestep_variables: self.__check_per_timestep_params( @@ -747,10 +695,10 @@ def set_recording(self, variable: str, new_state: bool, sampling_interval: Optional[float] = None, indexes: Optional[Collection[int]] = None) -> None: """ - :param str variable: PyNN variable name - :param bool new_state: - :param int sampling_interval: - :param iterable(int) indexes: + :param variable: PyNN variable name + :param new_state: + :param sampling_interval: + :param indexes: """ if variable == "all": for key in self.__sampling_rates: @@ -777,8 +725,7 @@ def get_region_sizes(self, vertex_slice: Slice) -> List[int]: Get the sizes of the regions for the variables, whether they are recorded or not, with those that are not having a size of 0. - :param ~pacman.model.graphs.common.Slice vertex_slice: - :rtype: list(int) + :param vertex_slice: """ return [ self.get_buffered_sdram(variable, vertex_slice) @@ -792,11 +739,9 @@ def write_neuron_recording_region( """ Recording data specification. - :param ~data_specification.DataSpecificationGenerator spec: - where to write the data specification - :param int neuron_recording_region: the recording region - :param ~pacman.model.graphs.common.Slice vertex_slice: - the vertex slice + :param spec: where to write the data specification + :param neuron_recording_region: the recording region + :param vertex_slice: the vertex slice """ spec.switch_write_focus(neuron_recording_region) @@ -814,9 +759,8 @@ def _get_buffered_sdram_per_record( """ Return the SDRAM used per record. - :param str variable: PyNN variable name + :param variable: PyNN variable name :return: usage - :rtype: int """ if variable in self.__per_timestep_variables: if variable not in self.__per_timestep_recording: @@ -845,10 +789,9 @@ def get_buffered_sdram_per_record( """ Return the SDRAM used per record. - :param str variable: PyNN variable name - :param ~pacman.model.graphs.common.Slice vertex_slice: + :param variable: PyNN variable name + :param vertex_slice: :return: usage - :rtype: int """ _, n_neurons = self._rate_and_count_per_slice(variable, vertex_slice) return self._get_buffered_sdram_per_record(variable, n_neurons) @@ -858,9 +801,8 @@ def get_max_buffered_sdram_per_record( """ Return the SDRAM used per record. - :param str variable: PyNN variable name + :param variable: PyNN variable name :return: usage - :rtype: int """ n_neurons = self._max_recording_per_slice(variable, n_atoms) or 0 return self._get_buffered_sdram_per_record(variable, n_neurons) @@ -873,10 +815,9 @@ def get_buffered_sdram_per_timestep( In the case where sampling is used it returns the average for recording and none recording based on the recording rate - :param str variable: PyNN variable name - :param ~pacman.model.graphs.common.Slice vertex_slice: + :param variable: PyNN variable name + :param vertex_slice: :return: usage - :rtype: int """ if variable in self.__per_timestep_variables: if variable not in self.__per_timestep_recording: @@ -909,9 +850,8 @@ def get_sampling_overflow_sdram(self, vertex_slice: Slice) -> int: where time_steps is a multiple of sampling rate + 1, and recording is done in the first and last time_step - :param ~pacman.model.graphs.common.Slice vertex_slice: + :param vertex_slice: :return: Highest possible overflow needed - :rtype: int """ # No need to consider per-timestep variables here as they won't # overflow @@ -932,10 +872,9 @@ def get_buffered_sdram( If required the total is rounded up so the space will always fit. - :param str variable: The PyNN variable name to get buffered SDRAM of - :param ~pacman.model.graphs.common.Slice vertex_slice: + :param variable: The PyNN variable name to get buffered SDRAM of + :param vertex_slice: :return: data size - :rtype: int """ n_machine_time_steps = SpynnakerDataView.get_max_run_time_steps() # Per timestep variables can't be done at a specific rate @@ -962,8 +901,7 @@ def get_metadata_sdram_usage_in_bytes(self, n_atoms: int) -> int: """ Get the SDRAM usage of the metadata for recording. - :param int n_atoms: The number of atoms to record - :rtype: int + :param n_atoms: The number of atoms to record """ # This calculates the size of the metadata only; thus no reference to # per-timestep variables which have no metadata @@ -984,8 +922,7 @@ def get_generator_sdram_usage_in_bytes(self, n_atoms: int) -> int: """ Get the SDRAM usage of the generator data for recording metadata. - :param int n_atoms: The number of atoms to be recorded - :rtype: int + :param n_atoms: The number of atoms to be recorded """ n_indices = self.__ceil_n_indices(n_atoms) n_bytes_for_indices = n_indices * self._N_BYTES_PER_INDEX @@ -1003,8 +940,7 @@ def get_generator_sdram_usage_in_bytes(self, n_atoms: int) -> int: def get_variable_sdram_usage(self, vertex_slice: Slice) -> AbstractSDRAM: """ - :param ~pacman.model.graphs.common.Slice vertex_slice: - :rtype: ~pacman.model.resources.VariableSDRAM + :param vertex_slice: """ fixed_sdram = 0.0 per_timestep_sdram = 0.0 @@ -1034,8 +970,7 @@ def get_variable_sdram_usage(self, vertex_slice: Slice) -> AbstractSDRAM: def get_max_variable_sdram_usage(self, n_atoms: int) -> AbstractSDRAM: """ - :param ~pacman.model.graphs.common.Slice vertex_slice: - :rtype: ~pacman.model.resources.VariableSDRAM + :param n_atoms: """ fixed_sdram = 0.0 per_timestep_sdram = 0.0 @@ -1068,8 +1003,7 @@ def __ceil_n_indices(self, n_neurons: int) -> int: """ The number of indices rounded up to a whole number of words. - :param int n_neurons: The number of neurons to account for - :rtype: int + :param n_neurons: The number of neurons to account for """ # Assumes that BYTES_PER_WORD is divisible by _N_BYTES_PER_INDEX n_bytes = n_neurons * self._N_BYTES_PER_INDEX @@ -1079,13 +1013,6 @@ def __ceil_n_indices(self, n_neurons: int) -> int: def __add_indices( self, data: List[NDArray[uint32]], variable: str, rate: int, n_recording: int, vertex_slice: Slice) -> None: - """ - :param list(~numpy.ndarray) data: - :param str variable: - :param int rate: - :param int n_recording: - :param ~pacman.model.graphs.common.Slice vertex_slice: - """ n_indices = self.__ceil_n_indices(vertex_slice.n_atoms) if rate == 0: # Not recording anything so all indices are 0 @@ -1113,10 +1040,6 @@ def __add_indices( numpy.array(local_indexes, dtype=uint16).view(uint32)) def _get_data(self, vertex_slice: Slice) -> NDArray[uint32]: - """ - :param ~pacman.model.graphs.common.Slice vertex_slice: - :rtype: ~numpy.ndarray - """ # There is no data here for per-timestep variables by design data: List[NDArray[uint32]] = list() for variable in self.__sampling_rates: @@ -1134,7 +1057,7 @@ def _get_data(self, vertex_slice: Slice) -> NDArray[uint32]: def set_max_rewires_per_ts(self, max_rewires_per_ts: int) -> None: """ - :param int max_rewires_per_ts: the maximum rewires per timestep + :param max_rewires_per_ts: the maximum rewires per timestep """ self.__events_per_ts[self.MAX_REWIRES] = max_rewires_per_ts @@ -1147,8 +1070,6 @@ def is_global_generatable(self) -> bool: """ Whether the data for all neurons the same, i.e., all or none of the neurons are recorded for all variables. - - :rtype: bool """ for variable in self.__sampling_rates: if variable in self.__indexes: @@ -1163,8 +1084,6 @@ def get_generator_data( :param vertex_slice: The slice to generate the data for, or `None` to generate for all neurons (assuming all the same, otherwise error) - :type vertex_slice: ~pacman.model.graphs.common.Slice or None - :rtype: numpy.ndarray """ n_vars = len(self.__sampling_rates) - len(self.__bitfield_variables) data = [n_vars, len(self.__bitfield_variables)] diff --git a/spynnaker/pyNN/models/common/param_generator_data.py b/spynnaker/pyNN/models/common/param_generator_data.py index dfc2507527d..f1b2fd9dd76 100644 --- a/spynnaker/pyNN/models/common/param_generator_data.py +++ b/spynnaker/pyNN/models/common/param_generator_data.py @@ -35,9 +35,8 @@ def get_generator_type(data_type: DataType) -> int: """ - :param ~data_specification.enums.DataType data_type: + :param data_type: :return: The generator parameter type code for the given data type. - :rtype: int :raises TypeError: If an unsupported data type is given """ if data_type in _GENERATOR_TYPES: @@ -47,11 +46,10 @@ def get_generator_type(data_type: DataType) -> int: def type_has_generator(data_type: DataType) -> bool: """ - :param ~data_specification.enums.DataType data_type: + :param data_type: :return: Whether there is a generator parameter type code for the given data type. - :rtype: bool """ return data_type in _GENERATOR_TYPES @@ -77,7 +75,6 @@ def param_generator_id(value: _ParamType) -> int: """ :param value: The value to examine the type of. :return: The ID of the on-chip generator that handles the value. - :rtype: int :raises TypeError: If an value of an unsupported data type is given """ # Scalars are fine on the machine @@ -97,7 +94,6 @@ def is_param_generatable(value: Any) -> bool: """ :param value: The value to examine the type of. :return: Whether the value is of a type that can be generated on chip. - :rtype: bool """ if isinstance(value, str): return False @@ -112,8 +108,6 @@ def param_generator_params(values: _ParamType) -> NDArray[uint32]: Get the parameter generator parameters as a numpy array. :param values: - :type values: float or ~pyNN.random.RandomDistribution - :rtype: ~numpy.ndarray """ if numpy.isscalar(values): return numpy.array( @@ -144,8 +138,6 @@ def param_generator_params_size_in_bytes(values: _ParamType) -> int: Get the size of the parameter generator parameters in bytes. :param values: - :type values: int or ~pyNN.random.RandomDistribution - :rtype: int :raises TypeError: If `values` is of an unsupported data type """ if numpy.isscalar(values): diff --git a/spynnaker/pyNN/models/common/parameter_holder.py b/spynnaker/pyNN/models/common/parameter_holder.py index 250ccf9ae5a..d7fdb2373fc 100644 --- a/spynnaker/pyNN/models/common/parameter_holder.py +++ b/spynnaker/pyNN/models/common/parameter_holder.py @@ -47,13 +47,10 @@ def __init__( selector: Selector = None): """ :param data_items_to_return: A list of data fields to be returned - :type data_items_to_return: list(str) or tuple(str) :param get_call: A function to call to read a value - :type get_call: callable(str, selector)->list :param selector: a description of the subrange to accept, or `None` for all. See: :py:meth:`~spinn_utilities.ranged.AbstractSized.selector_to_ids` - :type selector: None or slice or int or list(bool) or list(int) """ self.__data_items_to_return: Union[str, Tuple[str, ...]] if isinstance(data_items_to_return, str): @@ -85,8 +82,6 @@ def _safe_read_values(self, parameter: str) -> Union[List[float], float]: def _get_data_items(self) -> Dict[str, List[float]]: """ Merges the parameters and values in to the final data items - - :rtype: dict """ # If there are already merged connections cached, return those if self.__data_items is not None: @@ -171,8 +166,6 @@ def __hash__(self) -> int: def keys(self) -> Iterable[str]: """ The names of the data - - :rtype: iter(str) """ data = self._get_data_items() return data.keys() @@ -180,8 +173,6 @@ def keys(self) -> Iterable[str]: def values(self) -> Iterable[List[float]]: """ The names and values of the data - - :rtype: iter(list(float)) """ data = self._get_data_items() return data.values() @@ -189,8 +180,6 @@ def values(self) -> Iterable[List[float]]: def items(self) -> Iterable[Tuple[str, List[float]]]: """ The names and values of the data - - :rtype: iter(tuple(str, list(float))) """ data = self._get_data_items() return data.items() diff --git a/spynnaker/pyNN/models/common/population_application_vertex.py b/spynnaker/pyNN/models/common/population_application_vertex.py index 4ea20f0cfb4..69b82652bc1 100644 --- a/spynnaker/pyNN/models/common/population_application_vertex.py +++ b/spynnaker/pyNN/models/common/population_application_vertex.py @@ -51,8 +51,6 @@ def _as_list(names: Names) -> List[str]: Normalise the input to a list. :param names: The item or items to normalise - :type names: str or list - :rtype: list(str) """ if isinstance(names, str): return [names] @@ -65,9 +63,8 @@ def _check_names(names: Names, allowed: Container[str], Check the list of names are allowed or not. :param names: The names to check - :type names: str or list - :param set(str) allowed: The set of allowed names - :param str type_of_thing: The "type of thing" to report in any error + :param allowed: The set of allowed names + :param type_of_thing: The "type of thing" to report in any error :raises KeyError: If one of the names is not allowed """ for name in PopulationApplicationVertex._as_list(names): @@ -80,8 +77,7 @@ def _check_parameters(names: Names, allowed: Container[str]) -> None: Check that parameters are allowed. :param names: The names to check - :type names: str or list - :param set(str) allowed: The set of allowed names + :param allowed: The set of allowed names """ PopulationApplicationVertex._check_names(names, allowed, "parameter") @@ -91,8 +87,7 @@ def _check_variables(names: Names, allowed: Container[str]) -> None: Check that state variables are allowed. :param names: The names to check - :type names: str or list - :param set(str) allowed: The set of allowed names + :param allowed: The set of allowed names """ PopulationApplicationVertex._check_names(names, allowed, "variable") @@ -103,11 +98,9 @@ def get_parameter_values( Population or a subset if the selector is used. :param names: The name or names of the parameter to get - :type names: str or list :param selector: a description of the subrange to accept, or ``None`` for all. See: :py:meth:`~spinn_utilities.ranged.AbstractSized.selector_to_ids` - :type selector: None or slice or int or list(bool) or list(int) :rtype: ParameterHolder :raise KeyError: if the parameter is not something that can be read """ @@ -120,11 +113,10 @@ def set_parameter_values( Set the values of a parameter for the whole Population or a subset if the selector is used. - :param str name: The name of the parameter to set + :param name: The name of the parameter to set :param selector: a description of the subrange to accept, or ``None`` for all. See: :py:meth:`~spinn_utilities.ranged.AbstractSized.selector_to_ids` - :type selector: None or slice or int or list(bool) or list(int) :raise KeyError: if the parameter is not something that can be changed """ raise KeyError( @@ -133,8 +125,6 @@ def set_parameter_values( def get_parameters(self) -> List[str]: """ Get the names of all the parameters that can be obtained - - :rtype: list(str) """ return [] @@ -145,12 +135,9 @@ def get_initial_state_values( or a subset if the selector is used. :param names: The name or names of the variable to get - :type names: str or list(str) :param selector: a description of the subrange to accept, or ``None`` for all. See: :py:meth:`~spinn_utilities.ranged.AbstractSized.selector_to_ids` - :type selector: None or slice or int or list(bool) or list(int) - :rtype: ParameterHolder :raise KeyError: if the variable is not something that can be read """ raise KeyError( @@ -163,11 +150,10 @@ def set_initial_state_values( Set the initial values of a state variable for the whole Population or a subset if the selector is used. - :param str name: The name of the variable to set + :param name: The name of the variable to set :param selector: a description of the subrange to accept, or ``None`` for all. See: :py:meth:`~spinn_utilities.ranged.AbstractSized.selector_to_ids` - :type selector: None or slice or int or list(bool) or list(int) :raise KeyError: if the variable is not something that can be changed """ raise KeyError( @@ -181,12 +167,9 @@ def get_current_state_values( or a subset if the selector is used. :param names: The name or names of the variable to get - :type names: str or list(str) :param selector: a description of the subrange to accept, or ``None`` for all. See: :py:meth:`~spinn_utilities.ranged.AbstractSized.selector_to_ids` - :type selector: None or slice or int or list(bool) or list(int) - :rtype: ParameterHolder :raise KeyError: if the variable is not something that can be read """ raise KeyError( @@ -199,11 +182,10 @@ def set_current_state_values( Set the current values of a state variable for the whole Population or a subset if the selector is used. - :param str name: The name of the variable to set + :param name: The name of the variable to set :param selector: a description of the subrange to accept, or ``None`` for all. See: :py:meth:`~spinn_utilities.ranged.AbstractSized.selector_to_ids` - :type selector: None or slice or int or list(bool) or list(int) :raise KeyError: if the variable is not something that can be changed """ raise KeyError( @@ -213,8 +195,6 @@ def set_current_state_values( def get_state_variables(self) -> List[str]: """ Get a list of supported state variables. - - :rtype: list(str) """ return [] @@ -222,8 +202,7 @@ def get_units(self, name: str) -> str: """ Get the units of the given parameter or state variable. - :param str name: the name of the parameter to get the units of - :rtype: str + :param name: the name of the parameter to get the units of :raise KeyError: if the name isn't recognised or the units cannot be identified """ @@ -237,8 +216,6 @@ def conductance_based(self) -> bool: By default this is False; override if the model accepts conductance based input. - - :rtype: bool """ return False @@ -251,8 +228,6 @@ def get_recordable_variables(self) -> List[str]: Get a list of the names and types of things that can be recorded. This methods list the variable recorded via the Population. - - :rtype: list(str) """ return [] @@ -262,13 +237,11 @@ def set_recording( """ Set a variable recording. - :param str name: The name of the variable to set the status of + :param name: The name of the variable to set the status of :param sampling_interval: How often the variable should be recorded or `None` for every time step, in milliseconds - :type sampling_interval: float or None :param indices: The list of neuron indices to record or `None` for all - :type indices: list(int) or None :raises KeyError: if the variable cannot be recorded """ _ = (name, sampling_interval, indices) @@ -283,10 +256,9 @@ def set_not_recording(self, name: str, """ Set a variable not recording. - :param str name: The name of the variable to not record + :param name: The name of the variable to not record :param indices: The list of neuron indices to not record or `None` for all - :type indices: list(int) or None :raises KeyError: if the variable cannot be stopped from recording """ _ = (name, indices) @@ -299,8 +271,6 @@ def set_not_recording(self, name: str, def get_recording_variables(self) -> List[str]: """ Get a list of variables that are currently being recorded. - - :rtype: list(str) """ if not self.get_recordable_variables(): return [] @@ -315,9 +285,7 @@ def get_buffer_data_type(self, name: str) -> BufferDataType: The buffer data type controls how data returned by the cores is handled in NeoBufferDatabase. - :param str name: The name of the variable recorded - :rtype: - ~spinn_front_end_common.interface.buffer_management.storage_objects.BufferDatabase + :param name: The name of the variable recorded :raises KeyError: if the variable isn't being recorded """ if name not in self.get_recordable_variables(): @@ -333,7 +301,6 @@ def get_sampling_interval_ms(self, name: str) -> float: The values is in ms and unless selective recording is used will be `SpynnakerDataView.get_simulation_time_step_us()` - :rtype: float :raises KeyError: If the variable isn't being recorded """ if name not in self.get_recordable_variables(): @@ -349,8 +316,7 @@ def get_data_type(self, name: str) -> Optional[DataType]: This is the type of data the C code is returning. For instance data such as spikes this will be `None`. - :param str name: The name of the variable to get the type of - :rtype: ~data_specification.enums.DataType or None + :param name: The name of the variable to get the type of :raise KeyError: If the variable isn't recordable """ if name not in self.get_recordable_variables(): @@ -363,8 +329,7 @@ def get_recording_region(self, name: str) -> int: """ Gets the recording region for the named variable. - :param str name: The name of the variable to get the region of - :rtype: int + :param name: The name of the variable to get the region of :raises KeyError: If the variable isn't being recorded """ if name not in self.get_recordable_variables(): @@ -381,11 +346,10 @@ def get_neurons_recording( Typically `vertex_slice.get_raster_ids(atoms_shape)` but may be a sublist if doing selective recording. - :param str name: The name of the variable to get the region of - :param ~pacman.model.graphs.common.Slice vertex_slice: + :param name: The name of the variable to get the region of + :param vertex_slice: :return: A list of the global raster IDs of the atoms in recording named variable within this slice - :rtype: list(int) """ _ = (name, vertex_slice) if name not in self.get_recordable_variables(): @@ -401,12 +365,10 @@ def inject(self, current_source: AbstractCurrentSource, """ Inject a current source into this population. - :param AbstractCurrentSource current_source: - the current source to be injected + :param current_source: the current source to be injected :param selector: a description of the subrange to accept, or ``None`` for all. See: :py:meth:`~spinn_utilities.ranged.AbstractSized.selector_to_ids` - :type selector: None or slice or int or list(bool) or list(int) :raises \ ~spinn_front_end_common.utilities.exceptions.ConfigurationException: if the population doesn't support injection diff --git a/spynnaker/pyNN/models/common/recording_utils.py b/spynnaker/pyNN/models/common/recording_utils.py index c80fdeaec81..fecea31141c 100644 --- a/spynnaker/pyNN/models/common/recording_utils.py +++ b/spynnaker/pyNN/models/common/recording_utils.py @@ -18,8 +18,7 @@ def make_missing_string(missing: Iterable[Placement]) -> str: """ - :param iterable(~pacman.model.placements.Placement) missing: - :rtype: str + :param missing: """ return "; ".join( f"({placement.x}, {placement.y}, {placement.p})" diff --git a/spynnaker/pyNN/models/current_sources/abstract_current_source.py b/spynnaker/pyNN/models/current_sources/abstract_current_source.py index 4f52385229c..0cd2ceea3f8 100644 --- a/spynnaker/pyNN/models/current_sources/abstract_current_source.py +++ b/spynnaker/pyNN/models/current_sources/abstract_current_source.py @@ -57,7 +57,7 @@ def inject_into(self, cells: PopulationBase) -> None: """ Inject this source into the specified population cells. - :param PopulationBase cells: The cells to inject the source into + :param cells: The cells to inject the source into """ # Call the population method to pass the source in cells.inject(self) @@ -66,7 +66,7 @@ def set_app_vertex(self, vertex: PopulationVertex) -> None: """ Set the application vertex associated with the current source. - :param PopulationVertex vertex: The population vertex + :param vertex: The population vertex """ self.__app_vertex = vertex @@ -74,8 +74,6 @@ def set_app_vertex(self, vertex: PopulationVertex) -> None: def app_vertex(self) -> Optional[PopulationVertex]: """ The application vertex associated with the current source. - - :rtype: PopulationVertex """ return self.__app_vertex @@ -83,7 +81,7 @@ def set_population(self, population: Population) -> None: """ Set the population associated with the current source. - :param ~spynnaker.pyNN.models.populations.Population population: + :param population: """ self.__population = population @@ -91,8 +89,6 @@ def set_population(self, population: Population) -> None: def population(self) -> Optional[Population]: """ The population associated with the current source. - - :rtype: ~spynnaker.pyNN.models.populations.Population """ return self.__population @@ -110,8 +106,6 @@ def set_parameters(self, **parameters: CurrentParameter) -> None: def parameters(self) -> Mapping[str, CurrentParameter]: """ The parameters of the current source. - - :rtype: dict(str, Any) """ raise NotImplementedError @@ -120,8 +114,6 @@ def parameters(self) -> Mapping[str, CurrentParameter]: def parameter_types(self) -> Mapping[str, DataType]: """ The parameter types for the current source. - - :rtype: dict(str, ~.DataType) """ raise NotImplementedError @@ -130,8 +122,6 @@ def parameter_types(self) -> Mapping[str, DataType]: def current_source_id(self) -> int: """ The ID of the current source. - - :rtype: int """ raise NotImplementedError @@ -139,7 +129,5 @@ def current_source_id(self) -> int: def get_sdram_usage_in_bytes(self) -> int: """ The SDRAM usage in bytes of the current source. - - :rtype: int """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/current_sources/ac_source.py b/spynnaker/pyNN/models/current_sources/ac_source.py index 9c46918f5d9..c4ad25b0fcc 100644 --- a/spynnaker/pyNN/models/current_sources/ac_source.py +++ b/spynnaker/pyNN/models/current_sources/ac_source.py @@ -47,12 +47,12 @@ def __init__(self, start: float = 0.0, stop: float = 0.0, amplitude: float = 0.0, offset: float = 0.0, frequency: float = 0.0, phase: float = 0.0) -> None: """ - :param float start: - :param float stop: - :param float amplitude: - :param float offset: - :param float frequency: - :param float phase: + :param start: + :param stop: + :param amplitude: + :param offset: + :param frequency: + :param phase: """ # There's probably no need to actually store these as you can't # access them directly in pynn anyway @@ -123,8 +123,6 @@ def get_sdram_usage_in_bytes(self) -> int: def _get_frequency(self, frequency: CurrentParameter) -> float: """ Convert frequency to radian-friendly value. - - :rtype: float """ if not isinstance(frequency, (int, float)): raise TypeError @@ -135,8 +133,6 @@ def _get_frequency(self, frequency: CurrentParameter) -> float: def _get_phase(self, phase: CurrentParameter) -> float: """ Convert phase to radian-friendly value. - - :rtype: float """ if not isinstance(phase, (int, float)): raise TypeError diff --git a/spynnaker/pyNN/models/current_sources/dc_source.py b/spynnaker/pyNN/models/current_sources/dc_source.py index e081167b905..11d963848df 100644 --- a/spynnaker/pyNN/models/current_sources/dc_source.py +++ b/spynnaker/pyNN/models/current_sources/dc_source.py @@ -36,9 +36,9 @@ class DCSource(AbstractCurrentSource): def __init__(self, amplitude: float = 0.0, start: float = 0.0, stop: float = 0.0) -> None: """ - :param float amplitude: - :param float start: - :param float stop: + :param amplitude: + :param start: + :param stop: """ # There's probably no need to actually store these as you can't # access them directly in pynn anyway diff --git a/spynnaker/pyNN/models/current_sources/noisy_current_source.py b/spynnaker/pyNN/models/current_sources/noisy_current_source.py index 9164b07acd7..faeb913c2d2 100644 --- a/spynnaker/pyNN/models/current_sources/noisy_current_source.py +++ b/spynnaker/pyNN/models/current_sources/noisy_current_source.py @@ -48,11 +48,11 @@ def __init__(self, mean: float = 0.0, stdev: float = 0.0, start: float = 0.0, stop: float = 0.0, dt: float = 1.0, rng: None = None) -> None: """ - :param float mean: - :param float stdev: - :param float start: - :param float stop: - :param float dt: + :param mean: + :param stdev: + :param start: + :param stop: + :param dt: :param rng: """ # There's probably no need to actually store these as you can't diff --git a/spynnaker/pyNN/models/current_sources/step_current_source.py b/spynnaker/pyNN/models/current_sources/step_current_source.py index ba595c4ff2a..523c6ca6de5 100644 --- a/spynnaker/pyNN/models/current_sources/step_current_source.py +++ b/spynnaker/pyNN/models/current_sources/step_current_source.py @@ -35,8 +35,8 @@ class StepCurrentSource(AbstractCurrentSource): def __init__( self, times: Sequence[int] = (), amplitudes: Sequence[float] = ()): """ - :param list(int) times: - :param list(float) amplitudes: + :param times: + :param amplitudes: """ # There's probably no need to actually store these as you can't # access them directly in pynn anyway diff --git a/spynnaker/pyNN/models/neural_projections/connectors/abstract_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/abstract_connector.py index b3ad1d55581..34d6b2dc23c 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/abstract_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/abstract_connector.py @@ -81,15 +81,15 @@ class AbstractConnector(object, metaclass=AbstractBase): def __init__(self, safe: bool = True, callback: None = None, verbose: bool = False): """ - :param bool safe: if True, check that weights and delays have valid + :param safe: if True, check that weights and delays have valid values. If False, this check is skipped. (NB: SpiNNaker always checks.) - :param callable callback: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: Not supported by sPyNNaker. - :param bool verbose: + :param verbose: Whether to output extra information about the connectivity to a CSV file """ @@ -107,7 +107,7 @@ def set_space(self, space: Space) -> None: """ Set the space object (allowed after instantiation). - :param ~pyNN.space.Space space: + :param space: """ self.__space = space @@ -116,7 +116,7 @@ def set_projection_information( """ Sets a connectors projection info. - :param SynapseInformation synapse_info: the synapse info + :param synapse_info: the synapse info """ _ = synapse_info self.__min_delay = SpynnakerDataView.get_simulation_time_step_ms() @@ -128,8 +128,7 @@ def _get_delay_minimum( Get the minimum delay given a float or RandomDistribution. :param delays: the delays - :type delays: ~spynnaker.pyNN.RandomDistribution or int or float or str - :param int n_connections: how many connections + :param n_connections: how many connections """ if isinstance(delays, RandomDistribution): low_estimated_delay = utility_calls.get_minimum_probable_value( @@ -152,10 +151,6 @@ def _get_delay_maximum( synapse_info: SynapseInformation) -> float: """ Get the maximum delay given a float or RandomDistribution. - - :param delays: - :type delays: ~pyNN.random.RandomDistribution or int or float or str - :param int n_connections: """ if isinstance(delays, RandomDistribution): max_estimated_delay = utility_calls.get_maximum_probable_value( @@ -179,7 +174,7 @@ def get_delay_maximum( """ Get the maximum delay specified by the user in ms,. - :param SynapseInformation synapse_info: the synapse info + :param synapse_info: the synapse info """ raise NotImplementedError @@ -190,8 +185,7 @@ def get_delay_minimum( Get the minimum delay specified by the user in ms, or `None` if unbounded. - :param SynapseInformation synapse_info: - :rtype: int or None + :param synapse_info: """ raise NotImplementedError @@ -201,8 +195,6 @@ def get_delay_variance(self, delays: DELAYS, Get the variance of the delays. :param delays: - :type delays: ~pyNN.random.RandomDistribution or int or float or str - :rtype: float """ if isinstance(delays, RandomDistribution): return utility_calls.get_variance(delays) @@ -222,12 +214,10 @@ def _get_n_connections_from_pre_vertex_with_delay_maximum( max_delay given given a float, RandomDistribution or list of delays. :param delays: - :type delays: spynnaker.pyNN.RandomDistribution or int or float or str - :param int n_total_connections: - :param int n_connections: - :param float min_delay: - :param float max_delay: - :rtype: int + :param n_total_connections: + :param n_connections: + :param min_delay: + :param max_delay: """ if isinstance(delays, RandomDistribution): prob_in_range = utility_calls.get_probability_within_range( @@ -273,12 +263,10 @@ def get_n_connections_from_pre_vertex_maximum( Not all concrete connectors support omitting the delay range. :param delays: - :type delays: ~pyNN.random.RandomDistribution or int or float or str - :param int n_post_atoms: - :param SynapseInformation synapse_info: - :param float min_delay: - :param float max_delay: - :rtype: int + :param n_post_atoms: + :param synapse_info: + :param min_delay: + :param max_delay: """ raise NotImplementedError @@ -300,8 +288,6 @@ def get_weight_mean(self, weights: WEIGHTS, Get the mean of the weights. :param weights: - :type weights: ~pyNN.random.RandomDistribution or int or float or str - :rtype: float """ if isinstance(weights, RandomDistribution): return abs(utility_calls.get_mean(weights)) @@ -317,11 +303,6 @@ def _get_weight_maximum( synapse_info: SynapseInformation) -> float: """ Get the maximum of the weights. - - :param weights: - :type weights: ~pyNN.random.RandomDistribution or int or float or str - :param int n_connections: - :rtype: float """ if isinstance(weights, RandomDistribution): mean_weight = utility_calls.get_mean(weights) @@ -351,8 +332,7 @@ def get_weight_maximum(self, synapse_info: SynapseInformation) -> float: """ Get the maximum of the weights for this connection. - :param SynapseInformation synapse_info: - :rtype: float + :param synapse_info: """ raise NotImplementedError @@ -362,8 +342,6 @@ def get_weight_variance(self, weights: WEIGHTS, Get the variance of the weights. :param weights: - :type weights: ~pyNN.random.RandomDistribution or int or float or str - :rtype: float """ if isinstance(weights, RandomDistribution): return utility_calls.get_variance(weights) @@ -382,8 +360,7 @@ def _expand_distances(self, d_expression: str) -> bool: coordinates, and we assume the user has specified an expression such as `d[0] + d[2]`. - :param str d_expression: - :rtype: bool + :param d_expression: """ regexpr = re.compile(r'.*d\[\d*\].*') return bool(regexpr.match(d_expression)) @@ -403,10 +380,9 @@ def _generate_random_values( self, values: RandomDistribution, n_connections: int, post_vertex_slice: Slice) -> NDArray[float64]: """ - :param ~pyNN.random.RandomDistribution values: - :param int n_connections: - :param ~pacman.model.graphs.common.Slice post_vertex_slice: - :rtype: ~numpy.ndarray + :param values: + :param n_connections: + :param post_vertex_slice: """ key = (id(post_vertex_slice), id(values)) seed = self.__param_seeds.get(key, None) @@ -429,7 +405,6 @@ def _no_space_exception( :param values: :param synapse_info: - :rtype: SpynnakerException """ return SpynnakerException( f"Str Weights or delays {values} are distance-dependent " @@ -489,15 +464,6 @@ def _generate_values( targets: numpy.ndarray, n_connections: int, post_slice: Slice, synapse_info: SynapseInformation, weights: bool) -> NDArray[float64]: - """ - :param values: - :type values: ~pyNN.random.RandomDistribution or int or float or str - or callable - :param int n_connections: - :param ~pacman.model.graphs.common.Slice post_slice: - :param SynapseInformation synapse_info: - :rtype: ~numpy.ndarray - """ if isinstance(values, RandomDistribution): return self._generate_random_values( values, n_connections, post_slice) @@ -541,11 +507,6 @@ def _generate_weights( synapse_info: SynapseInformation) -> numpy.ndarray: """ Generate weight values. - - :param int n_connections: - :param ~pacman.model.graphs.common.Slice post_slice: - :param SynapseInformation synapse_info: - :rtype: ~numpy.ndarray """ weights = self._generate_values( synapse_info.weights, sources, targets, n_connections, post_slice, @@ -563,9 +524,6 @@ def _generate_weights( def _clip_delays(self, delays: NDArray[float64]) -> NDArray[float64]: """ Clip delay values, keeping track of how many have been clipped. - - :param ~numpy.ndarray delays: - :rtype: ~numpy.ndarray """ # count values that could be clipped self.__n_clipped_delays = numpy.sum(delays < self.__min_delay) @@ -581,11 +539,6 @@ def _generate_delays( synapse_info: SynapseInformation) -> numpy.ndarray: """ Generate valid delay values. - - :param int n_connections: - :param ~pacman.model.graphs.common.Slice post_slice: - :param SynapseInformation synapse_info: - :rtype: ~numpy.ndarray """ delays = self._generate_values( synapse_info.delays, sources, targets, n_connections, post_slice, @@ -624,7 +577,7 @@ def get_provenance_data(self, synapse_info: SynapseInformation) -> None: @property def safe(self) -> bool: """ - :rtype: bool + Safe value supplied. Note ignored by sPyNNaker """ return self.__safe @@ -636,8 +589,6 @@ def safe(self, new_value: bool) -> None: def space(self) -> Optional[Space]: """ The space object (may be updated after instantiation). - - :rtype: ~pyNN.space.Space or None """ return self.__space @@ -646,14 +597,14 @@ def space(self, new_value: Space) -> None: """ Set the space object (allowed after instantiation). - :param ~pyNN.space.Space new_value: + :param new_value: """ self.__space = new_value @property def verbose(self) -> bool: """ - :rtype: bool + verbose value supplied by user """ return self.__verbose @@ -669,17 +620,10 @@ def get_connected_vertices( Get the machine vertices that are connected to each other with this connector - :param SynapseInformation s_info: - The synapse information of the connection + :param s_info: The synapse information of the connection :param source_vertex: The source of the spikes - :type source_vertex: - ~pacman.model.graphs.application.ApplicationVertex :param target_vertex: The target of the spikes - :type target_vertex: - ~pacman.model.graphs.application.ApplicationVertex :return: A list of tuples of (target machine vertex, list of sources) - :rtype: list(tuple(~pacman.model.graphs.machine.MachineVertex, - list(~pacman.model.graphs.AbstractVertex))) """ # By default, just return that the whole target connects to the # whole source @@ -694,7 +638,7 @@ def connect(self, projection: Projection) -> Never: .. warning:: Do *not* call this! SpyNNaker does not work that way. - :param ~spynnaker.pyNN.models.projection.Projection projection: + :param projection: :raises SpynnakerException: Always. Method not supported; profiled out. """ raise SpynnakerException("Standard pyNN connect method not supported") @@ -706,9 +650,7 @@ def _roundsize(size: Union[int, float], label: str) -> int: rounded; other values cause exceptions. :param size: The value to be rounded - :type size: int or float - :param str label: The type-name of the connection, for messages - :rtype: int + :param label: The type-name of the connection, for messages :raises SpynnakerException: If the size is non-integer and not close """ if isinstance(size, int): @@ -734,9 +676,7 @@ def validate_connection( on multi-dimensional vertices. :param application_edge: The edge of the connection - :type application_edge: - ~pacman.model.graphs.application.ApplicationEdge - :param SynapseInformation synapse_info: The synaptic information + :param synapse_info: The synaptic information """ _ = application_edge if ((synapse_info.prepop_is_view and diff --git a/spynnaker/pyNN/models/neural_projections/connectors/abstract_generate_connector_on_host.py b/spynnaker/pyNN/models/neural_projections/connectors/abstract_generate_connector_on_host.py index 905c5c42f4f..420f8bdb599 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/abstract_generate_connector_on_host.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/abstract_generate_connector_on_host.py @@ -35,12 +35,11 @@ def create_synaptic_block( """ Create a synaptic block from the data. - :param list(~pacman.model.graphs.common.Slice) post_slices: - :param ~pacman.model.graphs.common.Slice post_vertex_slice: - :param AbstractSynapseType synapse_type: - :param SynapseInformation synapse_info: + :param post_slices: + :param post_vertex_slice: + :param synapse_type: + :param synapse_info: :returns: The synaptic matrix data to go to the machine, as a Numpy array - :rtype: ~numpy.ndarray """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neural_projections/connectors/abstract_generate_connector_on_machine.py b/spynnaker/pyNN/models/neural_projections/connectors/abstract_generate_connector_on_machine.py index 4d1520189e3..7db09b7f13c 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/abstract_generate_connector_on_machine.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/abstract_generate_connector_on_machine.py @@ -84,8 +84,7 @@ def generate_on_machine(self, synapse_info: SynapseInformation) -> bool: Default implementation returns True if the weights and delays can be generated on the machine - :param SynapseInformation synapse_info: The synapse information - :rtype: bool + :param synapse_info: The synapse information """ if (not is_param_generatable(synapse_info.weights) or not is_param_generatable(synapse_info.delays)): @@ -101,8 +100,6 @@ def gen_weights_id(self, weights: WEIGHTS) -> int: Get the id of the weight generator on the machine. :param weights: - :type weights: ~pyNN.random.RandomDistribution or int or float - :rtype: int """ return param_generator_id(weights) @@ -111,8 +108,6 @@ def gen_weights_params(self, weights: WEIGHTS) -> NDArray[uint32]: Get the parameters of the weight generator on the machine. :param weights: - :type weights: ~pyNN.random.RandomDistribution or int or float - :rtype: ~numpy.ndarray(~numpy.uint32) """ return param_generator_params(weights) @@ -121,8 +116,6 @@ def gen_weight_params_size_in_bytes(self, weights: WEIGHTS) -> int: The size of the weight parameters in bytes. :param weights: - :type weights: ~pyNN.random.RandomDistribution or int or float - :rtype: int """ return param_generator_params_size_in_bytes(weights) @@ -131,8 +124,6 @@ def gen_delays_id(self, delays: DELAYS) -> int: Get the id of the delay generator on the machine. :param delays: - :type delays: ~pyNN.random.RandomDistribution or int or float - :rtype: int """ return param_generator_id(delays) @@ -141,8 +132,6 @@ def gen_delay_params(self, delays: DELAYS) -> NDArray[uint32]: Get the parameters of the delay generator on the machine. :param delays: - :type delays: ~pyNN.random.RandomDistribution or int or float - :rtype: ~numpy.ndarray(~numpy.uint32) """ return param_generator_params(delays) @@ -151,8 +140,6 @@ def gen_delay_params_size_in_bytes(self, delays: DELAYS) -> int: The size of the delay parameters in bytes. :param delays: - :type delays: ~pyNN.random.RandomDistribution or int or float - :rtype: int """ return param_generator_params_size_in_bytes(delays) @@ -161,8 +148,6 @@ def gen_delay_params_size_in_bytes(self, delays: DELAYS) -> int: def gen_connector_id(self) -> int: """ The ID of the connection generator on the machine. - - :rtype: int """ raise NotImplementedError @@ -171,8 +156,7 @@ def gen_connector_params( """ Get the parameters of the on machine generation. - :param SynapseInformation synapse_info: The synaptic information - :rtype: ~numpy.ndarray(uint32) + :param synapse_info: The synaptic information """ _ = synapse_info return numpy.zeros(0, dtype="uint32") @@ -181,7 +165,5 @@ def gen_connector_params( def gen_connector_params_size_in_bytes(self) -> int: """ The size of the connector parameters, in bytes. - - :rtype: int """ return 0 diff --git a/spynnaker/pyNN/models/neural_projections/connectors/all_to_all_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/all_to_all_connector.py index 36b9ba27c77..a6ca81993f4 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/all_to_all_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/all_to_all_connector.py @@ -46,17 +46,17 @@ class AllToAllConnector(AbstractGenerateConnectorOnMachine, def __init__(self, allow_self_connections: bool = True, safe: bool = True, verbose: bool = False, callback: None = None): """ - :param bool allow_self_connections: + :param allow_self_connections: if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population. - :param bool safe: + :param safe: If ``True``, check that weights and delays have valid values. If ``False``, this check is skipped. - :param bool verbose: + :param verbose: Whether to output extra information about the connectivity to a CSV file - :param callable callback: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: @@ -148,7 +148,7 @@ def __repr__(self) -> str: @property def allow_self_connections(self) -> bool: """ - :rtype: bool + if the connector is used to connect a Population to itself """ return self.__allow_self_connections diff --git a/spynnaker/pyNN/models/neural_projections/connectors/array_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/array_connector.py index 2aa4b60241f..dd3f99d7547 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/array_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/array_connector.py @@ -49,16 +49,15 @@ def __init__(self, array: NDArray[uint8], safe: bool = True, An explicit Boolean matrix that specifies the connections between the pre- and post-populations (see PyNN documentation). Must be 2D in practice. - :type array: ~numpy.ndarray(2, ~numpy.uint8) - :param bool safe: + :param safe: Whether to check that weights and delays have valid values. If False, this check is skipped. - :param callable callback: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: Not supported by sPyNNaker. - :param bool verbose: + :param verbose: Whether to output extra information about the connectivity to a CSV file """ diff --git a/spynnaker/pyNN/models/neural_projections/connectors/convolution_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/convolution_connector.py index 00077ea86bc..8179a4451ca 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/convolution_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/convolution_connector.py @@ -102,21 +102,17 @@ def __init__(self, kernel_weights: _Weights, * :py:class:`~spynnaker.pyNN.RandomDistribution`: `kernel_shape` must be provided; weights will be drawn from the distribution - :type kernel_weights: - int or list or ~numpy.ndarray or ~spynnaker.pyNN.RandomDistribution :param kernel_shape: The shape of the kernel if it cannot be determined from `kernel_weights`. If a single value is provided, a square kernel will be assumed. If two values are provided, it will be assumed to be (n_rows, n_columns) - :type kernel_shape: int or tuple(int,int) :param strides: Spatial sampling frequency, jumps between the post neurons. This matches the meaning of standard ML packages. If a single value is provided, the same stride will be used for rows and columns. If two values are provided it will be assumed to be (stride_rows, stride_columns) - :type strides: int or tuple(int, int) :param padding: How many 'extra pixels' around the pre-population will be added, only zero-valued pixels are currently supported. If a single @@ -125,32 +121,29 @@ def __init__(self, kernel_weights: _Weights, `(padding_rows, padding_columns)`. If True, automatic padding will be used based on the kernel shape. If False or `None`, no padding will be used. - :type padding: bool or int or tuple(int, int) or None :param pool_shape: Area of pooling, only average pooling is supported (and seems to make sense). If a single value is provided, the pooling area will be square. If two values are provided it will be assumed to be `(pooling_rows, pooling_columns)`. - :type pool_shape: int or tuple(int, int) or None :param pool_stride: Jumps between pooling regions. If a single value is provided, the same stride will be used for rows and columns. If two values are provided it will be assumed to be `(stride_rows, stride_columns)` - :type pool_stride: int or tuple(int, int) or None - :param str positive_receptor_type: + :param positive_receptor_type: The receptor type to add the positive weights to. By default this is "``excitatory``". - :param str negative_receptor_type: + :param negative_receptor_type: The receptor type to add the negative weights to. By default this is "``inhibitory``". - :param bool safe: - :param bool verbose: - :param callable callback: + :param safe: + :param verbose: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: Not supported by sPyNNaker. - :param bool filter_edges: + :param filter_edges: Whether to filter the edges based on connectivity or not; filtered means that the receiving cores will receive fewer packets, whereas non-filtered means that receiving cores will receive all packets @@ -184,8 +177,6 @@ def __init__(self, kernel_weights: _Weights, def positive_receptor_type(self) -> str: """ The receptor type to add the positive weights to. - - :rtype: str """ return self.__positive_receptor_type @@ -193,8 +184,6 @@ def positive_receptor_type(self) -> str: def negative_receptor_type(self) -> str: """ The receptor type to add the negative weights to. - - :rtype: str """ return self.__negative_receptor_type @@ -202,8 +191,6 @@ def negative_receptor_type(self) -> str: def kernel_weights(self) -> NDArray[float64]: """ The weights for this connection. - - :rtype: ndarray """ return self.__kernel_weights @@ -426,8 +413,6 @@ def __pre_as_post_slice_ranges( def kernel_n_bytes(self) -> int: """ Size of the weights in bytes - - :rtype: int """ n_weights = self.__kernel_weights.size return n_weights * BYTES_PER_SHORT @@ -436,15 +421,13 @@ def kernel_n_bytes(self) -> int: def kernel_n_weights(self) -> int: """ Size of the weights. - - :rtype: int """ return self.__kernel_weights.size @property def parameters_n_bytes(self) -> int: """ - :rtype: int + The size of the connector struct in bytes """ return CONNECTOR_CONFIG_SIZE @@ -454,11 +437,10 @@ def get_local_only_data( """ Gets the local only data - :param ProjectionApplicationEdge app_edge: - :param int local_delay: - :param int delay_stage: - :param int weight_index: - :rtype: ndarray + :param app_edge: + :param local_delay: + :param delay_stage: + :param weight_index: """ # Get info about things kernel_shape = self.__kernel_weights.shape @@ -489,9 +471,8 @@ def get_encoded_kernel_weights( """ Encode weights with weight scaling. - :param ProjectionApplicationEdge app_edge: - :param ndarray weight_scales: - :rtype: ndarray + :param app_edge: + :param weight_scales: """ encoded_kernel_weights = self.__kernel_weights.flatten() neg_weights = encoded_kernel_weights < 0 diff --git a/spynnaker/pyNN/models/neural_projections/connectors/csa_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/csa_connector.py index 3964e80c642..79384ba4d67 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/csa_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/csa_connector.py @@ -53,18 +53,18 @@ class CSAConnector(AbstractConnector, AbstractGenerateConnectorOnHost): def __init__(self, cset: CSet, safe: bool = True, callback: None = None, verbose: bool = False): """ - :param csa.connset.CSet cset: + :param cset: A description of the connection set between populations - :param bool safe: + :param safe: If ``True``, check that weights and delays have valid values. If ``False``, this check is skipped. - :param callable callback: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: Not supported by sPyNNaker. - :param bool verbose: + :param verbose: Whether to output extra information about the connectivity to a CSV file :raises ImportError: @@ -98,11 +98,6 @@ def get_delay_minimum(self, synapse_info: SynapseInformation) -> float: def _get_n_connections( self, post_vertex_slice: Slice, synapse_info: SynapseInformation) -> Tuple[int, CSet]: - """ - :param ~pacman.model.graphs.common.Slice post_vertex_slice: - :param SynapseInformation synapse_info: - :rtype: tuple(int, cset.connset.CSet) - """ # do the work from self._cset in here # this is where the magic needs to happen somehow @@ -187,8 +182,8 @@ def create_synaptic_block( def show_connection_set( self, n_pre_neurons: int, n_post_neurons: int) -> None: """ - :param int n_pre_neurons: - :param int n_post_neurons: + :param n_pre_neurons: + :param n_post_neurons: """ # Yuck; this was supposed to be available to the user from scripts... csa.show(self.__full_connection_set, n_pre_neurons, n_post_neurons) diff --git a/spynnaker/pyNN/models/neural_projections/connectors/distance_dependent_probability_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/distance_dependent_probability_connector.py index 58920328c26..689a875058d 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/distance_dependent_probability_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/distance_dependent_probability_connector.py @@ -65,30 +65,28 @@ def __init__( rng: Optional[NumpyRNG] = None, safe: bool = True, verbose: bool = False, callback: None = None): """ - :param str d_expression: + :param d_expression: the right-hand side of a valid python expression for probability, involving ``d``, (e.g. ``"exp(-abs(d))"``, or ``"d < 3"``), that can be parsed by ``eval()``, that computes the distance dependent distribution. - :param bool allow_self_connections: + :param allow_self_connections: if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population. - :param bool safe: + :param safe: if ``True``, check that weights and delays have valid values. If ``False``, this check is skipped. - :param bool verbose: + :param verbose: Whether to output extra information about the connectivity to a CSV file :param n_connections: The number of efferent synaptic connections per neuron. - :type n_connections: int or None :param rng: Seeded random number generator, or ``None`` to make one when needed. - :type rng: ~pyNN.random.NumpyRNG or None - :param callable callback: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: @@ -115,9 +113,6 @@ def set_projection_information( self._set_probabilities(synapse_info) def _set_probabilities(self, synapse_info: SynapseInformation) -> None: - """ - :param SynapseInformation synapse_info: - """ # Set the probabilities up-front for now # TODO: Work out how this can be done statistically expand_distances = self._expand_distances(self.__d_expression) @@ -242,7 +237,7 @@ def __repr__(self) -> str: @property def allow_self_connections(self) -> bool: """ - :rtype: bool + if the connector is used to connect a Population to itself """ return self.__allow_self_connections @@ -254,8 +249,6 @@ def allow_self_connections(self, new_value: bool) -> None: def d_expression(self) -> str: """ The distance expression. - - :rtype: str """ return self.__d_expression diff --git a/spynnaker/pyNN/models/neural_projections/connectors/fixed_number_post_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/fixed_number_post_connector.py index 1fed9d27529..bae1dc0bca7 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/fixed_number_post_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/fixed_number_post_connector.py @@ -63,19 +63,19 @@ def __init__( with_replacement: bool = False, rng: Optional[NumpyRNG] = None, safe: bool = True, verbose: bool = False, callback: None = None): """ - :param int n: + :param n: number of random post-synaptic neurons connected to pre-neurons. - :param bool allow_self_connections: + :param allow_self_connections: if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population. - :param bool safe: + :param safe: Whether to check that weights and delays have valid values; if ``False``, this check is skipped. - :param bool verbose: + :param verbose: Whether to output extra information about the connectivity to a CSV file - :param bool with_replacement: + :param with_replacement: this flag determines how the random selection of post-synaptic neurons is performed; if ``True``, then every post-synaptic neuron can be chosen on each occasion, and so multiple connections @@ -85,8 +85,7 @@ def __init__( :param rng: Seeded random number generator, or ``None`` to make one when needed. - :type rng: ~pyNN.random.NumpyRNG or None - :param callable callback: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: @@ -160,10 +159,6 @@ def __build_post_neurons( def _get_post_neurons( self, synapse_info: SynapseInformation) -> List[NDArray[integer]]: - """ - :param SynapseInformation synapse_info: - :rtype: list(~numpy.ndarray) - """ # If we haven't set the array up yet, do it now if not self.__post_neurons_set: self.__post_neurons = self.__build_post_neurons(synapse_info) @@ -192,12 +187,6 @@ def _get_post_neurons( def _post_neurons_in_slice( self, post_vertex_slice: Slice, n: int, synapse_info: SynapseInformation) -> NDArray[integer]: - """ - :param ~pacman.model.graphs.common.Slice post_vertex_slice: - :param int n: - :param SynapseInformation synapse_info: - :rtype: ~numpy.ndarray - """ post_neurons = self._get_post_neurons(synapse_info) # Get the nth array and get the bits we need for @@ -214,11 +203,6 @@ def _n_post_neurons_in_slice( """ Count the number of post neurons in the slice. Faster than ``len(_post_neurons_in_slice(...))``. - - :param ~pacman.model.graphs.common.Slice post_vertex_slice: - :param int n: - :param SynapseInformation synapse_info: - :rtype: int """ post_neurons = self._get_post_neurons(synapse_info) @@ -311,8 +295,6 @@ def __repr__(self) -> str: def allow_self_connections(self) -> bool: """ Do we include connections from a neuron/id to itself? - - :rtype: bool """ return self.__allow_self_connections diff --git a/spynnaker/pyNN/models/neural_projections/connectors/fixed_number_pre_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/fixed_number_pre_connector.py index d1ada240106..879d352fe9b 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/fixed_number_pre_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/fixed_number_pre_connector.py @@ -60,19 +60,19 @@ def __init__( with_replacement: bool = False, rng: Optional[NumpyRNG] = None, safe: bool = True, verbose: bool = False, callback: None = None): """ - :param int n: + :param n: number of random pre-synaptic neurons connected to output - :param bool allow_self_connections: + :param allow_self_connections: if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population. - :param bool safe: + :param safe: Whether to check that weights and delays have valid values. If ``False``, this check is skipped. - :param bool verbose: + :param verbose: Whether to output extra information about the connectivity to a CSV file - :param bool with_replacement: + :param with_replacement: this flag determines how the random selection of pre-synaptic neurons is performed; if true, then every pre-synaptic neuron can be chosen on each occasion, and so multiple connections @@ -81,8 +81,7 @@ def __init__( can't be connected again. :param rng: Seeded random number generator, or `None` to make one when needed - :type rng: ~pyNN.random.NumpyRNG or None - :param callable callback: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: @@ -161,10 +160,6 @@ def __build_pre_neurons(self, synapse_info: SynapseInformation) -> List[ def _get_pre_neurons(self, synapse_info: SynapseInformation) -> List[ NDArray[integer]]: - """ - :param SynapseInformation synapse_info: - :rtype: list(~numpy.ndarray) - """ # If we haven't set the array up yet, do it now if not self.__pre_neurons_set: self.__pre_neurons = self.__build_pre_neurons(synapse_info) @@ -268,8 +263,6 @@ def __repr__(self) -> str: def allow_self_connections(self) -> bool: """ Do we include connections from a neuron/id to itself? - - :rtype: bool """ return self.__allow_self_connections diff --git a/spynnaker/pyNN/models/neural_projections/connectors/fixed_probability_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/fixed_probability_connector.py index 03ee83e9adc..7f83238232d 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/fixed_probability_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/fixed_probability_connector.py @@ -63,10 +63,10 @@ def __init__( safe: bool = True, verbose: bool = False, rng: Optional[NumpyRNG] = None, callback: None = None): """ - :param float p_connect: + :param p_connect: a value between zero and one. Each potential connection is created with this probability. - :param bool allow_self_connections: + :param allow_self_connections: if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population. @@ -78,7 +78,6 @@ def __init__( CSV file :param rng: Seeded random number generator, or `None` to make one when needed - :type rng: ~pyNN.random.NumpyRNG or None :param callable callback: if given, a callable that display a progress bar on the terminal. @@ -217,8 +216,6 @@ def p_connect(self) -> float: Probability for each potential connection. A value between zero and one. (inclusive) - - :rtype: float """ return self._p_connect diff --git a/spynnaker/pyNN/models/neural_projections/connectors/from_file_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/from_file_connector.py index b71f2eebdc4..bd16190486e 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/from_file_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/from_file_connector.py @@ -34,7 +34,7 @@ def __init__( distributed: bool = False, safe: bool = True, callback: None = None, verbose: bool = False): """ - :param str file: + :param file: Either an open file object or the filename of a file containing a list of connections, in the format required by :py:class:`FromListConnector`. @@ -45,8 +45,7 @@ def __init__( .. note:: The header requires `#` at the beginning of the line. - :type file: str or ~io.FileIO - :param bool distributed: + :param distributed: Basic pyNN says: if this is ``True``, then each node will read connections from @@ -56,15 +55,15 @@ def __init__( .. note:: Always leave this as ``False`` with sPyNNaker, which is not MPI-based. - :param bool safe: + :param safe: Whether to check that weights and delays have valid values. If ``False``, this check is skipped. - :param callable callback: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: Not supported by sPyNNaker. - :param bool verbose: + :param verbose: Whether to output extra information about the connectivity to a CSV file """ diff --git a/spynnaker/pyNN/models/neural_projections/connectors/from_list_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/from_list_connector.py index bfdb54143d9..beca506a3a3 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/from_list_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/from_list_connector.py @@ -98,18 +98,16 @@ def __init__(self, conn_list: Union[None, NDArray, List[Tuple[int, ...]]], ``p1``, ``p2``, etc. are the synaptic parameters (e.g., weight, delay, plasticity parameters). All tuples/rows must have the same number of items. - :type conn_list: ~numpy.ndarray or list(tuple(int,int,...)) - :param bool safe: + :param safe: if ``True``, check that weights and delays have valid values. If ``False``, this check is skipped. - :param bool verbose: + :param verbose: Whether to output extra information about the connectivity to a CSV file :param column_names: the names of the parameters ``p1``, ``p2``, etc. If not provided, it is assumed the parameters are ``weight, delay`` (for backwards compatibility). - :type column_names: None or tuple(str) or list(str) - :param callable callback: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: @@ -179,9 +177,6 @@ def _split_connections( Tuple[NDArray[integer], NDArray[integer], Optional[NDArray[floating]], Optional[NDArray[floating]]]: - """ - :param list(~pacman.model.graphs.common.Slice) post_slices: - """ input_filter = numpy.logical_and( self.__targets < n_post_atoms, self.__sources < n_pre_atoms) targets = self.__targets[input_filter] @@ -375,8 +370,6 @@ def __repr__(self) -> str: def conn_list(self) -> NDArray: """ The connection list. - - :rtype: ~numpy.ndarray """ return self.__conn_list @@ -475,8 +468,6 @@ def column_names(self) -> Optional[Sequence[str]]: The names of the columns in the array after the first two. Of particular interest is whether ``weight`` and ``delay`` columns are present. - - :rtype: list(str) """ return self.__column_names @@ -490,15 +481,12 @@ def get_extra_parameters(self) -> Optional[NDArray]: ``delay`` columns. :return: The extra parameters - :rtype: ~numpy.ndarray """ return self.__extra_params.data if self.__extra_params else None def get_extra_parameter_names(self) -> Optional[Sequence[str]]: """ Get the names of the extra parameters. - - :rtype: list(str) """ return self.__extra_params.names if self.__extra_params else None @@ -557,9 +545,6 @@ def get_connected_vertices( def _apply_parameters_to_synapse_type( self, synapse_type: AbstractSynapseDynamics) -> None: - """ - :param AbstractStaticSynapseDynamics synapse_type: - """ if self.__extra_params: for i, name in enumerate(self.__extra_params.names): synapse_type.set_value(name, self.__extra_params.data[:, i]) diff --git a/spynnaker/pyNN/models/neural_projections/connectors/index_based_probability_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/index_based_probability_connector.py index 60eea046bf2..091b027b0e5 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/index_based_probability_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/index_based_probability_connector.py @@ -64,7 +64,7 @@ def __init__( rng: Optional[NumpyRNG] = None, safe: bool = True, callback: None = None, verbose: bool = False): """ - :param str index_expression: + :param index_expression: the right-hand side of a valid python expression for probability, involving the indices of the pre- and post-populations, @@ -72,23 +72,22 @@ def __init__( distribution; the indices will be given as variables ``i`` and ``j`` when the expression is evaluated. - :param bool allow_self_connections: + :param allow_self_connections: if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population. :param rng: Seeded random number generator, or ``None`` to make one when needed. - :type rng: ~pyNN.random.NumpyRNG or None - :param bool safe: + :param safe: Whether to check that weights and delays have valid values. If ``False``, this check is skipped. - :param callable callback: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: Not supported by sPyNNaker. - :param bool verbose: + :param verbose: Whether to output extra information about the connectivity to a CSV file """ @@ -100,9 +99,6 @@ def __init__( def _update_probs_from_index_expression( self, synapse_info: SynapseInformation) -> NDArray: - """ - :param SynapseInformation synapse_info: - """ # note: this only needs to be done once if self.__probs is None: # numpy array of probabilities using the index_expression @@ -216,8 +212,6 @@ def allow_self_connections(self) -> bool: When the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population. - - :rtype: bool """ return self.__allow_self_connections @@ -231,8 +225,6 @@ def index_expression(self) -> str: The right-hand side of a valid python expression for probability, involving the indices of the pre- and post-populations, that can be parsed by `eval()`, that computes a probability distribution. - - :rtype: str """ return self.__index_expression diff --git a/spynnaker/pyNN/models/neural_projections/connectors/kernel_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/kernel_connector.py index aabc8d0e748..04438e3190e 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/kernel_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/kernel_connector.py @@ -68,9 +68,8 @@ def shape2word( """ Combines two short values into 1 int by shifting the first 16 places - :param int short1: first 2 byte value - :param int short2: second 2 bytes value - :rtype: int + :param short1: first 2 byte value + :param short2: second 2 bytes value """ return uint32(((uint32(short2) & 0xFFFF) << 16) | (uint32(short1) & 0xFFFF)) @@ -113,46 +112,34 @@ def __init__( :param shape_pre: 2D shape of the pre-population (rows/height, columns/width, usually the input image shape) - :type shape_pre: list(int) or tuple(int,int) :param shape_post: 2D shape of the post-population (rows/height, columns/width) - :type shape_post: list(int) or tuple(int,int) :param shape_kernel: 2D shape of the kernel (rows/height, columns/width) - :type shape_kernel: list(int) or tuple(int,int) :param weight_kernel: (optional) 2D matrix of size shape_kernel describing the weights - :type weight_kernel: ~numpy.ndarray or ~pyNN.random.RandomDistribution - or int or float or list(int) or list(float) or None :param delay_kernel: (optional) 2D matrix of size shape_kernel describing the delays - :type delay_kernel: ~numpy.ndarray or ~pyNN.random.RandomDistribution - or int or float or list(int) or list(float) or None :param shape_common: (optional) 2D shape of common coordinate system (for both pre- and post-, usually the input image sizes) - :type shape_common: list(int) or tuple(int,int) or None :param pre_sample_steps_in_post: (optional) Sampling steps/jumps for pre-population <=> (stepX, stepY) - :type pre_sample_steps_in_post: None or list(int) or tuple(int,int) :param pre_start_coords_in_post: (optional) Starting row/column for pre-population sampling <=> (offX, offY) - :type pre_start_coords_in_post: None or list(int) or tuple(int,int) :param post_sample_steps_in_pre: (optional) Sampling steps/jumps for post-population <=> (stepX, stepY) - :type post_sample_steps_in_pre: None or list(int) or tuple(int,int) :param post_start_coords_in_pre: (optional) Starting row/column for post-population sampling <=> (offX, offY) - :type post_start_coords_in_pre: None or list(int) or tuple(int,int) - :param bool safe: + :param safe: Whether to check that weights and delays have valid values. If ``False``, this check is skipped. - :param ~pyNN.space.Space space: + :param space: Currently ignored; for future compatibility. - :param bool verbose: + :param verbose: Whether to output extra information about the connectivity to a CSV file - :param callable callback: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: @@ -226,8 +213,7 @@ def __to_post_coords( """ Get a list of possible post-slice coordinates. - :param ~pacman.model.graphs.common.Slice post_vertex_slice: - :rtype: tuple(~numpy.ndarray, ~numpy.ndarray) + :param post_vertex_slice: """ post = numpy.arange( post_vertex_slice.lo_atom, post_vertex_slice.hi_atom + 1, @@ -239,10 +225,6 @@ def __map_to_pre_coords( NDArray[integer], NDArray[integer]]: """ Get a map from post to pre-population coordinates. - - :param ~numpy.ndarray post_r: rows - :param ~numpy.ndarray post_c: columns - :rtype: tuple(~numpy.ndarray, ~numpy.ndarray) """ return (self._post_start_h + post_r * self._post_step_h, self._post_start_w + post_c * self._post_step_w) @@ -251,9 +233,6 @@ def __post_as_pre(self, post_vertex_slice: Slice) -> Tuple[ NDArray[integer], NDArray[integer]]: """ Write post-population coordinates as pre-population coordinates. - - :param ~pacman.model.graphs.common.Slice post_vertex_slice: - :rtype: tuple(~numpy.ndarray, ~numpy.ndarray) """ # directly as the cache index if post_vertex_slice not in self._post_as_pre: @@ -265,10 +244,6 @@ def __post_as_pre(self, post_vertex_slice: Slice) -> Tuple[ def __pre_as_post(self, pre_r: int, pre_c: int) -> Tuple[int, int]: """ Write pre-population coordinates as post-population coordinates. - - :param int pre_r: row - :param int pre_c: column - :rtype: tuple(int,int) """ r = ((pre_r - self._pre_start_h - 1) // self._pre_step_h) + 1 c = ((pre_c - self._pre_start_w - 1) // self._pre_step_w) + 1 @@ -278,11 +253,6 @@ def __get_kernel_vals(self, values: Optional[Union[ _KERNAL, WEIGHTS_DELAYS]]) -> Optional[ConvolutionKernel]: """ Convert kernel values given into the correct format. - - :param values: - :type values: int or float or ~pyNN.random.RandomDistribution - or ~numpy.ndarray or ConvolutionKernel - :rtype: ~numpy.ndarray """ if values is None: return None @@ -314,14 +284,6 @@ def __compute_statistics( NDArray[floating]]: """ Compute the relevant information required for the connections. - - :param weights: - :type weights: int or float or ~pyNN.random.RandomDistribution or - ~numpy.ndarray or ConvolutionKernel - :param delays: - :type delays: int or float or ~pyNN.random.RandomDistribution or - ~numpy.ndarray or ConvolutionKernel - :param ~pacman.model.graphs.common.Slice post_vertex_slice: """ # If __compute_statistics is called more than once, there's # no need to get the user-supplied weights and delays again diff --git a/spynnaker/pyNN/models/neural_projections/connectors/multapse_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/multapse_connector.py index d7054cf6a72..e370cde2b72 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/multapse_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/multapse_connector.py @@ -64,23 +64,22 @@ def __init__(self, n: int, allow_self_connections: bool = True, safe: bool = True, verbose: bool = False, callback: None = None): """ - :param int n: + :param n: This is the total number of synapses in the connection. - :param bool allow_self_connections: + :param allow_self_connections: Allow a neuron to connect to itself or not. - :param bool with_replacement: + :param with_replacement: When selecting, allow a neuron to be re-selected or not. - :param bool safe: + :param safe: Whether to check that weights and delays have valid values. If ``False``, this check is skipped. - :param bool verbose: + :param verbose: Whether to output extra information about the connectivity to a CSV file :param rng: Seeded random number generator, or ``None`` to make one when needed. - :type rng: ~pyNN.random.NumpyRNG or None - :param callable callback: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: @@ -117,10 +116,9 @@ def get_rng_next(self, num_synapses: int, prob_connect: Sequence[float], """ Get the required RNGs. - :param int num_synapses: + :param num_synapses: The number of synapses to make random numbers for in this call - :param list(float) prob_connect: The probability of connection - :rtype: ~numpy.ndarray + :param prob_connect: The probability of connection """ # Below is how numpy does multinomial internally... size = len(prob_connect) @@ -153,9 +151,6 @@ def get_delay_minimum(self, synapse_info: SynapseInformation) -> float: def _update_synapses_per_post_vertex( self, post_slices: Sequence[Slice], n_pre_atoms: int, rng: NumpyRNG) -> None: - """ - :param list(~pacman.model.graphs.common.Slice) post_slices: - """ if (self.__synapses_per_edge is None or len(self.__post_slices) != len(post_slices)): n_post_atoms = sum( @@ -184,10 +179,6 @@ def _update_synapses_per_post_vertex( self.__post_slices = post_slices def _get_n_connections(self, post_slice_index: int) -> int: - """ - :param int post_slice_index: - :rtype: int - """ if not self.__synapses_per_edge: return 0 return self.__synapses_per_edge[post_slice_index] diff --git a/spynnaker/pyNN/models/neural_projections/connectors/pool_dense_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/pool_dense_connector.py index 3720ac0ff70..d6745b8d7c0 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/pool_dense_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/pool_dense_connector.py @@ -83,29 +83,24 @@ def __init__(self, weights: ArrayLike, * :py:class:`~numpy.ndarray`: As above for list * :py:class:`~spynnaker.pyNN.RandomDistribution`: weights will be drawn at random - :type weights: - int or float or list(int or float) or ~numpy.ndarray or - ~spynnaker.pyNN.RandomDistribution :param pool_shape: Shape of average pooling. If a single value is provided, it will be used for every dimension, otherwise must be the same number of values as there are dimensions in the source. - :type pool_shape: int or tuple(int) or None :param pool_stride: Jumps between pooling regions. If a single value is provided, the same stride will be used for all dimensions, otherwise must be the same number of values as there are dimensions in the source. If `None`, and pool_shape is provided, pool_stride will be set to pool_shape. - :type pool_stride: int or tuple(int) or None - :param str positive_receptor_type: + :param positive_receptor_type: The receptor type to add the positive weights to. By default this is "excitatory". - :param str negative_receptor_type: + :param negative_receptor_type: The receptor type to add the negative weights to. By default this is "inhibitory". - :param bool safe: (ignored) - :param bool verbose: (ignored) + :param safe: (ignored) + :param verbose: (ignored) :param callable callback: if given, a callable that display a progress bar on the terminal. @@ -122,21 +117,21 @@ def __init__(self, weights: ArrayLike, @property def positive_receptor_type(self) -> str: """ - :rtype: str + The receptor type to add the positive weights to """ return self.__positive_receptor_type @property def negative_receptor_type(self) -> str: """ - :rtype: str + The receptor type to add the negative weights to """ return self.__negative_receptor_type @property def weights(self) -> NDArray: """ - :rtype: ~numpy.ndarray + The synaptic strengths """ return self.__weights @@ -195,9 +190,6 @@ def get_post_pool_shape( The shape considering the stride :param pre_shape: tuple(int) - :type pool_shape: int, tuple(int) or None - :type pool_stride: int, tuple(int) or None - :rtype: ndarray """ real_pool_shape = cls.__to_nd_shape_or_none( pool_shape, len(pre_shape), "pool_shape") @@ -298,9 +290,8 @@ def get_weight_maximum(self, synapse_info: SynapseInformation) -> float: def local_only_n_bytes(self, pre_shape: Tuple[int, ...], n_post_atoms: int) -> int: """ - :param tuple(int) pre_shape: - :param int n_post_atoms: - :rtype: int + :param pre_shape: + :param n_post_atoms: """ n_weights = self.__get_n_weights(pre_shape, n_post_atoms) n_weights = n_weights + 1 if n_weights % 2 != 0 else n_weights @@ -314,13 +305,13 @@ def get_local_only_data( delay_stage: int, post_vertex_slice: Slice, weight_scales: NDArray[floating]) -> NDArray[uint32]: """ - :param ~data_specification.DataSpecificationGenerator spec: - :param ~pacman.model.graphs.application.ApplicationEdge app_edge: - :param ~pacman.model.graphs.common.Slice pre_vertex_slice: - :param ~pacman.model.graphs.common.Slice post_vertex_slice: - :param int key: - :param int mask: - :param int n_colour_bits: + :param spec: + :param app_edge: + :param pre_vertex_slice: + :param post_vertex_slice: + :param key: + :param mask: + :param n_colour_bits: :param weight_scales: """ diff --git a/spynnaker/pyNN/models/neural_projections/connectors/small_world_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/small_world_connector.py index 1ed650da681..6064871bd60 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/small_world_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/small_world_connector.py @@ -56,10 +56,10 @@ def __init__( rng: Optional[NumpyRNG] = None, safe: bool = True, callback: None = None, verbose: bool = False): """ - :param float degree: + :param degree: the region length where nodes will be connected locally - :param float rewiring: the probability of rewiring each edge - :param bool allow_self_connections: + :param rewiring: the probability of rewiring each edge + :param allow_self_connections: if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population. @@ -67,20 +67,18 @@ def __init__( :param n_connections: if specified, the number of efferent synaptic connections per neuron - :type n_connections: int or None :param rng: Seeded random number generator, or ``None`` to make one when needed. - :type rng: ~pyNN.random.NumpyRNG or None - :param bool safe: + :param safe: If ``True``, check that weights and delays have valid values. If ``False``, this check is skipped. - :param callable callback: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: Not supported by sPyNNaker. - :param bool verbose: + :param verbose: Whether to output extra information about the connectivity to a CSV file """ @@ -106,9 +104,6 @@ def set_projection_information( self._set_n_connections(synapse_info) def _set_n_connections(self, synapse_info: SynapseInformation) -> None: - """ - :param SynapseInformation synapse_info: - """ if self.space is None: raise ConfigurationException("a metric space is required") # Get the probabilities up-front for now diff --git a/spynnaker/pyNN/models/neural_projections/delayed_application_edge.py b/spynnaker/pyNN/models/neural_projections/delayed_application_edge.py index 011cfe184ed..b7e1939ae7f 100644 --- a/spynnaker/pyNN/models/neural_projections/delayed_application_edge.py +++ b/spynnaker/pyNN/models/neural_projections/delayed_application_edge.py @@ -42,18 +42,13 @@ def __init__( undelayed_edge: ProjectionApplicationEdge, label: Optional[str] = None): """ - :param DelayExtensionVertex pre_vertex: - The delay extension at the start of the edge - :param PopulationVertex post_vertex: - The target of the synapses + :param pre_vertex: The delay extension at the start of the edge + :param post_vertex: The target of the synapses :param synapse_information: The synapse information on this edge - :type synapse_information: - SynapseInformation or iterable(SynapseInformation) - :param ProjectionApplicationEdge undelayed_edge: + :param undelayed_edge: The edge that is used for projections without extended delays - :param str label: - The edge label + :param label: The edge label """ super().__init__(pre_vertex, post_vertex, label=label) if isinstance(synapse_information, Iterable): @@ -75,14 +70,14 @@ def post_vertex(self) -> PopulationVertex: @property def synapse_information(self) -> List[SynapseInformation]: """ - :rtype: list(SynapseInformation) + The synapse information on this edge """ return self.__synapse_information def add_synapse_information( self, synapse_information: SynapseInformation) -> None: """ - :param SynapseInformation synapse_information: + Add more synapse information on this edge """ self.__synapse_information.append(synapse_information) @@ -90,7 +85,5 @@ def add_synapse_information( def undelayed_edge(self) -> ProjectionApplicationEdge: """ The edge for projections without extended delays. - - :rtype: ProjectionApplicationEdge """ return self.__undelayed_edge diff --git a/spynnaker/pyNN/models/neural_projections/projection_application_edge.py b/spynnaker/pyNN/models/neural_projections/projection_application_edge.py index e562f255a24..33daee08790 100644 --- a/spynnaker/pyNN/models/neural_projections/projection_application_edge.py +++ b/spynnaker/pyNN/models/neural_projections/projection_application_edge.py @@ -44,8 +44,6 @@ class _Dynamics: def structural(cls) -> Type[AbstractSynapseDynamicsStructural]: """ Delayed import of AbstractSynapseDynamicsStructural - - :rtype: type """ if cls._Structural is None: # Avoid import loop by postponing this import @@ -59,8 +57,6 @@ def structural(cls) -> Type[AbstractSynapseDynamicsStructural]: def stdp(cls) -> Type[SynapseDynamicsSTDP]: """ Delayed import of SynapseDynamicsSTDP - - :rtype: type """ if cls._STDP is None: # Avoid import loop by postponing this import @@ -74,8 +70,6 @@ def stdp(cls) -> Type[SynapseDynamicsSTDP]: def neuromodulation(cls) -> Type[SynapseDynamicsNeuromodulation]: """ Delayed import of SynapseDynamicsNeuromodulation - - :rtype: type """ if cls._Neuromodulation is None: # Avoid import loop by postponing this import @@ -93,8 +87,7 @@ def are_dynamics_structural( """ Checks if synapse_dynamics is a AbstractSynapseDynamicsStructural - :param AbstractSynapseDynamics synapse_dynamics: - :rtype: bool + :param synapse_dynamics: """ return isinstance(synapse_dynamics, _Dynamics.structural()) @@ -105,8 +98,7 @@ def are_dynamics_stdp(synapse_dynamics: AbstractSynapseDynamics) -> TypeGuard[ """ Checks if synapse_dynamics is a SynapseDynamicsSTD - :param AbstractSynapseDynamics synapse_dynamics: - :rtype: bool + :param synapse_dynamics: """ return isinstance(synapse_dynamics, _Dynamics.stdp()) @@ -117,8 +109,7 @@ def are_dynamics_neuromodulation( """ Checks if synapse_dynamics is a SynapseDynamicsNeuromodulation - :param AbstractSynapseDynamics synapse_dynamics: - :rtype: bool + :param synapse_dynamics: """ # pylint: disable=isinstance-second-argument-not-valid-type return isinstance(synapse_dynamics, _Dynamics.neuromodulation()) @@ -140,11 +131,11 @@ def __init__( synapse_information: SynapseInformation, label: Optional[str] = None): """ - :param PopulationApplicationVertex pre_vertex: - :param PopulationVertex post_vertex: - :param SynapseInformation synapse_information: + :param pre_vertex: + :param post_vertex: + :param synapse_information: The synapse information on this edge - :param str label: + :param label: """ super().__init__(pre_vertex, post_vertex, label=label) @@ -161,7 +152,7 @@ def __init__( def add_synapse_information( self, synapse_information: SynapseInformation) -> None: """ - :param SynapseInformation synapse_information: + :param synapse_information: """ dynamics = synapse_information.synapse_dynamics is_neuromodulation = are_dynamics_neuromodulation(dynamics) @@ -175,7 +166,7 @@ def add_synapse_information( @property def synapse_information(self) -> List[SynapseInformation]: """ - :rtype: list(SynapseInformation) + The synapse information on this edge """ return self.__synapse_information @@ -183,8 +174,6 @@ def synapse_information(self) -> List[SynapseInformation]: def delay_edge(self) -> Optional[DelayedApplicationEdge]: """ Settable. - - :rtype: DelayedApplicationEdge or None """ return self.__delay_edge @@ -196,15 +185,13 @@ def delay_edge(self, delay_edge: DelayedApplicationEdge) -> None: def is_neuromodulation(self) -> bool: """ Whether this edge is providing neuromodulation. - - :rtype: bool """ return self.__is_neuromodulation @property def n_delay_stages(self) -> int: """ - :rtype: int + The maximum number of delay stages required """ if self.__delay_edge is None: return 0 diff --git a/spynnaker/pyNN/models/neural_projections/synapse_information.py b/spynnaker/pyNN/models/neural_projections/synapse_information.py index 6de73b4bf9b..6d07bb4fd97 100644 --- a/spynnaker/pyNN/models/neural_projections/synapse_information.py +++ b/spynnaker/pyNN/models/neural_projections/synapse_information.py @@ -63,32 +63,23 @@ def __init__(self, connector: AbstractConnector, download_on_pause: bool = False, partition_id: Optional[str] = None): """ - :param AbstractConnector connector: - The connector connected to the synapse + :param connector: The connector connected to the synapse :param pre_population: The population sending spikes to the synapse - :type pre_population: ~spynnaker.pyNN.models.populations.Population or - ~spynnaker.pyNN.models.populations.PopulationView :param post_population: The population hosting the synapse - :type post_population: ~spynnaker.pyNN.models.populations.Population - or ~spynnaker.pyNN.models.populations.PopulationView - :param bool prepop_is_view: Whether the ``pre_population`` is a view - :param bool postpop_is_view: Whether the ``post_population`` is a view - :param AbstractSynapseDynamics synapse_dynamics: - The dynamic behaviour of the synapse - :param int synapse_type: The type of the synapse - :param str receptor_type: Description of the receptor (e.g. excitatory) - :param bool synapse_type_from_dynamics: + :param prepop_is_view: Whether the ``pre_population`` is a view + :param postpop_is_view: Whether the ``post_population`` is a view + :param synapse_dynamics: The dynamic behaviour of the synapse + :param synapse_type: The type of the synapse + :param receptor_type: Description of the receptor (e.g. excitatory) + :param synapse_type_from_dynamics: Whether the synapse type came from synapse dynamics :param weights: The synaptic weights - :type weights: float or list(float) or ~numpy.ndarray(float) or None :param delays: The total synaptic delays - :type delays: float or list(float) or ~numpy.ndarray(float) or None :param bool download_on_pause: Whether to download the synapse matrix when the simulation pauses :param partition_id: The partition id for the application edge when not standard; if None, the standard SPIKE_PARTITION_ID is used - :type partition_id: str or None """ self.__connector = connector self.__pre_population = pre_population @@ -112,8 +103,6 @@ def __init__(self, connector: AbstractConnector, def connector(self) -> AbstractConnector: """ The connector connected to the synapse. - - :rtype: AbstractConnector """ return self.__connector @@ -121,9 +110,6 @@ def connector(self) -> AbstractConnector: def pre_population(self) -> Union[Population, PopulationView]: """ The population sending spikes to the synapse. - - :rtype: ~spynnaker.pyNN.models.populations.Population or - ~spynnaker.pyNN.models.populations.PopulationView """ return self.__pre_population @@ -131,9 +117,6 @@ def pre_population(self) -> Union[Population, PopulationView]: def post_population(self) -> Union[Population, PopulationView]: """ The population hosting the synapse. - - :rtype: ~spynnaker.pyNN.models.populations.Population or - ~spynnaker.pyNN.models.populations.PopulationView """ return self.__post_population @@ -141,8 +124,6 @@ def post_population(self) -> Union[Population, PopulationView]: def pre_vertex(self) -> ApplicationVertex: """ The vertex sending spikes to the synapse. - - :rtype: ApplicationVertex """ # pylint: disable=protected-access return self.__pre_population._vertex @@ -151,8 +132,6 @@ def pre_vertex(self) -> ApplicationVertex: def post_vertex(self) -> ApplicationVertex: """ The vertex hosting the synapse. - - :rtype: ApplicationVertex """ # pylint: disable=protected-access return self.__post_population._vertex @@ -161,8 +140,6 @@ def post_vertex(self) -> ApplicationVertex: def n_pre_neurons(self) -> int: """ The number of neurons in the pre-population. - - :rtype: int """ return self.__pre_population.size @@ -170,8 +147,6 @@ def n_pre_neurons(self) -> int: def n_post_neurons(self) -> int: """ The number of neurons in the post-population. - - :rtype: int """ return self.__post_population.size @@ -179,8 +154,6 @@ def n_post_neurons(self) -> int: def prepop_is_view(self) -> bool: """ Whether the :py:meth:`pre_population` is a view. - - :rtype: bool """ return self.__prepop_is_view @@ -188,8 +161,6 @@ def prepop_is_view(self) -> bool: def postpop_is_view(self) -> bool: """ Whether the :py:meth:`post_population` is a view. - - :rtype: bool """ return self.__postpop_is_view @@ -197,8 +168,6 @@ def postpop_is_view(self) -> bool: def synapse_dynamics(self) -> AbstractSynapseDynamics: """ The dynamic behaviour of the synapse. - - :rtype: AbstractSynapseDynamics """ return self.__synapse_dynamics @@ -207,8 +176,6 @@ def synapse_type(self) -> int: """ The type of the synapse. An index into the set of synapse types supported by a neuron. - - :rtype: int """ return self.__synapse_type @@ -216,8 +183,6 @@ def synapse_type(self) -> int: def receptor_type(self) -> str: """ A string representing the receptor type. - - :rtype: str """ return self.__receptor_type @@ -225,8 +190,6 @@ def receptor_type(self) -> str: def weights(self) -> WEIGHTS: """ The synaptic weights (if any). - - :rtype: float or ~numpy.ndarray(float64) or str or RandomDistribution """ return self.__weights @@ -234,8 +197,6 @@ def weights(self) -> WEIGHTS: def delays(self) -> DELAYS: """ The total synaptic delays (if any). - - :rtype: float or ~numpy.ndarray(float64) or str or RandomDistribution """ return self.__delays @@ -249,7 +210,6 @@ def may_generate_on_machine(self) -> bool: :return: True if the synaptic matrix may be generated on machine (or may have already been so done) - :rtype: bool """ # If we are using a virtual machine, we can't generate on the machine if get_config_bool("Machine", "virtual_board"): @@ -266,8 +226,6 @@ def may_generate_on_machine(self) -> bool: def pre_run_connection_holders(self) -> Sequence[ConnectionHolder]: """ The list of connection holders to be filled in before run. - - :rtype: list(ConnectionHolder) """ return self.__pre_run_connection_holders @@ -276,7 +234,7 @@ def add_pre_run_connection_holder( """ Add a connection holder that will be filled in before run. - :param ConnectionHolder pre_run_connection_holder: + :param pre_run_connection_holder: The connection holder to be added """ self.__pre_run_connection_holders.append(pre_run_connection_holder) @@ -294,8 +252,6 @@ def finish_connection_holders(self) -> None: def synapse_type_from_dynamics(self) -> bool: """ Whether the synapse type comes from the synapse dynamics. - - :rtype: bool """ return self.__synapse_type_from_dynamics @@ -303,8 +259,6 @@ def synapse_type_from_dynamics(self) -> bool: def download_on_pause(self) -> bool: """ Whether to download the synapse matrix when the simulation pauses. - - :rtype: bool """ return self.__download_on_pause @@ -313,7 +267,7 @@ def download_on_pause(self, download_on_pause: bool) -> None: """ Set whether to download the synapse matrix when the simulation pauses. - :param bool download_on_pause: + :param download_on_pause: Whether to download the synapse matrix when the simulation pauses """ self.__download_on_pause = download_on_pause @@ -322,7 +276,5 @@ def download_on_pause(self, download_on_pause: bool) -> None: def partition_id(self) -> str: """ The partition id for the application edge - - :rtype: str """ return self.__partition_id diff --git a/spynnaker/pyNN/models/neuron/additional_inputs/additional_input_ca2_adaptive.py b/spynnaker/pyNN/models/neuron/additional_inputs/additional_input_ca2_adaptive.py index a2afd4b5aa7..cd83c5a8521 100644 --- a/spynnaker/pyNN/models/neuron/additional_inputs/additional_input_ca2_adaptive.py +++ b/spynnaker/pyNN/models/neuron/additional_inputs/additional_input_ca2_adaptive.py @@ -42,14 +42,8 @@ def __init__(self, tau_ca2: ModelParameter, i_ca2: ModelParameter, i_alpha: ModelParameter): r""" :param tau_ca2: :math:`\tau_{\mathrm{Ca}^{+2}}` - :type tau_ca2: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param i_ca2: :math:`I_{\mathrm{Ca}^{+2}}` - :type i_ca2: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param i_alpha: :math:`I_{\alpha}` - :type i_alpha: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function """ super().__init__( [Struct([ @@ -77,8 +71,6 @@ def add_state_variables( def tau_ca2(self) -> ModelParameter: r""" Settable model parameter: :math:`\tau_{\mathrm{Ca}^{+2}}` - - :rtype: float """ return self.__tau_ca2 @@ -86,8 +78,6 @@ def tau_ca2(self) -> ModelParameter: def i_ca2(self) -> ModelParameter: r""" Settable model parameter: :math:`I_{\mathrm{Ca}^{+2}}` - - :rtype: float """ return self.__i_ca2 @@ -95,7 +85,5 @@ def i_ca2(self) -> ModelParameter: def i_alpha(self) -> ModelParameter: r""" Settable model parameter: :math:`I_{\alpha}` - - :rtype: float """ return self.__i_alpha diff --git a/spynnaker/pyNN/models/neuron/builds/if_cond_exp_base.py b/spynnaker/pyNN/models/neuron/builds/if_cond_exp_base.py index 637c66a8e92..243c4fad780 100644 --- a/spynnaker/pyNN/models/neuron/builds/if_cond_exp_base.py +++ b/spynnaker/pyNN/models/neuron/builds/if_cond_exp_base.py @@ -28,47 +28,19 @@ class IFCondExpBase(AbstractPyNNNeuronModelStandard): conductance input. :param tau_m: :math:`\\tau_m` - :type tau_m: float, iterable(float), ~spynnaker.pyNN.RandomDistribution or - (mapping) function :param cm: :math:`C_m` - :type cm: float, iterable(float), ~spynnaker.pyNN.RandomDistribution or - (mapping) function :param v_rest: :math:`V_{rest}` - :type v_rest: float, iterable(float), ~spynnaker.pyNN.RandomDistribution or - (mapping) function :param v_reset: :math:`V_{reset}` - :type v_reset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_thresh: :math:`V_{thresh}` - :type v_thresh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_E: :math:`\\tau^{syn}_e` - :type tau_syn_E: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_I: :math:`\\tau^{syn}_i` - :type tau_syn_I: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_refrac: :math:`\\tau_{refrac}` - :type tau_refrac: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param i_offset: :math:`I_{offset}` - :type i_offset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param e_rev_E: :math:`E^{rev}_e` - :type e_rev_E: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param e_rev_I: :math:`E^{rev}_i` - :type e_rev_I: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v: :math:`V_{init}` - :type v: float, iterable(float), ~spynnaker.pyNN.RandomDistribution or - (mapping) function :param isyn_exc: :math:`I^{syn}_e` - :type isyn_exc: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_inh: :math:`I^{syn}_i` - :type isyn_inh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function """ __slots__ = () diff --git a/spynnaker/pyNN/models/neuron/builds/if_cond_exp_stoc.py b/spynnaker/pyNN/models/neuron/builds/if_cond_exp_stoc.py index 0ef884d8c65..6469db11945 100644 --- a/spynnaker/pyNN/models/neuron/builds/if_cond_exp_stoc.py +++ b/spynnaker/pyNN/models/neuron/builds/if_cond_exp_stoc.py @@ -48,38 +48,6 @@ class IFCondExpStoc(AbstractPyNNNeuronModelStandard): :param v: :math:`V_{init}` :param isyn_exc: :math:`I^{syn}_e` :param isyn_inh: :math:`I^{syn}_i` - :type tau_m: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function - :type cm: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function - :type v_rest: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function - :type v_reset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function - :type v_thresh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function - :type tau_syn_E: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function - :type tau_syn_I: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function - :type tau_refrac: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function - :type i_offset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function - :type e_rev_E: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function - :type e_rev_I: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function - :type du_th: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function - :type tau_th: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function - :type v: Float, float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function - :type isyn_exc: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function - :type isyn_inh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function """ @default_initial_values({"v", "isyn_exc", "isyn_inh"}) diff --git a/spynnaker/pyNN/models/neuron/builds/if_curr_alpha.py b/spynnaker/pyNN/models/neuron/builds/if_curr_alpha.py index 790369e76eb..518f249ff4d 100644 --- a/spynnaker/pyNN/models/neuron/builds/if_curr_alpha.py +++ b/spynnaker/pyNN/models/neuron/builds/if_curr_alpha.py @@ -27,49 +27,19 @@ class IFCurrAlpha(AbstractPyNNNeuronModelStandard): Leaky integrate and fire neuron with an alpha-shaped current-based input. :param tau_m: :math:`\\tau_m` - :type tau_m: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param cm: :math:`C_m` - :type cm: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_rest: :math:`V_{rest}` - :type v_rest: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_reset: :math:`V_{reset}` - :type v_reset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_thresh: :math:`V_{thresh}` - :type v_thresh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_E: :math:`\\tau^{syn}_e` - :type tau_syn_E: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_I: :math:`\\tau^{syn}_i` - :type tau_syn_I: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_refrac: :math:`\\tau_{refrac}` - :type tau_refrac: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param i_offset: :math:`I_{offset}` - :type i_offset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v: :math:`V_{init}` - :type v: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param exc_response: :math:`response^\\mathrm{linear}_e` - :type exc_response: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param exc_exp_response: :math:`response^\\mathrm{exponential}_e` - :type exc_exp_response: - float, iterable(float), ~spynnaker.pyNN.RandomDistribution or - (mapping) function :param inh_response: :math:`response^\\mathrm{linear}_i` - :type inh_response: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param inh_exp_response: :math:`response^\\mathrm{exponential}_i` - :type inh_exp_response: - float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function """ @default_initial_values({ diff --git a/spynnaker/pyNN/models/neuron/builds/if_curr_delta.py b/spynnaker/pyNN/models/neuron/builds/if_curr_delta.py index f9d3f4c58bd..96596be1622 100644 --- a/spynnaker/pyNN/models/neuron/builds/if_curr_delta.py +++ b/spynnaker/pyNN/models/neuron/builds/if_curr_delta.py @@ -27,35 +27,15 @@ class IFCurrDelta(AbstractPyNNNeuronModelStandard): Leaky integrate and fire neuron with an instantaneous current input. :param tau_m: :math:`\\tau_m` - :type tau_m: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param cm: :math:`C_m` - :type cm: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_rest: :math:`V_{rest}` - :type v_rest: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_reset: :math:`V_{reset}` - :type v_reset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_thresh: :math:`V_{thresh}` - :type v_thresh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_refrac: :math:`\\tau_{refrac}` - :type tau_refrac: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param i_offset: :math:`I_{offset}` - :type i_offset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v: :math:`V_{init}` - :type v: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_exc: :math:`I^{syn}_e` - :type isyn_exc: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_inh: :math:`I^{syn}_i` - :type: isyn_inh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function """ # noinspection PyPep8Naming diff --git a/spynnaker/pyNN/models/neuron/builds/if_curr_delta_ca2_adaptive.py b/spynnaker/pyNN/models/neuron/builds/if_curr_delta_ca2_adaptive.py index 89d6fda682c..d7ce7dd7e9b 100644 --- a/spynnaker/pyNN/models/neuron/builds/if_curr_delta_ca2_adaptive.py +++ b/spynnaker/pyNN/models/neuron/builds/if_curr_delta_ca2_adaptive.py @@ -29,44 +29,18 @@ class IFCurrDeltaCa2Adaptive(AbstractPyNNNeuronModelStandard): Leaky integrate and fire neuron with an instantaneous current input. :param tau_m: :math:`\\tau_m` - :type tau_m: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param cm: :math:`C_m` - :type cm: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_rest: :math:`V_{rest}` - :type v_rest: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_reset: :math:`V_{reset}` - :type v_reset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_thresh: :math:`V_{thresh}` - :type v_thresh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_refrac: :math:`\\tau_{refrac}` - :type tau_refrac: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param tau_ca2: :math:`\\tau_{\\mathrm{Ca}^{+2}}` - :type tau_ca2: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param i_ca2: :math:`I_{\\mathrm{Ca}^{+2}}` - :type i_ca2: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param i_alpha: :math:`\\tau_\\alpha` - :type i_alpha: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param i_offset: :math:`I_{offset}` - :type i_offset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v: :math:`V_{init}` - :type v: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_exc: :math:`I^{syn}_e` - :type isyn_exc: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_inh: :math:`I^{syn}_i` - :type: isyn_inh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function """ # noinspection PyPep8Naming diff --git a/spynnaker/pyNN/models/neuron/builds/if_curr_delta_fixed_prob.py b/spynnaker/pyNN/models/neuron/builds/if_curr_delta_fixed_prob.py index 5cd0a8a7c8f..cade0f4b7d2 100644 --- a/spynnaker/pyNN/models/neuron/builds/if_curr_delta_fixed_prob.py +++ b/spynnaker/pyNN/models/neuron/builds/if_curr_delta_fixed_prob.py @@ -29,38 +29,16 @@ class IFCurrDeltaFixedProb(AbstractPyNNNeuronModelStandard): fixed probability of spiking once a threshold is reached. :param tau_m: :math:`\\tau_m` - :type tau_m: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param cm: :math:`C_m` - :type cm: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_rest: :math:`V_{rest}` - :type v_rest: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_reset: :math:`V_{reset}` - :type v_reset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_thresh: :math:`V_{thresh}` - :type v_thresh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param p_thresh: :math:`P_{thresh}` - :type p_thresh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_refrac: :math:`\\tau_{refrac}` - :type tau_refrac: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param i_offset: :math:`I_{offset}` - :type i_offset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v: :math:`V_{init}` - :type v: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_exc: :math:`I^{syn}_e` - :type isyn_exc: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_inh: :math:`I^{syn}_i` - :type: isyn_inh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function """ # noinspection PyPep8Naming diff --git a/spynnaker/pyNN/models/neuron/builds/if_curr_dual_exp_base.py b/spynnaker/pyNN/models/neuron/builds/if_curr_dual_exp_base.py index d9f06460f2c..4c417811a0d 100644 --- a/spynnaker/pyNN/models/neuron/builds/if_curr_dual_exp_base.py +++ b/spynnaker/pyNN/models/neuron/builds/if_curr_dual_exp_base.py @@ -30,47 +30,19 @@ class IFCurrDualExpBase(AbstractPyNNNeuronModelStandard): current input. :param tau_m: :math:`\\tau_m` - :type tau_m: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param cm: :math:`C_m` - :type cm: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_rest: :math:`V_{rest}` - :type v_rest: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_reset: :math:`V_{reset}` - :type v_reset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_thresh: :math:`V_{thresh}` - :type v_thresh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_E: :math:`\\tau^{syn}_{e_1}` - :type tau_syn_E: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_E2: :math:`\\tau^{syn}_{e_2}` - :type tau_syn_E2: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param tau_syn_I: :math:`\\tau^{syn}_i` - :type tau_syn_I: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_refrac: :math:`\\tau_{refrac}` - :type tau_refrac: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param i_offset: :math:`I_{offset}` - :type i_offset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v: :math:`V_{init}` - :type v: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_exc: :math:`I^{syn}_{e_1}` - :type isyn_exc: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_inh: :math:`I^{syn}_i` - :type isyn_inh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_exc2: :math:`I^{syn}_{e_2}` - :type isyn_exc2: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function """ @default_initial_values({"v", "isyn_exc", "isyn_exc2", "isyn_inh"}) diff --git a/spynnaker/pyNN/models/neuron/builds/if_curr_exp_base.py b/spynnaker/pyNN/models/neuron/builds/if_curr_exp_base.py index a1b86737f2a..8e5767b7d51 100644 --- a/spynnaker/pyNN/models/neuron/builds/if_curr_exp_base.py +++ b/spynnaker/pyNN/models/neuron/builds/if_curr_exp_base.py @@ -28,41 +28,17 @@ class IFCurrExpBase(AbstractPyNNNeuronModelStandard): current input. :param tau_m: :math:`\\tau_m` - :type tau_m: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param cm: :math:`C_m` - :type cm: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_rest: :math:`V_{rest}` - :type v_rest: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_reset: :math:`V_{reset}` - :type v_reset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_thresh: :math:`V_{thresh}` - :type v_thresh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_E: :math:`\\tau^{syn}_e` - :type tau_syn_E: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_I: :math:`\\tau^{syn}_i` - :type tau_syn_I: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_refrac: :math:`\\tau_{refrac}` - :type tau_refrac: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param i_offset: :math:`I_{offset}` - :type i_offset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v: :math:`V_{init}` - :type v: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_exc: :math:`I^{syn}_e` - :type isyn_exc: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_inh: :math:`I^{syn}_i` - :type isyn_inh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function """ @default_initial_values({"v", "isyn_exc", "isyn_inh"}) diff --git a/spynnaker/pyNN/models/neuron/builds/if_curr_exp_ca2_adaptive.py b/spynnaker/pyNN/models/neuron/builds/if_curr_exp_ca2_adaptive.py index c99fd02abf4..1be3da90ef3 100644 --- a/spynnaker/pyNN/models/neuron/builds/if_curr_exp_ca2_adaptive.py +++ b/spynnaker/pyNN/models/neuron/builds/if_curr_exp_ca2_adaptive.py @@ -34,50 +34,20 @@ class IFCurrExpCa2Adaptive(AbstractPyNNNeuronModelStandard): `_ :param tau_m: :math:`\\tau_m` - :type tau_m: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param cm: :math:`C_m` - :type cm: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_rest: :math:`V_{rest}` - :type v_rest: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_reset: :math:`V_{reset}` - :type v_reset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_thresh: :math:`V_{thresh}` - :type v_thresh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_E: :math:`\\tau^{syn}_e` - :type tau_syn_E: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_I: :math:`\\tau^{syn}_i` - :type tau_syn_I: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_refrac: :math:`\\tau_{refrac}` - :type tau_refrac: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param i_offset: :math:`I_{offset}` - :type i_offset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_ca2: :math:`\\tau_{\\mathrm{Ca}^{+2}}` - :type tau_ca2: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param i_ca2: :math:`I_{\\mathrm{Ca}^{+2}}` - :type i_ca2: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param i_alpha: :math:`\\tau_\\alpha` - :type i_alpha: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v: :math:`V_{init}` - :type v: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_exc: :math:`I^{syn}_e` - :type isyn_exc: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_inh: :math:`I^{syn}_i` - :type isyn_inh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function """ @default_initial_values({"v", "isyn_exc", "isyn_inh", "i_ca2"}) diff --git a/spynnaker/pyNN/models/neuron/builds/if_curr_exp_semd_base.py b/spynnaker/pyNN/models/neuron/builds/if_curr_exp_semd_base.py index 1201241319a..e6ef888a2b1 100644 --- a/spynnaker/pyNN/models/neuron/builds/if_curr_exp_semd_base.py +++ b/spynnaker/pyNN/models/neuron/builds/if_curr_exp_semd_base.py @@ -29,56 +29,22 @@ class IFCurrExpSEMDBase(AbstractPyNNNeuronModelStandard): input (see https://www.cit-ec.de/en/nbs/spiking-insect-vision) :param tau_m: :math:`\\tau_m` - :type tau_m: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param cm: :math:`C_m` - :type cm: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_rest: :math:`V_{rest}` - :type v_rest: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_reset: :math:`V_{reset}` - :type v_reset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_thresh: :math:`V_{thresh}` - :type v_thresh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_E: :math:`\\tau^{syn}_{e_1}` - :type tau_syn_E: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_E2: :math:`\\tau^{syn}_{e_2}` - :type tau_syn_E2: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param tau_syn_I: :math:`\\tau^{syn}_i` - :type tau_syn_I: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_refrac: :math:`\\tau_{refrac}` - :type tau_refrac: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param i_offset: :math:`I_{offset}` - :type i_offset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v: :math:`V_{init}` - :type v: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_exc: :math:`I^{syn}_{e_1}` - :type isyn_exc: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_exc2: :math:`I^{syn}_{e_2}` - :type isyn_exc2: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_inh: :math:`I^{syn}_i` - :type isyn_inh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param multiplicator: - :type multiplicator: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param exc2_old: - :type exc2_old: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param scaling_factor: - :type scaling_factor: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function """ @default_initial_values({"v", "isyn_exc", "isyn_exc2", "isyn_inh", diff --git a/spynnaker/pyNN/models/neuron/builds/if_trunc_delta.py b/spynnaker/pyNN/models/neuron/builds/if_trunc_delta.py index 0c139cdbc34..d8b2d7f26d2 100644 --- a/spynnaker/pyNN/models/neuron/builds/if_trunc_delta.py +++ b/spynnaker/pyNN/models/neuron/builds/if_trunc_delta.py @@ -27,32 +27,14 @@ class IFTruncDelta(AbstractPyNNNeuronModelStandard): and truncation of membrane voltage so that it never goes below V_reset. :param tau_m: :math:`\\tau_m` - :type tau_m: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param cm: :math:`C_m` - :type cm: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_reset: :math:`V_{reset}` - :type v_reset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_thresh: :math:`V_{thresh}` - :type v_thresh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_refrac: :math:`\\tau_{refrac}` - :type tau_refrac: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param i_offset: :math:`I_{offset}` - :type i_offset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v: :math:`V_{init}` - :type v: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_exc: :math:`I^{syn}_e` - :type isyn_exc: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_inh: :math:`I^{syn}_i` - :type: isyn_inh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function """ # noinspection PyPep8Naming diff --git a/spynnaker/pyNN/models/neuron/builds/izk_cond_dual_exp_base.py b/spynnaker/pyNN/models/neuron/builds/izk_cond_dual_exp_base.py index baefc690400..16bca045318 100644 --- a/spynnaker/pyNN/models/neuron/builds/izk_cond_dual_exp_base.py +++ b/spynnaker/pyNN/models/neuron/builds/izk_cond_dual_exp_base.py @@ -29,50 +29,20 @@ class IzkCondDualExpBase(AbstractPyNNNeuronModelStandard): Izhikevich neuron model with conductance inputs and dual synapse. :param a: :math:`a` - :type a: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param b: :math:`b` - :type b: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param c: :math:`c` - :type c: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param d: :math:`d` - :type d: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param i_offset: :math:`I_{offset}` - :type i_offset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param u: :math:`u_{init} = \\delta V_{init}` - :type u: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v: :math:`v_{init} = V_{init}` - :type v: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_E: :math:`\\tau^{syn}_e` - :type tau_syn_E: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_E2: :math:`\\tau^{syn}_{e_2}` - :type tau_syn_E2: float, iterable(float), - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param tau_syn_I: :math:`\\tau^{syn}_i` - :type tau_syn_I: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param e_rev_E: :math:`E^{rev}_e` - :type e_rev_E: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param e_rev_I: :math:`E^{rev}_i` - :type e_rev_I: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_exc: :math:`I^{syn}_e` - :type isyn_exc: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_exc2: :math:`I^{syn}_{e_2}` - :type isyn_exc2: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_inh: :math:`I^{syn}_i` - :type isyn_inh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function """ # noinspection PyPep8Naming diff --git a/spynnaker/pyNN/models/neuron/builds/izk_cond_exp_base.py b/spynnaker/pyNN/models/neuron/builds/izk_cond_exp_base.py index 353b4b58d46..104b523284e 100644 --- a/spynnaker/pyNN/models/neuron/builds/izk_cond_exp_base.py +++ b/spynnaker/pyNN/models/neuron/builds/izk_cond_exp_base.py @@ -28,44 +28,18 @@ class IzkCondExpBase(AbstractPyNNNeuronModelStandard): Izhikevich neuron model with conductance inputs. :param a: :math:`a` - :type a: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param b: :math:`b` - :type b: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param c: :math:`c` - :type c: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param d: :math:`d` - :type d: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param i_offset: :math:`I_{offset}` - :type i_offset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param u: :math:`u_{init} = \\delta V_{init}` - :type u: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v: :math:`v_{init} = V_{init}` - :type v: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_E: :math:`\\tau^{syn}_e` - :type tau_syn_E: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_I: :math:`\\tau^{syn}_i` - :type tau_syn_I: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param e_rev_E: :math:`E^{rev}_e` - :type e_rev_E: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param e_rev_I: :math:`E^{rev}_i` - :type e_rev_I: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_exc: :math:`I^{syn}_e` - :type isyn_exc: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_inh: :math:`I^{syn}_i` - :type isyn_inh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function """ # noinspection PyPep8Naming diff --git a/spynnaker/pyNN/models/neuron/builds/izk_curr_exp_base.py b/spynnaker/pyNN/models/neuron/builds/izk_curr_exp_base.py index 3bc6a553b12..e666c196f64 100644 --- a/spynnaker/pyNN/models/neuron/builds/izk_curr_exp_base.py +++ b/spynnaker/pyNN/models/neuron/builds/izk_curr_exp_base.py @@ -28,38 +28,16 @@ class IzkCurrExpBase(AbstractPyNNNeuronModelStandard): Izhikevich neuron model with current inputs. :param a: :math:`a` - :type a: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param b: :math:`b` - :type b: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param c: :math:`c` - :type c: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param d: :math:`d` - :type d: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param i_offset: :math:`I_{offset}` - :type i_offset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param u: :math:`u_{init} = \\delta V_{init}` - :type u: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v: :math:`v_{init} = V_{init}` - :type v: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_E: :math:`\\tau^{syn}_e` - :type tau_syn_E: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param tau_syn_I: :math:`\\tau^{syn}_i` - :type tau_syn_I: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_exc: :math:`I^{syn}_e` - :type isyn_exc: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param isyn_inh: :math:`I^{syn}_i` - :type isyn_inh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution - or (mapping) function """ # noinspection PyPep8Naming diff --git a/spynnaker/pyNN/models/neuron/implementations/abstract_neuron_impl.py b/spynnaker/pyNN/models/neuron/implementations/abstract_neuron_impl.py index c3358b0c782..d8d3658bda6 100644 --- a/spynnaker/pyNN/models/neuron/implementations/abstract_neuron_impl.py +++ b/spynnaker/pyNN/models/neuron/implementations/abstract_neuron_impl.py @@ -30,8 +30,6 @@ class AbstractNeuronImpl(object, metaclass=AbstractBase): def model_name(self) -> str: """ The name of the model. - - :rtype: str """ raise NotImplementedError @@ -40,8 +38,6 @@ def model_name(self) -> str: def binary_name(self) -> str: """ The name of the binary executable of this implementation. - - :rtype: str """ raise NotImplementedError @@ -50,8 +46,6 @@ def binary_name(self) -> str: def structs(self) -> Sequence[Struct]: """ A list of structures used by the implementation. - - :rtype: list(Struct) """ raise NotImplementedError @@ -59,8 +53,6 @@ def structs(self) -> Sequence[Struct]: def get_global_weight_scale(self) -> float: """ Get the weight scaling required by this model. - - :rtype: float """ raise NotImplementedError @@ -68,8 +60,6 @@ def get_global_weight_scale(self) -> float: def get_n_synapse_types(self) -> int: """ Get the number of synapse types supported by the model. - - :rtype: int """ raise NotImplementedError @@ -78,8 +68,7 @@ def get_synapse_id_by_target(self, target: str) -> Optional[int]: """ Get the ID of a synapse given the name. - :param str target: The name of the synapse - :rtype: int + :param target: The name of the synapse """ raise NotImplementedError @@ -87,8 +76,6 @@ def get_synapse_id_by_target(self, target: str) -> Optional[int]: def get_synapse_targets(self) -> Sequence[str]: """ Get the target names of the synapse type. - - :rtype: list(str) """ raise NotImplementedError @@ -96,8 +83,6 @@ def get_synapse_targets(self) -> Sequence[str]: def get_recordable_variables(self) -> Sequence[str]: """ Get the names of the variables that can be recorded in this model. - - :rtype: list(str) """ raise NotImplementedError @@ -106,7 +91,7 @@ def get_recordable_units(self, variable: str) -> str: """ Get the units of the given variable that can be recorded. - :param str variable: The name of the variable + :param variable: The name of the variable """ raise NotImplementedError @@ -116,7 +101,6 @@ def get_recordable_data_types(self) -> Mapping[str, DataType]: Get the data type of the variables that can be recorded. :return: dictionary of name of variable to data type of variable - :rtype: dict(str,~data_specification.enums.DataType) """ raise NotImplementedError @@ -125,8 +109,7 @@ def is_recordable(self, variable: str) -> bool: """ Determine if the given variable can be recorded. - :param str variable: The name of the variable - :rtype: bool + :param variable: The name of the variable """ raise NotImplementedError @@ -136,8 +119,7 @@ def get_recordable_variable_index(self, variable: str) -> int: Get the index of the variable in the list of variables that can be recorded. - :param str variable: The name of the variable - :rtype: int + :param variable: The name of the variable """ raise NotImplementedError @@ -146,8 +128,7 @@ def add_parameters(self, parameters: RangeDictionary) -> None: """ Add the initial values of the parameters to the parameter holder. - :param ~spinn_utilities.ranged.RangeDictionary parameters: - A holder of the parameters + :param parameters: A holder of the parameters """ raise NotImplementedError @@ -157,8 +138,7 @@ def add_state_variables(self, state_variables: RangeDictionary) -> None: Add the initial values of the state variables to the state variables holder. - :param ~spinn_utilities.ranged.RangeDictionary state_variables: - A holder of the state variables + :param state_variables: A holder of the state variables """ raise NotImplementedError @@ -167,8 +147,7 @@ def get_units(self, variable: str) -> str: """ Get the units of the given variable. - :param str variable: The name of the variable - :rtype: str + :param variable: The name of the variable """ raise NotImplementedError @@ -177,7 +156,5 @@ def get_units(self, variable: str) -> str: def is_conductance_based(self) -> bool: """ Whether the model uses conductance. - - :rtype: bool """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neuron/implementations/abstract_standard_neuron_component.py b/spynnaker/pyNN/models/neuron/implementations/abstract_standard_neuron_component.py index fb76032b413..35a902d20a7 100644 --- a/spynnaker/pyNN/models/neuron/implementations/abstract_standard_neuron_component.py +++ b/spynnaker/pyNN/models/neuron/implementations/abstract_standard_neuron_component.py @@ -42,8 +42,8 @@ class AbstractStandardNeuronComponent(object, metaclass=AbstractBase): def __init__(self, structs: List[Struct], units: Dict[str, str]): """ - :param list(Struct) structs: The structures of the component - :param dict units: The units to use for each parameter + :param structs: The structures of the component + :param units: The units to use for each parameter """ self.__structs = structs self.__units = units @@ -57,8 +57,6 @@ def structs(self) -> List[Struct]: e.g. for non-repeating structure `g`, followed by repeating structures `s1` and `s2` with 3 neurons the layout will be: ``[g, s1, s1, s1, s2, s2, s2]``. - - :rtype: list(~spynnaker.pyNN.utilities.struct.Struct) """ return self.__structs @@ -67,8 +65,7 @@ def add_parameters(self, parameters: RangeDictionary[float]) -> None: """ Add the initial values of the parameters to the parameter holder. - :param ~spinn_utilities.ranged.RangeDictionary parameters: - A holder of the parameters + :param parameters: A holder of the parameters """ raise NotImplementedError @@ -79,8 +76,7 @@ def add_state_variables( Add the initial values of the state variables to the state variables holder. - :param ~spinn_utilities.ranged.RangeDictionary state_variables: - A holder of the state variables + :param state_variables: A holder of the state variables """ raise NotImplementedError @@ -88,8 +84,7 @@ def has_variable(self, variable: str) -> bool: """ Determine if this component has a variable by the given name. - :param str variable: The name of the variable - :rtype: bool + :param variable: The name of the variable """ return variable in self.__units @@ -97,7 +92,7 @@ def get_units(self, variable: str) -> str: """ Get the units of the given variable. - :param str variable: The name of the variable + :param variable: The name of the variable """ return self.__units[variable] diff --git a/spynnaker/pyNN/models/neuron/implementations/neuron_impl_standard.py b/spynnaker/pyNN/models/neuron/implementations/neuron_impl_standard.py index 32bc6a18e65..7af2f11eca6 100644 --- a/spynnaker/pyNN/models/neuron/implementations/neuron_impl_standard.py +++ b/spynnaker/pyNN/models/neuron/implementations/neuron_impl_standard.py @@ -77,14 +77,13 @@ def __init__( threshold_type: AbstractThresholdType, additional_input_type: Optional[AbstractAdditionalInput] = None): """ - :param str model_name: - :param str binary: - :param AbstractNeuronModel neuron_model: - :param AbstractInputType input_type: - :param AbstractSynapseType synapse_type: - :param AbstractThresholdType threshold_type: + :param model_name: + :param binary: + :param neuron_model: + :param input_type: + :param synapse_type: + :param threshold_type: :param additional_input_type: - :type additional_input_type: AbstractAdditionalInput or None """ self.__model_name = model_name self.__binary = binary @@ -105,8 +104,6 @@ def __init__( def n_steps_per_timestep(self) -> int: """ Get the last set n steps per timestep - - :rtype: int """ return self.__n_steps_per_timestep diff --git a/spynnaker/pyNN/models/neuron/input_types/abstract_input_type.py b/spynnaker/pyNN/models/neuron/input_types/abstract_input_type.py index 8394d1fb040..dc2d132537c 100644 --- a/spynnaker/pyNN/models/neuron/input_types/abstract_input_type.py +++ b/spynnaker/pyNN/models/neuron/input_types/abstract_input_type.py @@ -30,6 +30,5 @@ def get_global_weight_scale(self) -> float: Get the global weight scaling value. :return: The global weight scaling value - :rtype: float """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neuron/input_types/input_type_conductance.py b/spynnaker/pyNN/models/neuron/input_types/input_type_conductance.py index 9f151b85e6b..705f76efffc 100644 --- a/spynnaker/pyNN/models/neuron/input_types/input_type_conductance.py +++ b/spynnaker/pyNN/models/neuron/input_types/input_type_conductance.py @@ -38,12 +38,8 @@ def __init__(self, e_rev_E: ModelParameter, e_rev_I: ModelParameter): """ :param e_rev_E: Reversal potential for excitatory input; :math:`E^{rev}_e` - :type e_rev_E: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param e_rev_I: Reversal potential for inhibitory input; :math:`E^{rev}_i` - :type e_rev_I: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function """ super().__init__( [Struct([(DataType.S1615, E_REV_E), diff --git a/spynnaker/pyNN/models/neuron/local_only/abstract_local_only.py b/spynnaker/pyNN/models/neuron/local_only/abstract_local_only.py index 180bfd1acb9..68dddcbf316 100644 --- a/spynnaker/pyNN/models/neuron/local_only/abstract_local_only.py +++ b/spynnaker/pyNN/models/neuron/local_only/abstract_local_only.py @@ -38,7 +38,7 @@ class AbstractLocalOnly(AbstractSynapseDynamics): def __init__(self, delay: WEIGHTS_DELAYS_IN): """ - :param float delay: + :param delay: The delay used in the connection; by default 1 time step """ # We don't have a weight here, it is in the connector @@ -67,12 +67,10 @@ def write_parameters( """ Write the parameters to the data specification for a vertex. - :param ~data_specification.DataSpecificationGenerator spec: - The specification to write to - :param int region: region ID to write to - :param ~pacman.model.graphs.machine.MachineVertex machine_vertex: - The machine vertex being targeted - :param list(float) weight_scales: Scale factors to apply to the weights + :param spec: The specification to write to + :param region: region ID to write to + :param machine_vertex: The machine vertex being targeted + :param weight_scales: Scale factors to apply to the weights """ raise NotImplementedError @@ -84,8 +82,6 @@ def absolute_max_atoms_per_core(self) -> int: .. note:: This is *not* constrained by the usual limits of the master population table. - - :rtype: int """ # A bit of an estimate for these local-only systems, which don't use # the master population table and so don't have the same limit diff --git a/spynnaker/pyNN/models/neuron/local_only/local_only_convolution.py b/spynnaker/pyNN/models/neuron/local_only/local_only_convolution.py index 1ad0f0cdb33..874728ef93e 100644 --- a/spynnaker/pyNN/models/neuron/local_only/local_only_convolution.py +++ b/spynnaker/pyNN/models/neuron/local_only/local_only_convolution.py @@ -71,7 +71,7 @@ class LocalOnlyConvolution(AbstractLocalOnly, AbstractSupportsSignedWeights): def __init__(self, delay: WEIGHTS_DELAYS_IN = None): """ - :param float delay: + :param delay: The delay used in the connection; by default 1 time step """ super().__init__(delay) @@ -255,11 +255,10 @@ def __get_sources_for_target( Get all the application vertex sources that will hit the given application vertex. - :param PopulationVertex app_vertex: The vertex being targeted + :param app_vertex: The vertex being targeted :return: A dict of source PopulationApplicationVertex to list of source information - :rtype: dict(tuple(PopulationApplicationVertex, str), list(Source)) """ sources = self.__cached_sources.get(app_vertex) if sources is None: diff --git a/spynnaker/pyNN/models/neuron/local_only/local_only_pool_dense.py b/spynnaker/pyNN/models/neuron/local_only/local_only_pool_dense.py index 3c4800516e8..cd5d372c936 100644 --- a/spynnaker/pyNN/models/neuron/local_only/local_only_pool_dense.py +++ b/spynnaker/pyNN/models/neuron/local_only/local_only_pool_dense.py @@ -233,11 +233,10 @@ def __get_sources_for_target( Get all the application vertex sources that will hit the given application vertex. - :param PopulationVertex app_vertex: The vertex being targeted + :param app_vertex: The vertex being targeted :return: A dict of source ApplicationVertex and partition id to list of source information - :rtype: dict(tuple(ApplicationVertex, str), list(Source)) """ sources = self.__cached_sources.get(app_vertex) if sources is None: diff --git a/spynnaker/pyNN/models/neuron/neuron_models/neuron_model_if_trunc.py b/spynnaker/pyNN/models/neuron/neuron_models/neuron_model_if_trunc.py index 5cb99e16a7c..73c6d2da8e4 100644 --- a/spynnaker/pyNN/models/neuron/neuron_models/neuron_model_if_trunc.py +++ b/spynnaker/pyNN/models/neuron/neuron_models/neuron_model_if_trunc.py @@ -52,26 +52,12 @@ def __init__( tau_refrac: ModelParameter): r""" :param v_init: :math:`V_{init}` - :type v_init: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param v_rest: :math:`V_{rest}` - :type v_rest: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param tau_m: :math:`\tau_{m}` - :type tau_m: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param cm: :math:`C_m` - :type cm: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param i_offset: :math:`I_{offset}` - :type i_offset: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param v_reset: :math:`V_{reset}` - :type v_reset: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param tau_refrac: :math:`\tau_{refrac}` - :type tau_refrac: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function """ super().__init__( [Struct([ @@ -114,8 +100,6 @@ def add_state_variables( def v_init(self) -> ModelParameter: """ Settable model parameter: :math:`V_{init}` - - :rtype: float """ return self.__v_init @@ -123,8 +107,6 @@ def v_init(self) -> ModelParameter: def tau_m(self) -> ModelParameter: r""" Settable model parameter: :math:`\tau_{m}` - - :rtype: float """ return self.__tau_m @@ -132,8 +114,6 @@ def tau_m(self) -> ModelParameter: def cm(self) -> ModelParameter: """ Settable model parameter: :math:`C_m` - - :rtype: float """ return self.__cm @@ -141,8 +121,6 @@ def cm(self) -> ModelParameter: def i_offset(self) -> ModelParameter: """ Settable model parameter: :math:`I_{offset}` - - :rtype: float """ return self.__i_offset @@ -150,8 +128,6 @@ def i_offset(self) -> ModelParameter: def v_reset(self) -> ModelParameter: """ Settable model parameter: :math:`V_{reset}` - - :rtype: float """ return self.__v_reset @@ -159,7 +135,5 @@ def v_reset(self) -> ModelParameter: def tau_refrac(self) -> ModelParameter: r""" Settable model parameter: :math:`\tau_{refrac}` - - :rtype: float """ return self.__tau_refrac diff --git a/spynnaker/pyNN/models/neuron/neuron_models/neuron_model_izh.py b/spynnaker/pyNN/models/neuron/neuron_models/neuron_model_izh.py index e904059cc91..cb4329a7093 100644 --- a/spynnaker/pyNN/models/neuron/neuron_models/neuron_model_izh.py +++ b/spynnaker/pyNN/models/neuron/neuron_models/neuron_model_izh.py @@ -45,26 +45,12 @@ def __init__( i_offset: ModelParameter): """ :param a: :math:`a` - :type a: float or iterable(float) or ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param b: :math:`b` - :type b: float or iterable(float) or ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param c: :math:`c` - :type c: float or iterable(float) or ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param d: :math:`d` - :type d: float or iterable(float) or ~spynnaker.pyNN.RandomDistribution - or (mapping) function :param v_init: :math:`v_{init}` - :type v_init: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param u_init: :math:`u_{init}` - :type u_init: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param i_offset: :math:`I_{offset}` - :type i_offset: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function """ super().__init__( [Struct([ @@ -108,8 +94,6 @@ def add_state_variables( def a(self) -> ModelParameter: """ Settable model parameter: :math:`a` - - :rtype: float """ return self.__a @@ -117,8 +101,6 @@ def a(self) -> ModelParameter: def b(self) -> ModelParameter: """ Settable model parameter: :math:`b` - - :rtype: float """ return self.__b @@ -126,8 +108,6 @@ def b(self) -> ModelParameter: def c(self) -> ModelParameter: """ Settable model parameter: :math:`c` - - :rtype: float """ return self.__c @@ -135,8 +115,6 @@ def c(self) -> ModelParameter: def d(self) -> ModelParameter: """ Settable model parameter: :math:`d` - - :rtype: float """ return self.__d @@ -144,8 +122,6 @@ def d(self) -> ModelParameter: def i_offset(self) -> ModelParameter: """ Settable model parameter: :math:`I_{offset}` - - :rtype: float """ return self.__i_offset @@ -153,8 +129,6 @@ def i_offset(self) -> ModelParameter: def v_init(self) -> ModelParameter: """ Settable model parameter: :math:`v_{init}` - - :rtype: float """ return self.__v_init @@ -162,7 +136,5 @@ def v_init(self) -> ModelParameter: def u_init(self) -> ModelParameter: """ Settable model parameter: :math:`u_{init}` - - :rtype: float """ return self.__u_init diff --git a/spynnaker/pyNN/models/neuron/neuron_models/neuron_model_leaky_integrate_and_fire.py b/spynnaker/pyNN/models/neuron/neuron_models/neuron_model_leaky_integrate_and_fire.py index 8cb038eba61..1013b3de54d 100644 --- a/spynnaker/pyNN/models/neuron/neuron_models/neuron_model_leaky_integrate_and_fire.py +++ b/spynnaker/pyNN/models/neuron/neuron_models/neuron_model_leaky_integrate_and_fire.py @@ -53,26 +53,12 @@ def __init__( tau_refrac: ModelParameter): r""" :param v_init: :math:`V_{init}` - :type v_init: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param v_rest: :math:`V_{rest}` - :type v_rest: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param tau_m: :math:`\tau_{m}` - :type tau_m: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param cm: :math:`C_m` - :type cm: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param i_offset: :math:`I_{offset}` - :type i_offset: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param v_reset: :math:`V_{reset}` - :type v_reset: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param tau_refrac: :math:`\tau_{refrac}` - :type tau_refrac: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function """ super().__init__( [Struct([ @@ -118,8 +104,6 @@ def add_state_variables( def v_init(self) -> ModelParameter: """ Settable model parameter: :math:`V_{init}` - - :rtype: float """ return self.__v_init @@ -127,8 +111,6 @@ def v_init(self) -> ModelParameter: def v_rest(self) -> ModelParameter: """ Settable model parameter: :math:`V_{rest}` - - :rtype: float """ return self.__v_rest @@ -136,8 +118,6 @@ def v_rest(self) -> ModelParameter: def tau_m(self) -> ModelParameter: r""" Settable model parameter: :math:`\tau_{m}` - - :rtype: float """ return self.__tau_m @@ -145,8 +125,6 @@ def tau_m(self) -> ModelParameter: def cm(self) -> ModelParameter: """ Settable model parameter: :math:`C_m` - - :rtype: float """ return self.__cm @@ -154,8 +132,6 @@ def cm(self) -> ModelParameter: def i_offset(self) -> ModelParameter: """ Settable model parameter: :math:`I_{offset}` - - :rtype: float """ return self.__i_offset @@ -163,8 +139,6 @@ def i_offset(self) -> ModelParameter: def v_reset(self) -> ModelParameter: """ Settable model parameter: :math:`V_{reset}` - - :rtype: float """ return self.__v_reset @@ -172,7 +146,5 @@ def v_reset(self) -> ModelParameter: def tau_refrac(self) -> ModelParameter: r""" Settable model parameter: :math:`\tau_{refrac}` - - :rtype: float """ return self.__tau_refrac diff --git a/spynnaker/pyNN/models/neuron/plasticity/stdp/common.py b/spynnaker/pyNN/models/neuron/plasticity/stdp/common.py index 837c109e288..f547f4433f9 100644 --- a/spynnaker/pyNN/models/neuron/plasticity/stdp/common.py +++ b/spynnaker/pyNN/models/neuron/plasticity/stdp/common.py @@ -23,8 +23,7 @@ def float_to_fixed(value: float) -> int: """ - :param float value: - :rtype: int + :param value: """ return int(round(float(value) * STDP_FIXED_POINT_ONE)) @@ -32,10 +31,9 @@ def float_to_fixed(value: float) -> int: def get_exp_lut_array(time_step: float, time_constant: float, shift: int = 0) -> NDArray[uint32]: """ - :param float time_step: - :param float time_constant: - :param int shift: - :rtype: ~numpy.ndarray + :param time_step: + :param time_constant: + :param shift: """ # Compute the actual exponential decay parameter # NB: lambda is a reserved word in Python diff --git a/spynnaker/pyNN/models/neuron/plasticity/stdp/synapse_structure/abstract_synapse_structure.py b/spynnaker/pyNN/models/neuron/plasticity/stdp/synapse_structure/abstract_synapse_structure.py index 2ae6487f381..e8e66857170 100644 --- a/spynnaker/pyNN/models/neuron/plasticity/stdp/synapse_structure/abstract_synapse_structure.py +++ b/spynnaker/pyNN/models/neuron/plasticity/stdp/synapse_structure/abstract_synapse_structure.py @@ -26,8 +26,6 @@ class AbstractSynapseStructure(object, metaclass=AbstractBase): def get_n_half_words_per_connection(self) -> int: """ Get the number of bytes for each connection. - - :rtype: int """ raise NotImplementedError @@ -35,7 +33,5 @@ def get_n_half_words_per_connection(self) -> int: def get_weight_half_word(self) -> int: """ The index of the half-word where the weight should be written. - - :rtype: int """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/abstract_timing_dependence.py b/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/abstract_timing_dependence.py index 0ee103f5342..305a96fe06a 100644 --- a/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/abstract_timing_dependence.py +++ b/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/abstract_timing_dependence.py @@ -41,8 +41,7 @@ def is_same_as( """ Determine if this timing dependence is the same as another. - :param AbstractTimingDependence timing_dependence: - :rtype: bool + :param timing_dependence: """ raise NotImplementedError @@ -51,8 +50,6 @@ def is_same_as( def vertex_executable_suffix(self) -> str: """ The suffix to be appended to the vertex executable for this rule. - - :rtype: str """ raise NotImplementedError @@ -61,8 +58,6 @@ def vertex_executable_suffix(self) -> str: def pre_trace_n_bytes(self) -> int: """ The number of bytes used by the pre-trace of the rule per neuron. - - :rtype: int """ raise NotImplementedError @@ -70,8 +65,6 @@ def pre_trace_n_bytes(self) -> int: def get_parameters_sdram_usage_in_bytes(self) -> int: """ Get the amount of SDRAM used by the parameters of this rule. - - :rtype: int """ raise NotImplementedError @@ -80,8 +73,6 @@ def get_parameters_sdram_usage_in_bytes(self) -> int: def n_weight_terms(self) -> int: """ The number of weight terms expected by this timing rule. - - :rtype: int """ raise NotImplementedError @@ -92,10 +83,9 @@ def write_parameters( """ Write the parameters of the rule to the spec. - :param ~data_specification.DataSpecificationGenerator spec: - The specification to write to - :param float global_weight_scale: The weight scale applied globally - :param list(float) synapse_weight_scales: + :param spec: The specification to write to + :param global_weight_scale: The weight scale applied globally + :param synapse_weight_scales: The total weight scale applied to each synapse including the global weight scale """ @@ -105,8 +95,6 @@ def write_parameters( def synaptic_structure(self) -> AbstractSynapseStructure: """ The synaptic structure of the plastic part of the rows. - - :rtype: AbstractSynapseStructure """ return self.__synapse_structure @@ -115,8 +103,6 @@ def synaptic_structure(self) -> AbstractSynapseStructure: def A_plus(self) -> float: r""" :math:`A^+` - - :rtype: float """ # pylint: disable=invalid-name raise NotImplementedError @@ -126,8 +112,6 @@ def A_plus(self) -> float: def A_minus(self) -> float: r""" :math:`A^-` - - :rtype: float """ # pylint: disable=invalid-name raise NotImplementedError diff --git a/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_pfister_spike_triplet.py b/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_pfister_spike_triplet.py index 79915e33130..288fa1f525a 100644 --- a/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_pfister_spike_triplet.py +++ b/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_pfister_spike_triplet.py @@ -59,12 +59,12 @@ def __init__( self, tau_plus: float, tau_minus: float, tau_x: float, tau_y: float, A_plus: float, A_minus: float): r""" - :param float tau_plus: :math:`\tau_+` - :param float tau_minus: :math:`\tau_-` - :param float tau_x: :math:`\tau_x` - :param float tau_y: :math:`\tau_y` - :param float A_plus: :math:`A^+` - :param float A_minus: :math:`A^-` + :param tau_plus: :math:`\tau_+` + :param tau_minus: :math:`\tau_-` + :param tau_x: :math:`\tau_x` + :param tau_y: :math:`\tau_y` + :param A_plus: :math:`A^+` + :param A_minus: :math:`A^-` """ super().__init__(SynapseStructureWeightOnly()) self.__tau_plus = tau_plus @@ -84,8 +84,6 @@ def __init__( def tau_plus(self) -> float: r""" :math:`\tau_+` - - :rtype: float """ return self.__tau_plus @@ -93,8 +91,6 @@ def tau_plus(self) -> float: def tau_minus(self) -> float: r""" :math:`\tau_-` - - :rtype: float """ return self.__tau_minus @@ -102,8 +98,6 @@ def tau_minus(self) -> float: def tau_x(self) -> float: r""" :math:`\tau_x` - - :rtype: float """ return self.__tau_x @@ -111,8 +105,6 @@ def tau_x(self) -> float: def tau_y(self) -> float: r""" :math:`\tau_y` - - :rtype: float """ return self.__tau_y @@ -120,8 +112,6 @@ def tau_y(self) -> float: def A_plus(self) -> float: r""" :math:`A^+` - - :rtype: float """ return self.__a_plus @@ -133,8 +123,6 @@ def A_plus(self, new_value: float) -> None: def A_minus(self) -> float: r""" :math:`A^-` - - :rtype: float """ return self.__a_minus @@ -157,8 +145,6 @@ def is_same_as(self, timing_dependence: AbstractTimingDependence) -> bool: def vertex_executable_suffix(self) -> str: """ The suffix to be appended to the vertex executable for this rule. - - :rtype: str """ return "pfister_triplet" @@ -166,8 +152,6 @@ def vertex_executable_suffix(self) -> str: def pre_trace_n_bytes(self) -> int: """ The number of bytes used by the pre-trace of the rule per neuron. - - :rtype: int """ # Triplet rule trace entries consists of two 16-bit traces - R1 and R2 # (Note: this is the pre-trace size, not the post-trace size) @@ -184,8 +168,6 @@ def get_parameters_sdram_usage_in_bytes(self) -> int: def n_weight_terms(self) -> int: """ The number of weight terms expected by this timing rule. - - :rtype: int """ return 2 diff --git a/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_recurrent.py b/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_recurrent.py index 03218c37729..bf56d716a87 100644 --- a/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_recurrent.py +++ b/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_recurrent.py @@ -58,13 +58,13 @@ def __init__( dual_fsm: bool = True, A_plus: float = 0.01, A_minus: float = 0.01): """ - :param int accumulator_depression: - :param int accumulator_potentiation: - :param float mean_pre_window: - :param float mean_post_window: - :param bool dual_fsm: - :param float A_plus: :math:`A^+` - :param float A_minus: :math:`A^-` + :param accumulator_depression: + :param accumulator_potentiation: + :param mean_pre_window: + :param mean_post_window: + :param dual_fsm: + :param A_plus: :math:`A^+` + :param A_minus: :math:`A^-` """ super().__init__(SynapseStructureWeightAccumulator()) self.__accumulator_depression_plus_one = accumulator_depression + 1 @@ -80,8 +80,6 @@ def __init__( def A_plus(self) -> float: r""" :math:`A^+` - - :rtype: float """ return self.__a_plus @@ -93,8 +91,6 @@ def A_plus(self, new_value: float) -> None: def A_minus(self) -> float: r""" :math:`A^-` - - :rtype: float """ return self.__a_minus @@ -122,8 +118,6 @@ def _character(self) -> object: def vertex_executable_suffix(self) -> str: """ The suffix to be appended to the vertex executable for this rule. - - :rtype: str """ if self.__dual_fsm: return "recurrent_dual_fsm" @@ -133,8 +127,6 @@ def vertex_executable_suffix(self) -> str: def pre_trace_n_bytes(self) -> int: """ The number of bytes used by the pre-trace of the rule per neuron. - - :rtype: int """ # When using the separate FSMs, pre-trace contains window length, # otherwise it's in the synapse @@ -151,8 +143,6 @@ def get_parameters_sdram_usage_in_bytes(self) -> int: def n_weight_terms(self) -> int: """ The number of weight terms expected by this timing rule. - - :rtype: int """ return 1 @@ -178,10 +168,6 @@ def write_parameters( @staticmethod def _write_exp_dist_lut(spec: DataSpecificationBase, mean: float) -> None: - """ - :param .DataSpecificationGenerator spec: - :param float mean: - """ indices = numpy.arange(STDP_FIXED_POINT_ONE) inv_cdf = numpy.log(1.0 - indices/float(STDP_FIXED_POINT_ONE)) * -mean spec.write_array( diff --git a/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_spike_pair.py b/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_spike_pair.py index d9631ac434b..7e502d20949 100644 --- a/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_spike_pair.py +++ b/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_spike_pair.py @@ -49,10 +49,10 @@ def __init__( self, tau_plus: float = 20.0, tau_minus: float = 20.0, A_plus: float = 0.01, A_minus: float = 0.01): r""" - :param float tau_plus: :math:`\tau_+` - :param float tau_minus: :math:`\tau_-` - :param float A_plus: :math:`A^+` - :param float A_minus: :math:`A^-` + :param tau_plus: :math:`\tau_+` + :param tau_minus: :math:`\tau_-` + :param A_plus: :math:`A^+` + :param A_minus: :math:`A^-` """ super().__init__(SynapseStructureWeightOnly()) self.__tau_plus = tau_plus @@ -69,8 +69,6 @@ def __init__( def tau_plus(self) -> float: r""" :math:`\tau_+` - - :rtype: float """ return self.__tau_plus @@ -78,8 +76,6 @@ def tau_plus(self) -> float: def tau_minus(self) -> float: r""" :math:`\tau_-` - - :rtype: float """ return self.__tau_minus @@ -87,8 +83,6 @@ def tau_minus(self) -> float: def A_plus(self) -> float: r""" :math:`A^+` - - :rtype: float """ return self.__a_plus @@ -100,8 +94,6 @@ def A_plus(self, new_value: float) -> None: def A_minus(self) -> float: r""" :math:`A^-` - - :rtype: float """ return self.__a_minus @@ -121,8 +113,6 @@ def is_same_as( def vertex_executable_suffix(self) -> str: """ The suffix to be appended to the vertex executable for this rule. - - :rtype: str """ return "pair" @@ -130,8 +120,6 @@ def vertex_executable_suffix(self) -> str: def pre_trace_n_bytes(self) -> int: """ The number of bytes used by the pre-trace of the rule per neuron. - - :rtype: int """ # Pair rule requires no pre-synaptic trace when only the nearest # Neighbours are considered and, a single 16-bit R1 trace @@ -146,8 +134,6 @@ def get_parameters_sdram_usage_in_bytes(self) -> int: def n_weight_terms(self) -> int: """ The number of weight terms expected by this timing rule. - - :rtype: int """ return 1 diff --git a/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_vogels_2011.py b/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_vogels_2011.py index b16cba49efb..8717182279f 100644 --- a/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_vogels_2011.py +++ b/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_vogels_2011.py @@ -48,10 +48,10 @@ class TimingDependenceVogels2011(AbstractTimingDependence): def __init__(self, alpha: float, tau: float = 20.0, A_plus: float = 0.01, A_minus: float = 0.01): r""" - :param float alpha: :math:`\alpha` - :param float tau: :math:`\tau` - :param float A_plus: :math:`A^+` - :param float A_minus: :math:`A^-` + :param alpha: :math:`\alpha` + :param tau: :math:`\tau` + :param A_plus: :math:`A^+` + :param A_minus: :math:`A^-` """ super().__init__(SynapseStructureWeightOnly()) self.__alpha = alpha @@ -66,8 +66,6 @@ def __init__(self, alpha: float, tau: float = 20.0, def alpha(self) -> float: r""" :math:`\alpha` - - :rtype: float """ return self.__alpha @@ -75,8 +73,6 @@ def alpha(self) -> float: def tau(self) -> float: r""" :math:`\tau` - - :rtype: float """ return self.__tau @@ -84,8 +80,6 @@ def tau(self) -> float: def A_plus(self) -> float: r""" :math:`A^+` - - :rtype: float """ return self.__a_plus @@ -97,8 +91,6 @@ def A_plus(self, new_value: float) -> None: def A_minus(self) -> float: r""" :math:`A^-` - - :rtype: float """ return self.__a_minus @@ -117,8 +109,6 @@ def is_same_as(self, timing_dependence: AbstractTimingDependence) -> bool: def vertex_executable_suffix(self) -> str: """ The suffix to be appended to the vertex executable for this rule. - - :rtype: str """ return "vogels_2011" @@ -126,8 +116,6 @@ def vertex_executable_suffix(self) -> str: def pre_trace_n_bytes(self) -> int: """ The number of bytes used by the pre-trace of the rule per neuron. - - :rtype: int """ # Trace entries consist of a single 16-bit number return BYTES_PER_SHORT @@ -140,8 +128,6 @@ def get_parameters_sdram_usage_in_bytes(self) -> int: def n_weight_terms(self) -> int: """ The number of weight terms expected by this timing rule. - - :rtype: int """ return 1 diff --git a/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/abstract_has_a_plus_a_minus.py b/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/abstract_has_a_plus_a_minus.py index 50fc4230f0a..79874d1a441 100644 --- a/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/abstract_has_a_plus_a_minus.py +++ b/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/abstract_has_a_plus_a_minus.py @@ -31,8 +31,8 @@ def set_a_plus_a_minus(self, a_plus: float, a_minus: float) -> None: """ Set the values of :math:`A^+` and :math:`A^-`. - :param float a_plus: :math:`A^+` - :param float a_minus: :math:`A^-` + :param a_plus: :math:`A^+` + :param a_minus: :math:`A^-` """ self.__a_plus = a_plus self.__a_minus = a_minus @@ -41,8 +41,6 @@ def set_a_plus_a_minus(self, a_plus: float, a_minus: float) -> None: def A_plus(self) -> float: """ Settable model parameter: :math:`A^+` - - :rtype: float """ # pylint: disable=invalid-name return self.__a_plus @@ -56,8 +54,6 @@ def A_plus(self, new_value: float) -> None: def A_minus(self) -> float: """ Settable model parameter: :math:`A^-` - - :rtype: float """ # pylint: disable=invalid-name return self.__a_minus diff --git a/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/abstract_weight_dependence.py b/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/abstract_weight_dependence.py index 18063af2a2f..4b436ba0116 100644 --- a/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/abstract_weight_dependence.py +++ b/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/abstract_weight_dependence.py @@ -32,8 +32,7 @@ def is_same_as( """ Determine if this weight dependence is the same as another. - :param AbstractWeightDependence weight_dependence: - :rtype: bool + :param weight_dependence: """ raise NotImplementedError @@ -42,8 +41,6 @@ def is_same_as( def vertex_executable_suffix(self) -> str: """ The suffix to be appended to the vertex executable for this rule. - - :rtype: str """ raise NotImplementedError @@ -53,9 +50,8 @@ def get_parameters_sdram_usage_in_bytes( """ Get the amount of SDRAM used by the parameters of this rule. - :param int n_synapse_types: - :param int n_weight_terms: - :rtype: int + :param n_synapse_types: + :param n_weight_terms: """ raise NotImplementedError @@ -67,13 +63,12 @@ def write_parameters( """ Write the parameters of the rule to the spec. - :param ~data_specification.DataSpecificationGenerator spec: - The specification to write to - :param float global_weight_scale: The weight scale applied globally - :param list(float) synapse_weight_scales: + :param spec: The specification to write to + :param global_weight_scale: The weight scale applied globally + :param synapse_weight_scales: The total weight scale applied to each synapse including the global weight scale - :param int n_weight_terms: The number of terms used by the synapse rule + :param n_weight_terms: The number of terms used by the synapse rule """ raise NotImplementedError @@ -83,7 +78,5 @@ def weight_maximum(self) -> float: """ The maximum weight that will ever be set in a synapse as a result of this rule. - - :rtype: float """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/weight_dependence_additive.py b/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/weight_dependence_additive.py index 18b14b560e4..563b965292d 100644 --- a/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/weight_dependence_additive.py +++ b/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/weight_dependence_additive.py @@ -43,8 +43,8 @@ class WeightDependenceAdditive( # noinspection PyPep8Naming def __init__(self, w_min: float = 0.0, w_max: float = 1.0): """ - :param float w_min: :math:`w^{min}` - :param float w_max: :math:`w^{max}` + :param w_min: :math:`w^{min}` + :param w_max: :math:`w^{max}` """ super().__init__() self.__w_min = w_min @@ -54,8 +54,6 @@ def __init__(self, w_min: float = 0.0, w_max: float = 1.0): def w_min(self) -> float: """ :math:`w^{min}` - - :rtype: float """ return self.__w_min @@ -63,8 +61,6 @@ def w_min(self) -> float: def w_max(self) -> float: """ :math:`w^{max}` - - :rtype: float """ return self.__w_max @@ -82,8 +78,6 @@ def is_same_as(self, weight_dependence: AbstractWeightDependence) -> bool: def vertex_executable_suffix(self) -> str: """ The suffix to be appended to the vertex executable for this rule. - - :rtype: str """ return "additive" @@ -126,8 +120,6 @@ def weight_maximum(self) -> float: """ The maximum weight that will ever be set in a synapse as a result of this rule. - - :rtype: float """ return self.__w_max diff --git a/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/weight_dependence_additive_triplet.py b/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/weight_dependence_additive_triplet.py index f4ad7cb707d..4215b2fa031 100644 --- a/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/weight_dependence_additive_triplet.py +++ b/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/weight_dependence_additive_triplet.py @@ -46,10 +46,10 @@ def __init__( self, w_min: float = 0.0, w_max: float = 1.0, A3_plus: float = 0.01, A3_minus: float = 0.01): """ - :param float w_min: :math:`w^{min}` - :param float w_max: :math:`w^{max}` - :param float A3_plus: :math:`A_3^+` - :param float A3_minus: :math:`A_3^-` + :param w_min: :math:`w^{min}` + :param w_max: :math:`w^{max}` + :param A3_plus: :math:`A_3^+` + :param A3_minus: :math:`A_3^-` """ super().__init__() self.__w_min = w_min @@ -61,8 +61,6 @@ def __init__( def w_min(self) -> float: """ :math:`w^{min}` - - :rtype: float """ return self.__w_min @@ -70,8 +68,6 @@ def w_min(self) -> float: def w_max(self) -> float: """ :math:`w^{max}` - - :rtype: float """ return self.__w_max @@ -79,8 +75,6 @@ def w_max(self) -> float: def A3_plus(self) -> float: """ :math:`A_3^+` - - :rtype: float """ # pylint: disable=invalid-name return self.__a3_plus @@ -89,8 +83,6 @@ def A3_plus(self) -> float: def A3_minus(self) -> float: """ :math:`A_3^-` - - :rtype: float """ # pylint: disable=invalid-name return self.__a3_minus @@ -111,8 +103,6 @@ def is_same_as(self, weight_dependence: AbstractWeightDependence) -> bool: def vertex_executable_suffix(self) -> str: """ The suffix to be appended to the vertex executable for this rule. - - :rtype: str """ return "additive" @@ -159,8 +149,6 @@ def weight_maximum(self) -> float: """ The maximum weight that will ever be set in a synapse as a result of this rule. - - :rtype: float """ return self.__w_max diff --git a/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/weight_dependence_multiplicative.py b/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/weight_dependence_multiplicative.py index ea2eadd727d..cba4826a614 100644 --- a/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/weight_dependence_multiplicative.py +++ b/spynnaker/pyNN/models/neuron/plasticity/stdp/weight_dependence/weight_dependence_multiplicative.py @@ -41,8 +41,8 @@ class WeightDependenceMultiplicative( def __init__(self, w_min: float = 0.0, w_max: float = 1.0): """ - :param float w_min: :math:`w^{min}` - :param float w_max: :math:`w^{max}` + :param w_min: :math:`w^{min}` + :param w_max: :math:`w^{max}` """ super().__init__() self.__w_min = w_min @@ -52,8 +52,6 @@ def __init__(self, w_min: float = 0.0, w_max: float = 1.0): def w_min(self) -> float: """ :math:`w^{min}` - - :rtype: float """ return self.__w_min @@ -61,8 +59,6 @@ def w_min(self) -> float: def w_max(self) -> float: """ :math:`w^{max}` - - :rtype: float """ return self.__w_max @@ -80,8 +76,6 @@ def is_same_as(self, weight_dependence: AbstractWeightDependence) -> bool: def vertex_executable_suffix(self) -> str: """ The suffix to be appended to the vertex executable for this rule. - - :rtype: str """ return "multiplicative" @@ -118,8 +112,6 @@ def weight_maximum(self) -> float: """ The maximum weight that will ever be set in a synapse as a result of this rule. - - :rtype: float """ return self.__w_max diff --git a/spynnaker/pyNN/models/populations/population.py b/spynnaker/pyNN/models/populations/population.py index da4c005f174..ed309b44a0a 100644 --- a/spynnaker/pyNN/models/populations/population.py +++ b/spynnaker/pyNN/models/populations/population.py @@ -88,23 +88,18 @@ def __init__( additional_parameters: Optional[_ParamDict] = None, **additional_kwargs: _ParamDict): """ - :param int size: The number of neurons in the population + :param size: The number of neurons in the population :param cellclass: The implementation of the individual neurons. - :type cellclass: type or AbstractPyNNModel :param cellparams: Parameters to pass to ``cellclass`` if it is a class to instantiate. Must be ``None`` if ``cellclass`` is an instantiated object. - :type cellparams: dict(str,object) or None - :param ~pyNN.space.BaseStructure structure: - :param dict(str,float) initial_values: - Initial values of state variables - :param str label: A label for the population + :param structure: + :param initial_values: Initial values of state variables + :param label: A label for the population :param additional_parameters: Additional parameters to pass to the vertex creation function. - :type additional_parameters: dict(str, ...) :param additional_kwargs: A nicer way of allowing additional things - :type additional_kwargs: dict(str, ...) """ # Deal with the kwargs! additional: _ParamDict = dict() @@ -171,8 +166,6 @@ def all(self) -> Iterator[PopulationView]: def annotations(self) -> Dict[str, Any]: """ The annotations given by the end user. - - :rtype: dict(str, ...) """ return self.__annotations @@ -184,7 +177,6 @@ def celltype(self) -> AbstractPyNNModel: :return: The cell type this property has been set to, or the vertex if it was directly instantiated. - :rtype: AbstractPyNNModel """ return self.__celltype @@ -192,8 +184,7 @@ def can_record(self, variable: str) -> bool: """ Determine whether `variable` can be recorded from this population. - :param str variable: The variable to answer the question about - :rtype: bool + :param variable: The variable to answer the question about """ return variable in self.__vertex.get_recordable_variables() @@ -208,10 +199,8 @@ def sample(self, n: int, rng: Optional[NumpyRNG] = None) -> PopulationView: Randomly sample `n` cells from the Population, and return a PopulationView object. - :param int n: The number of cells to put in the view. + :param n: The number of cells to put in the view. :param rng: The random number generator to use - :type rng: ~pyNN.random.NumpyRNG - :rtype: ~spynnaker.pyNN.models.populations.PopulationView """ if not rng: rng = NumpyRNG() @@ -253,10 +242,8 @@ def describe(self, template: str = 'population_default.txt', If ``template`` is ``None``, then a dictionary containing the template context will be returned. - :param str template: Template filename + :param template: Template filename :param engine: Template substitution engine - :type engine: str or ~pyNN.descriptions.TemplateEngine or None - :rtype: str or dict """ context: Dict[str, Any] = { "label": self.label, @@ -307,19 +294,16 @@ def get_data( :param variables: either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised. - :type variables: str or list(str) - :param bool gather: Whether to collect data from all MPI nodes or + :param gather: 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. - :param bool clear: + :param clear: Whether recorded data will be deleted from the ``Assembly``. :param annotations: annotations to put on the neo block - :type annotations: dict(str, ...) - :rtype: ~neo.core.Block :raises \ ~spinn_front_end_common.utilities.exceptions.ConfigurationException: If the variable or variables have not been previously set to @@ -336,13 +320,11 @@ def spinnaker_get_data( SsPyNNaker specific method for getting data as a numpy array, instead of the Neo-based object - :param str variable: a single variable name. - :type variable: str or list(str) - :param bool as_matrix: If set True the data is returned as a 2d matrix + :param variable: a single variable name. + :param as_matrix: If set True the data is returned as a 2d matrix :param view_indexes: The indexes for which data should be returned. If ``None``, all data (view_index = data_indexes) :return: array of the data - :rtype: ~numpy.ndarray """ warn_once( logger, "spinnaker_get_data is non-standard PyNN and therefore " @@ -355,8 +337,6 @@ def spinnaker_get_data( def get_spike_counts(self, gather: bool = True) -> Dict[int, int]: """ Return the number of spikes for each neuron. - - :rtype: ~numpy.ndarray """ self._check_params(gather) with NeoBufferDatabase() as db: @@ -366,9 +346,8 @@ def find_units(self, variable: str) -> str: """ Get the units of a variable. - :param str variable: The name of the variable + :param variable: The name of the variable :return: The units of the variable - :rtype: str """ return self.__vertex.get_units(variable) @@ -430,8 +409,6 @@ def initial_values(self) -> ParameterHolder: These values will be the same as the values set with the last call to initialize rather than the actual initial values if this call has been made. - - :rtype: ParameterHolder """ SpynnakerDataView.check_user_can_act() return self.__vertex.get_initial_state_values( @@ -469,8 +446,6 @@ def set_state(self, **kwargs: Values) -> None: def current_values(self) -> ParameterHolder: """ Get the current values of the state variables. - - :rtype: ParameterHolder """ SpynnakerDataView.check_user_can_act() warn_once( @@ -500,9 +475,6 @@ def positions(self, positions: NDArray[numpy.floating]) -> None: @property @overrides(PopulationBase.all_cells) def all_cells(self) -> List[IDMixin]: - """ - :rtype: list(IDMixin) - """ return [IDMixin(self, _id) for _id in range(self.__size)] @property @@ -514,8 +486,6 @@ def position_generator(self) -> Callable[[int], NDArray[numpy.floating]]: def first_id(self) -> int: """ The ID of the first member of the population. - - :rtype: int """ return self.__first_id @@ -523,8 +493,6 @@ def first_id(self) -> int: def last_id(self) -> int: """ The ID of the last member of the population. - - :rtype: int """ return self.__last_id @@ -535,9 +503,6 @@ def _vertex(self) -> PopulationApplicationVertex: @property def _recorder(self) -> Recorder: - """ - :rtype: Recorder - """ return self.__recorder @property @@ -549,8 +514,6 @@ def _view_range(self) -> Tuple[int, int]: def conductance_based(self) -> bool: """ Whether the population uses conductance inputs - - :rtype: bool """ return self.__vertex.conductance_based @@ -561,13 +524,11 @@ def get(self, parameter_names: Names, :param parameter_names: Name of parameter. This is either a single string or a list of strings - :type parameter_names: str or iterable(str) - :param bool gather: pointless on sPyNNaker - :param bool simplify: ignored + :param gather: pointless on sPyNNaker + :param simplify: ignored :return: A single list of values (or possibly a single value) if paramter_names is a string, or a dict of these if parameter names is a list. - :rtype: ParameterHolder """ self._check_params(gather) if simplify is not True: @@ -595,8 +556,6 @@ def id_to_index(self, id: Union[int, Iterable[int]] https://neuralensemble.org/docs/PyNN/reference/populations.html :param id: - :type id: int or iterable(int) - :rtype: int or iterable(int) """ # pylint: disable=redefined-builtin if not numpy.iterable(id): @@ -623,8 +582,6 @@ def index_to_id(self, index: Union[int, Iterable[int]] Population, return their ID(s) :param index: - :type index: int or iterable(int) - :rtype: int or iterable(int) """ if not numpy.iterable(index): index = cast(int, index) @@ -646,8 +603,6 @@ def id_to_local_index(self, cell_id: Union[int, Iterable[int]]) -> Never: https://neuralensemble.org/docs/PyNN/reference/populations.html :param cell_id: - :type cell_id: int or iterable(int) - :rtype: int or iterable(int) """ raise NotImplementedError( "sPyNNaker does not currently do id_to_local_index") @@ -673,8 +628,6 @@ def __len__(self) -> int: def label(self) -> str: """ The label of the population. - - :rtype: str """ return self.__vertex.label or "" # Should never be empty @@ -688,8 +641,6 @@ def label(self, label: str) -> Never: def structure(self) -> Optional[BaseStructure]: """ The structure for the population. - - :rtype: ~pyNN.space.BaseStructure or None """ return self.__structure @@ -699,9 +650,9 @@ def add_placement_constraint( """ Add a placement constraint. - :param int x: The x-coordinate of the placement constraint - :param int y: The y-coordinate of the placement constraint - :param int p: The processor ID of the placement constraint (optional) + :param x: The x-coordinate of the placement constraint + :param y: The y-coordinate of the placement constraint + :param p: The processor ID of the placement constraint (optional) :raises SimulatorRunningException: If `sim.run` is currently running :raises SimulatorNotSetupException: If called before `sim.setup` :raises SimulatorShutdownException: If called after `sim.end` @@ -735,8 +686,6 @@ def set_max_atoms_per_core( def size(self) -> int: """ The number of neurons in the population. - - :rtype: int """ return self.__vertex.n_atoms @@ -746,12 +695,9 @@ def __create_model( cell_params: Optional[_ParamDict]) -> _CellType: """ :param cell_class: The implementation of the individual neurons. - :type cell_class: type or AbstractPyNNModel or ApplicationVertex :param cell_params: Parameters to pass to ``cell_class`` if it is a class to instantiate. Must be ``None`` if ``cell_class`` is an instantiated object. - :type cell_params: dict(str,object) or None - :rtype: ApplicationVertex or AbstractPyNNModel """ if inspect.isclass(cell_class): if cell_params is None: @@ -814,13 +760,10 @@ def __create_vertex( additional_parameters: _ParamDict) -> None: """ :param model: The implementation of the individual neurons. - :type model: ApplicationVertex or AbstractPyNNModel - :param int size: + :param size: :param label: - :type label: str or None :param additional_parameters: Additional parameters to pass to the vertex creation function. - :type additional_parameters: dict(str, ...) """ # Use a provided model to create a vertex if isinstance(model, AbstractPyNNModel): @@ -847,12 +790,9 @@ def create( Create ``n`` cells all of the same type. :param cellclass: see :py:meth:`~.Population.__init__` - :type cellclass: type or AbstractPyNNModel :param cellparams: see :py:meth:`~.Population.__init__` - :type cellparams: dict(str, object) or None - :param int n: see :py:meth:`~.Population.__init__` (``size`` parameter) + :param n: see :py:meth:`~.Population.__init__` (``size`` parameter) :return: A New Population - :rtype: ~spynnaker.pyNN.models.populations.Population """ return Population(size=n, cellclass=cellclass, cellparams=cellparams) diff --git a/spynnaker/pyNN/models/populations/population_base.py b/spynnaker/pyNN/models/populations/population_base.py index 7be0f477148..1fb39a436fb 100644 --- a/spynnaker/pyNN/models/populations/population_base.py +++ b/spynnaker/pyNN/models/populations/population_base.py @@ -54,8 +54,6 @@ def local_cells(self) -> Sequence[IDMixin]: """ An array containing the cell IDs of those neurons in the Population that exist on the local MPI node. - - :rtype: list(int) """ logger.warning("local calls do not really make sense on sPyNNaker so " "local_cells just returns all_cells") @@ -67,8 +65,6 @@ def all_cells(self) -> Sequence[IDMixin]: """ An array containing the cell IDs of all neurons in the Population (all MPI nodes). - - :rtype: list(int) """ raise NotImplementedError @@ -81,8 +77,7 @@ def __add__(self, other: PopulationBase) -> Never: # pylint: disable=W0613 .. warning:: Currently unimplemented. - :param PopulationBase other: - :rtype: Assembly + :param other: """ raise NotImplementedError("sPyNNaker does not support Assemblies") @@ -99,8 +94,7 @@ def get_data( Either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised. - :type variables: str or list(str) - :param bool gather: For parallel simulators, if this is True, all data + :param gather: 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. @@ -108,11 +102,9 @@ def get_data( .. note:: SpiNNaker always gathers. - :param bool clear: + :param clear: If this is True, recorded data will be deleted from the Population. :param annotations: annotations to put on the neo block - :type annotations: None or dict(str, ...) - :rtype: ~neo.core.Block """ raise NotImplementedError @@ -123,7 +115,7 @@ def get_spike_counts(self, gather: bool = True) -> Dict[int, int]: The dict keys are neuron IDs, not indices. - :param bool gather: + :param gather: 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 @@ -131,8 +123,6 @@ def get_spike_counts(self, gather: bool = True) -> Dict[int, int]: .. note:: SpiNNaker always gathers. - - :rtype: dict(int, int) """ raise NotImplementedError @@ -141,8 +131,6 @@ def inject(self, current_source: NeuronCurrentSource) -> None: Connect a current source to all cells in the Population. :param current_source: - :type current_source: - ~pyNN.neuron.standardmodels.electrodes.NeuronCurrentSource """ raise NotImplementedError @@ -151,8 +139,6 @@ def is_local(self, id: int) -> bool: # @ReservedAssignment """ Indicates whether the cell with the given ID exists on the local MPI node. - - :rtype: bool """ # pylint: disable=redefined-builtin _ = id @@ -165,8 +151,6 @@ def is_local(self, id: int) -> bool: # @ReservedAssignment def local_size(self) -> int: """ The number of cells in the population on the local MPI node. - - :rtype: int """ logger.warning("local calls do not really make sense on sPyNNaker so " "is_local always returns size") @@ -180,7 +164,7 @@ def mean_spike_count(self, gather: bool = True) -> float: """ Returns the mean number of spikes per neuron. - :param bool gather: + :param gather: 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 @@ -188,8 +172,6 @@ def mean_spike_count(self, gather: bool = True) -> float: .. note:: SpiNNaker always gathers. - - :rtype: float """ if not gather: warn_once( @@ -226,7 +208,6 @@ def positions(self) -> NDArray[floating]: :return: a 3xN array - :rtype: ~numpy.ndarray """ raise NotImplementedError @@ -241,13 +222,11 @@ def write_data(self, io: Union[str, neo.baseio.BaseIO], :param io: a Neo IO instance, or a string for where to put a Neo instance - :type io: ~neo.io or ~neo.rawio or str :param variables: either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised. - :type variables: str or list(str) - :param bool gather: For parallel simulators, if this is True, all data + :param gather: 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. This is pointless on @@ -256,10 +235,9 @@ def write_data(self, io: Union[str, neo.baseio.BaseIO], .. note:: SpiNNaker always gathers. - :param bool clear: + :param clear: clears the storage data if set to true after reading it back :param annotations: annotations to put on the Neo block - :type annotations: None or dict(str, ...) """ raise NotImplementedError @@ -286,8 +264,7 @@ def record(self, variables: Names, to_file: IoDest = None, a list of variables that can be recorded for that `celltype`. :param to_file: a file to automatically record to (optional). `write_data()` will be automatically called when `end()` is called. - :type to_file: ~neo.io or ~neo.rawio or str - :param int sampling_interval: a value in milliseconds, and an integer + :param sampling_interval: a value in milliseconds, and an integer multiple of the simulation timestep. """ raise NotImplementedError @@ -308,8 +285,6 @@ def save_positions(self, file: Any) -> Never: # pylint: disable=W0622 def structure(self) -> Optional[BaseStructure]: """ The spatial structure of the parent Population. - - :rtype: ~pyNN.space.BaseStructure """ raise NotImplementedError @@ -318,8 +293,6 @@ def structure(self) -> Optional[BaseStructure]: def _vertex(self) -> ApplicationVertex: """ The underlying application vertex. - - :rtype: ~pacman.model.graphs.application.ApplicationVertex """ raise NotImplementedError @@ -336,8 +309,6 @@ def _view_range(self) -> Tuple[int, int]: def _recorder(self) -> Recorder: """ The recorder of the population. - - :rtype: ~Recorder """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/populations/population_view.py b/spynnaker/pyNN/models/populations/population_view.py index c12e7017098..8756b41d7fb 100644 --- a/spynnaker/pyNN/models/populations/population_view.py +++ b/spynnaker/pyNN/models/populations/population_view.py @@ -84,10 +84,8 @@ def __init__( selector: Selector, label: Optional[str] = None): """ :param parent: the population or view to make the view from - :type parent: ~spynnaker.pyNN.models.populations.Population or - ~spynnaker.pyNN.models.populations.PopulationView - :param PopulationApplicationVertex vertex: The actual underlying vertex - :param Recorder recorder: The recorder of the Population + :param vertex: The actual underlying vertex + :param recorder: The recorder of the Population :param selector: a slice or numpy mask array. The mask array should either be a Boolean array (ideally) of the same size as the parent, @@ -140,8 +138,6 @@ def __setattr__(self, name: str, value: Values) -> None: def size(self) -> int: """ The total number of neurons in the Population View. - - :rtype: int """ return len(self.__indexes) @@ -149,8 +145,6 @@ def size(self) -> int: def label(self) -> str: """ A label for the Population View. - - :rtype: str """ return self.__label @@ -158,8 +152,6 @@ def label(self) -> str: def celltype(self) -> AbstractPyNNModel: """ The type of neurons making up the underlying Population. - - :rtype: AbstractPyNNModel """ return self.__parent.celltype @@ -167,8 +159,6 @@ def celltype(self) -> AbstractPyNNModel: def initial_values(self) -> ParameterHolder: """ A dict containing the initial values of the state variables. - - :rtype: InitialValuesHolder """ return self.__vertex.get_initial_state_values( self.__vertex.get_state_variables(), self.__indexes) @@ -177,8 +167,6 @@ def initial_values(self) -> ParameterHolder: def current_values(self) -> ParameterHolder: """ A dict containing the current values of the state variables. - - :rtype: InitialValuesHolder """ warn_once( logger, "current_values is non-standard PyNN and therefore " @@ -190,8 +178,6 @@ def current_values(self) -> ParameterHolder: def parent(self) -> Union[Population, 'PopulationView']: """ A reference to the parent Population (that this is a view of). - - :rtype: ~spynnaker.pyNN.models.populations.Population """ return self.__parent @@ -208,8 +194,6 @@ def all_cells(self) -> Sequence['IDMixin']: """ An array containing the cell IDs of all neurons in the Population (all MPI nodes). - - :rtype: list(IDMixin) """ return [IDMixin(self.__population, idx) for idx in self.__indexes] @@ -240,8 +224,6 @@ def __getitem__(self, index: Union[ ``p = Population(...)`` then ``p[2]`` is equivalent to ``p.__getitem__(2)``, and ``p[3:6]`` is equivalent to ``p.__getitem__(slice(3, 6))`` - - :rtype: IDMixin or ~.PopulationView """ if isinstance(index, int): return IDMixin(self.__population, index) @@ -250,8 +232,6 @@ def __getitem__(self, index: Union[ def __iter__(self) -> Iterator['IDMixin']: """ Iterator over cell IDs (on the local node). - - :rtype: iterable(IDMixin) """ for idx in self.__indexes: yield IDMixin(self.__population, idx) @@ -259,8 +239,6 @@ def __iter__(self) -> Iterator['IDMixin']: def __len__(self) -> int: """ Return the total number of cells in the population (all nodes). - - :rtype: int """ return len(self.__indexes) @@ -284,8 +262,6 @@ def all(self) -> Iterator[IDMixin]: def can_record(self, variable: str) -> bool: """ Determine whether variable can be recorded from this population. - - :rtype: bool """ return variable in self.__vertex.get_recordable_variables() @@ -294,8 +270,6 @@ def conductance_based(self) -> bool: """ Whether the post-synaptic response is modelled as a change in conductance or a change in current. - - :rtype: bool """ return self.__vertex.conductance_based @@ -304,7 +278,7 @@ def inject(self, current_source: AbstractCurrentSource) -> None: """ Injects the specified current_source into this PopulationView. - :param AbstractCurrentSource current_source: + :param current_source: the current source to be injected """ self.__vertex.inject(current_source, self.__indexes) @@ -320,10 +294,8 @@ def describe(self, template: str = 'populationview_default.txt', If template is ``None``, then a dictionary containing the template context will be returned. - :param str template: Template filename + :param template: Template filename :param engine: Template substitution engine - :type engine: str or ~pyNN.descriptions.TemplateEngine or None - :rtype: str or dict """ context = {"label": self.label, "parent": self.parent.label, @@ -339,9 +311,8 @@ def find_units(self, variable: str) -> str: .. warning:: No PyNN description of this method. - :param str variable: The name of the variable + :param variable: The name of the variable :return: The units of the variable - :rtype: str """ return self.__vertex.get_units(variable) @@ -358,10 +329,8 @@ def get(self, parameter_names: Names, SpiNNaker always gathers. :param parameter_names: - :type parameter_names: str or list(str) - :param bool gather: - :param bool simplify: - :rtype: ParameterHolder + :param gather: + :param simplify: """ if not gather: logger.warning("SpiNNaker only supports gather=True. We will run " @@ -384,8 +353,7 @@ def get_data( :param variables: Either a single variable name or a list of variable names. Variables must have been previously recorded, otherwise an Exception will be raised. - :type variables: str or list(str) - :param bool gather: For parallel simulators, if gather is True, all + :param gather: For parallel simulators, if gather 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 @@ -394,11 +362,9 @@ def get_data( .. note:: SpiNNaker always gathers. - :param bool clear: + :param clear: If True, recorded data will be deleted from the Population. :param annotations: annotations to put on the neo block - :type annotations: dict(str, ...) - :rtype: ~neo.core.Block :raises \ ~spinn_front_end_common.utilities.exceptions.ConfigurationException: If the variable or variables have not been previously set to @@ -421,10 +387,9 @@ def spinnaker_get_data( SsPyNNaker specific method for getting data as a numpy array, instead of the Neo-based object - :param str variable: a single variable name - :param bool as_matrix: If set True the data is returned as a 2d matrix + :param variable: a single variable name + :param as_matrix: If set True the data is returned as a 2d matrix :return: array of the data - :rtype: ~numpy.ndarray """ return self.__population.spinnaker_get_data( variable, as_matrix, self.__indexes) @@ -444,8 +409,6 @@ def grandparent(self) -> Population: The name "grandparent" is of course a little misleading, as it could be just the parent, or the great, great, great, ..., grandparent. - - :rtype: ~spynnaker.pyNN.models.populations.Population """ return self.__population @@ -469,8 +432,6 @@ def id_to_index( assert pv.id_to_index(pv[3]) == 3 :param id: - :type id: int or list(int) - :rtype: int or list(int) """ if isinstance(id, int): return self.__indexes.index(id) @@ -481,8 +442,7 @@ def index_in_grandparent(self, indices: Iterable[int]) -> List[int]: Given an array of indices, return the indices in the parent population at the root of the tree. - :param list(int) indices: - :rtype: list(int) + :param indices: """ return [self.__indexes[index] for index in indices] @@ -556,9 +516,8 @@ def sample( Randomly sample `n` cells from the Population view, and return a new PopulationView object. - :param int n: The number of cells to select - :param ~pyNN.random.NumpyRNG rng: Random number generator - :rtype: ~spynnaker.pyNN.models.populations.PopulationView + :param n: The number of cells to select + :param rng: Random number generator """ if not rng: rng = NumpyRNG() @@ -665,8 +624,6 @@ class IDMixin(PopulationView): def get_parameters(self) -> ParameterHolder: """ Return a dict of all cell parameters. - - :rtype: dict(str, ...) """ return self._vertex.get_parameter_values( self._vertex.get_parameters(), self.id) @@ -675,7 +632,7 @@ def get_parameters(self) -> ParameterHolder: @property def id(self) -> int: """ - :rtype: int + The lowest index in thos view """ return self._indexes[0] @@ -694,8 +651,7 @@ def get_initial_value(self, variable: str) -> ParameterHolder: """ Get the initial value of a state variable of the cell. - :param str variable: The name of the variable - :rtype: float + :param variable: The name of the variable """ return self._vertex.get_initial_state_values(variable, self.id) @@ -708,8 +664,8 @@ def set_initial_value(self, variable: str, value: Values) -> None: """ Set the initial value of a state variable of the cell. - :param str variable: The name of the variable - :param float value: The value of the variable + :param variable: The name of the variable + :param value: The value of the variable """ self._vertex.set_initial_state_values(variable, value, self.id) @@ -723,8 +679,6 @@ def set_parameters(self, **parameters: Values) -> None: def as_view(self) -> PopulationView: """ Return a PopulationView containing just this cell. - - :rtype: ~spynnaker.pyNN.models.populations.PopulationView """ return self @@ -732,8 +686,6 @@ def as_view(self) -> PopulationView: def local(self) -> bool: """ Whether this cell is local to the current MPI node. - - :rtype: bool """ # There are no MPI nodes! return True diff --git a/spynnaker/pyNN/random_distribution.py b/spynnaker/pyNN/random_distribution.py index f4c6d5e28b5..428f28f6aa1 100644 --- a/spynnaker/pyNN/random_distribution.py +++ b/spynnaker/pyNN/random_distribution.py @@ -80,15 +80,12 @@ def __init__( # pylint: disable=useless-super-delegation self, distribution: str, parameters_pos: Optional[tuple] = None, rng: Optional[NumpyRNG] = None, **parameters_named: float): """ - :param str distribution: the name of a random number distribution. + :param distribution: the name of a random number distribution. :param parameters_pos: parameters of the distribution, provided as a tuple. For the correct ordering, see `random.available_distributions`. - :type parameters_pos: tuple or None :param rng: the random number generator to use, if a specific one is desired (e.g., to provide a seed). - :type rng: ~pyNN.random.NumpyRNG or ~pyNN.random.GSLRNG or - ~pyNN.random.NativeRNG or None :param parameters_named: parameters of the distribution, provided as keyword arguments. diff --git a/spynnaker/pyNN/setup_pynn.py b/spynnaker/pyNN/setup_pynn.py index fabbcb3b4e9..8d6e09ffc3f 100644 --- a/spynnaker/pyNN/setup_pynn.py +++ b/spynnaker/pyNN/setup_pynn.py @@ -36,10 +36,9 @@ def version_satisfies(module: ModuleType, requirement: str) -> bool: """ Perform a version check. This code could be smarter... - :param ~types.ModuleType module: - :param str requirement: + :param module: + :param requirement: :return: Whether the module's version satisfies the given requirement - :rtype: bool """ return Version(module.__version__) >= Version(requirement) @@ -49,7 +48,7 @@ def install_spynnaker_into(module: ModuleType) -> None: Do the actual installation by creating a package within the given module's implementation. This is very nasty! - :param ~types.ModuleType module: + :param module: """ _file = module.__file__ assert _file is not None diff --git a/spynnaker/pyNN/spinnaker.py b/spynnaker/pyNN/spinnaker.py index e58717faa91..c1a05df7bd8 100644 --- a/spynnaker/pyNN/spinnaker.py +++ b/spynnaker/pyNN/spinnaker.py @@ -77,22 +77,18 @@ def __init__( :param time_scale_factor: multiplicative factor to the machine time step (does not affect the neuron models accuracy) - :type time_scale_factor: int or None :param min_delay: :param n_chips_required: Deprecated! Use n_boards_required instead. Must be `None` if n_boards_required specified. - :type n_chips_required: int or None :param n_boards_required: if you need to be allocated a machine (for spalloc) before building your graph, then fill this in with a general idea of the number of boards you need so that the spalloc system can allocate you a machine big enough for your needs. - :type n_boards_required: int or None :param timestep: the time step of the simulations in microseconds; if `None` the cfg value is used - :type timestep: float or None """ # change min delay auto to be the min delay supported by simulator if min_delay == "auto": @@ -139,8 +135,7 @@ def _clear_and_run(self, run_time: Optional[float], Clears the projections and Run the model created. :param run_time: the time (in milliseconds) to run the simulation for - :type run_time: float or int or None - :param float sync_time: + :param sync_time: If not 0, this specifies that the simulation should pause after this duration. The continue_simulation() method must then be called for the simulation to continue. @@ -191,7 +186,6 @@ def state(self) -> 'SpiNNaker': Used to bypass the dual level object. :return: the SpiNNaker object - :rtype: ~spynnaker.pyNN.SpiNNaker """ return self @@ -204,7 +198,6 @@ def mpi_rank(self) -> int: Meaningless on SpiNNaker, so we pretend we're the head node. :return: Constant: 0 - :rtype: int """ return 0 @@ -243,7 +236,6 @@ def dt(self) -> float: The simulation time step in milliseconds. :return: the machine time step - :rtype: float """ return self.__writer.get_simulation_time_step_ms() @@ -263,7 +255,6 @@ def t(self) -> float: The current simulation time in milliseconds. :return: the current runtime already executed - :rtype: float """ return self.__writer.get_current_run_time_ms() @@ -273,7 +264,6 @@ def segment_counter(self) -> int: The number of the current recording segment being generated. :return: the segment counter - :rtype: int """ return self.__writer.get_reset_number() @@ -294,7 +284,6 @@ def name(self) -> str: blocks are correctly labelled. :return: the name of the simulator. - :rtype: str """ return _version.NAME @@ -304,7 +293,6 @@ def recorders(self) -> Collection[Recorder]: The recorders, used by the PyNN state object. :return: the internal recorders object - :rtype: list(~spynnaker.pyNN.models.recorder.Recorder) """ return self.__recorders @@ -323,11 +311,8 @@ def _set_up_timings( time_scale_factor: Optional[int]) -> None: """ :param timestep: machine_time_Step in milliseconds - :type timestep: float or None :param min_delay: - :type min_delay: int or float or None :param time_scale_factor: - :type time_scale_factor: int or None """ # Get the standard values diff --git a/spynnaker/pyNN/spynnaker_external_device_plugin_manager.py b/spynnaker/pyNN/spynnaker_external_device_plugin_manager.py index 94a5d836ebe..80831a5bc14 100644 --- a/spynnaker/pyNN/spynnaker_external_device_plugin_manager.py +++ b/spynnaker/pyNN/spynnaker_external_device_plugin_manager.py @@ -49,14 +49,11 @@ def add_database_socket_address( """ :param database_notify_host: Host to talk to tell that the database (and application) is ready. - :type database_notify_host: str or None :param database_notify_port_num: Port to talk to tell that the database (and application) is ready. - :type database_notify_port_num: int or None :param database_ack_port_num: Port on which to listen for an acknowledgement that the simulation should start. - :type database_ack_port_num: int or None """ # build the database socket address used by the notification interface database_socket = SocketAddress( @@ -88,56 +85,53 @@ def activate_live_output_for( Output the spikes from a given population from SpiNNaker as they occur in the simulation. - :param ~spynnaker.pyNN.models.populations.Population population: - The population to activate the live output for - :param str database_notify_host: + :param population: The population to activate the live output for + :param database_notify_host: The hostname for the device which is listening to the database notification. - :param int database_ack_port_num: + :param database_ack_port_num: The port number to which a external device will acknowledge that they have finished reading the database and are ready for it to start execution - :param int database_notify_port_num: + :param database_notify_port_num: The port number to which a external device will receive the database is ready command :param key_prefix: the prefix to be applied to the key - :type key_prefix: int or None - :param ~spinnman.messages.eieio.EIEIOPrefix prefix_type: + :param prefix_type: if the prefix type is 32 bit or 16 bit - :param ~spinnman.messages.eieio.EIEIOType message_type: + :param message_type: If the message is a EIEIO command message, or an EIEIO data message with 16 bit or 32 bit keys. - :param bool payload_as_time_stamps: - :param int right_shift: - :param bool use_payload_prefix: - :param bool notify: + :param payload_as_time_stamps: + :param right_shift: + :param use_payload_prefix: + :param notify: :param payload_prefix: - :type payload_prefix: int or None - :param int payload_right_shift: - :param int number_of_packets_sent_per_time_step: - :param int port: + :param payload_right_shift: + :param number_of_packets_sent_per_time_step: + :param port: The UDP port to which the live spikes will be sent. If not specified, the port will be taken from the "live_spike_port" parameter in the "Recording" section of the sPyNNaker configuration file. - :param str host: + :param host: The host name or IP address to which the live spikes will be sent. If not specified, the host will be taken from the "live_spike_host" parameter in the "Recording" section of the sPyNNaker configuration file. - :param int tag: + :param tag: The IP tag to be used for the spikes. If not specified, one will be automatically assigned - :param bool strip_sdp: + :param strip_sdp: Determines if the SDP headers will be stripped from the transmitted packet. - :param bool use_prefix: + :param use_prefix: Determines if the spike packet will contain a common prefix for the spikes - :param str label: The label of the gatherer vertex - :param list(str) partition_ids: + :param label: The label of the gatherer vertex + :param partition_ids: The names of the partitions to create edges for - :param bool translate_keys: + :param translate_keys: Whether the incoming keys from the cores should be translated to global keys rather than core-based keys """ @@ -190,15 +184,12 @@ def activate_live_output_to( .. note:: All spikes will be sent to the device. - :param ~spynnaker.pyNN.models.populations.Population population: + :param population: The pyNN population object from which spikes will be sent. :param device: The pyNN population or external device to which the spikes will be sent. - :type device: - ~spynnaker.pyNN.models.populations.Population or - ~pacman.model.graphs.application.ApplicationVertex - :param str partition_id: + :param partition_id: The partition ID to activate live output to. """ # pylint: disable=protected-access @@ -220,14 +211,9 @@ def update_live_packet_gather_tracker( packet gatherer if needed. :param vertex_to_record_from: - :type vertex_to_record_from: - ~pacman.model.graphs.application.ApplicationVertex or - ~pacman.model.graphs.machine.MachineVertex :param params: - :type params: - ~spinn_front_end_common.utilities.utility_objs.LivePacketGatherParameters - :param list(str) partition_ids: - :param bool translate_keys: + :param partition_ids: + :param translate_keys: """ # add to the tracker SpynnakerDataView.add_live_packet_gatherer_parameters( @@ -246,22 +232,20 @@ def add_poisson_live_rate_control( Add a live rate controller to a Poisson population. :param poisson_population: The population to control - :type poisson_population: - ~spynnaker.pyNN.models.populations.Population - :param str control_label_extension: + :param control_label_extension: An extension to add to the label of the Poisson source. Must match up with the equivalent in the SpynnakerPoissonControlConnection - :param int receive_port: + :param receive_port: The port that the SpiNNaker board should listen on - :param str database_notify_host: the hostname for the device which is + :param database_notify_host: the hostname for the device which is listening to the database notification. - :param int database_ack_port_num: the port number to which a external + :param database_ack_port_num: the port number to which a external device will acknowledge that they have finished reading the database and are ready for it to start execution - :param int database_notify_port_num: The port number to which an + :param database_notify_port_num: The port number to which an external device will receive the database is ready command - :param bool notify: adds to the notification protocol if set. - :param bool reserve_reverse_ip_tag: True if a reverse IP tag is to be + :param notify: adds to the notification protocol if set. + :param reserve_reverse_ip_tag: True if a reverse IP tag is to be used, False if SDP is to be used (default) """ # pylint: disable=protected-access @@ -289,13 +273,11 @@ def add_edge(vertex: ApplicationVertex, device_vertex: ApplicationVertex, Add an edge between two vertices (often a vertex and a external device) on a given partition. - :param ~pacman.model.graphs.application.ApplicationVertex vertex: + :param vertex: the pre-population vertex to connect the edge from :param device_vertex: the post-population vertex to connect the edge to - :type device_vertex: - ~pacman.model.graphs.application.ApplicationVertex - :param str partition_id: the partition identifier for making nets + :param partition_id: the partition identifier for making nets """ edge = ApplicationEdge(vertex, device_vertex) SpynnakerDataView.add_edge(edge, partition_id) @@ -308,6 +290,6 @@ def add_application_vertex(vertex: ApplicationVertex) -> None: Semantic sugar for SpynnakerDataView.add_vertex(vertex) - :param ApplicationVertex vertex: + :param vertex: """ SpynnakerDataView.add_vertex(vertex) diff --git a/spynnaker/spike_checker.py b/spynnaker/spike_checker.py index 4d917a0b769..304f81afd93 100644 --- a/spynnaker/spike_checker.py +++ b/spynnaker/spike_checker.py @@ -21,8 +21,7 @@ def synfire_spike_checker(spikes: Union[NDArray, List[NDArray]], n_neurons: int) -> None: """ :param spikes: The spike data to check. - :type spikes: ~numpy.ndarray or list(~numpy.ndarray) - :param int n_neurons: The number of neurons. + :param n_neurons: The number of neurons. :raises Exception: If there is a problem with the data """ if isinstance(spikes, numpy.ndarray): @@ -49,10 +48,9 @@ def synfire_multiple_lines_spike_checker( Checks that there are the expected number of spike lines :param spikes: The spikes - :type spikes: ~numpy.ndarray or list(~numpy.ndarray) - :param int n_neurons: The number of neurons. - :param int lines: Expected number of lines - :param bool wrap_around: + :param n_neurons: The number of neurons. + :param lines: Expected number of lines + :param wrap_around: If True the lines will wrap around when reaching the last neuron. :raises Exception: If there is a problem with the data """ diff --git a/spynnaker/spynnaker_plotting.py b/spynnaker/spynnaker_plotting.py index 8b032db6876..a0f89c088ca 100644 --- a/spynnaker/spynnaker_plotting.py +++ b/spynnaker/spynnaker_plotting.py @@ -49,8 +49,8 @@ def _handle_options(axes: Axes, options: Dict[str, Any]) -> None: axes.plot will throw an exception if it gets unwanted options - :param ~matplotlib.axes.Axes axes: An Axes in a matplotlib figure - :param dict options: All options the plotter can be configured with + :param axes: An Axes in a matplotlib figure + :param options: All options the plotter can be configured with """ if "xticks" not in options or options.pop("xticks") is False: plt.setp(axes.get_xticklabels(), visible=False) @@ -75,10 +75,10 @@ def _plot_spikes(axes: Axes, spike_times: NDArray, neurons: NDArray, """ Plots the spikes based on two lists. - :param ~matplotlib.axes.Axes axes: An Axes in a matplotlib figure + :param axes: An Axes in a matplotlib figure :param spike_times: List of spike times :param neurons: List of Neuron IDs - :param str label: Label for the graph + :param label: Label for the graph :param options: plotting options """ if len(neurons): @@ -98,9 +98,9 @@ def plot_spiketrains( """ Plot all spike trains in a Segment in a raster plot. - :param ~matplotlib.axes.Axes axes: An Axes in a matplotlib figure - :param list(~neo.core.SpikeTrain) spiketrains: List of spike times - :param str label: Label for the graph + :param axes: An Axes in a matplotlib figure + :param spiketrains: List of spike times + :param label: Label for the graph :param options: plotting options """ axes.set_xlim(0, spiketrains[0].t_stop / quantities.ms) @@ -117,9 +117,9 @@ def plot_spikes_numpy(axes: Axes, spikes: NDArray, label: str = '', """ Plot all spikes. - :param ~matplotlib.axes.Axes axes: An Axes in a matplotlib figure - :param ~numpy.ndarray spikes: sPyNNaker7 format numpy array of spikes - :param str label: Label for the graph + :param axes: An Axes in a matplotlib figure + :param spikes: sPyNNaker7 format numpy array of spikes + :param label: Label for the graph :param options: plotting options """ _handle_options(axes, options) @@ -133,9 +133,9 @@ def _heat_plot(axes: Axes, values: NDArray, label: str = '', """ Plots three lists of neurons, times and values into a heat map. - :param ~matplotlib.axes.Axes axes: An Axes in a matplotlib figure + :param axes: An Axes in a matplotlib figure :param values: List of values to plot - :param str label: Label for the graph + :param label: Label for the graph :param options: plotting options """ _handle_options(axes, options) @@ -155,9 +155,9 @@ def heat_plot_numpy(axes: Axes, data: NDArray, label: str = '', """ Plots neurons, times and values into a heat map. - :param ~matplotlib.axes.Axes axes: An Axes in a matplotlib figure - :param ~numpy.ndarray data: numpy array of values in spynnaker7 format - :param str label: Label for the graph + :param axes: An Axes in a matplotlib figure + :param data: numpy array of values in spynnaker7 format + :param label: Label for the graph :param options: plotting options """ neurons = data[:, 0].astype(np.uint32) @@ -174,9 +174,9 @@ def heat_plot_neo(axes: Axes, signal_array: AnalogSignal, label: str = '', """ Plots neurons, times and values into a heat map. - :param ~matplotlib.axes.Axes axes: An Axes in a matplotlib figure - :param ~neo.core.AnalogSignal signal_array: Neo Signal array object - :param str label: Label for the graph + :param axes: An Axes in a matplotlib figure + :param signal_array: Neo Signal array object + :param label: Label for the graph :param options: plotting options """ if label is None: @@ -197,9 +197,9 @@ def plot_segment(axes: Axes, segment: Segment, label: str = '', Method signature defined by PyNN plotting. This allows mixing of this plotting tool and PyNN's - :param ~matplotlib.axes.Axes axes: An Axes in a matplotlib figure - :param ~neo.core.Segment segment: Data for one run to plot - :param str label: Label for the graph + :param axes: An Axes in a matplotlib figure + :param segment: Data for one run to plot + :param label: Label for the graph :param options: plotting options """ analogsignals = segment.analogsignals @@ -257,8 +257,6 @@ class SpynnakerPanel(object): def __init__(self, *data: TA_DATA, **options: Any): """ :param data: One or more data series to be plotted. - :type data: list(~neo.core.SpikeTrain) or ~neo.core.AnalogSignal - or ~numpy.ndarray or ~neo.core.Block or ~neo.core.Segment :param options: Any additional information. """ if _matplotlib_missing: @@ -272,7 +270,7 @@ def plot(self, axes: Axes) -> None: """ Plot the Panel's data in the provided Axes/Subplot instance. - :param ~matplotlib.axes.Axes axes: An Axes in a matplotlib figure + :param axes: An Axes in a matplotlib figure """ for datum, label, properties in zip(self.data, self.data_labels, self.line_properties): From 8a58c95ad1d1843a15ba039d24df0a3da4d6e316 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Wed, 25 Jun 2025 13:54:49 +0100 Subject: [PATCH 2/7] spellings --- spynnaker/pyNN/connections/spif_live_spikes_connection.py | 2 +- spynnaker/pyNN/models/populations/population_view.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spynnaker/pyNN/connections/spif_live_spikes_connection.py b/spynnaker/pyNN/connections/spif_live_spikes_connection.py index fcdc1583d22..3cdbbf5ff0b 100644 --- a/spynnaker/pyNN/connections/spif_live_spikes_connection.py +++ b/spynnaker/pyNN/connections/spif_live_spikes_connection.py @@ -149,7 +149,7 @@ def add_init_callback(self, label: str, init_callback: _INIT) -> None: """ Add a callback to be called to initialise a vertex. - :param abel: + :param label: The label of the vertex to be notified about. Must be one of the vertices listed in the constructor :param init_callback: A function to be called to initialise the diff --git a/spynnaker/pyNN/models/populations/population_view.py b/spynnaker/pyNN/models/populations/population_view.py index 8756b41d7fb..aae40a35c7a 100644 --- a/spynnaker/pyNN/models/populations/population_view.py +++ b/spynnaker/pyNN/models/populations/population_view.py @@ -632,7 +632,7 @@ def get_parameters(self) -> ParameterHolder: @property def id(self) -> int: """ - The lowest index in thos view + The lowest index in this view """ return self._indexes[0] From 6505b22e0a3e770ff26ab584d78f9174757dea81 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Wed, 25 Jun 2025 15:39:27 +0100 Subject: [PATCH 3/7] remove typing from docs --- spynnaker/pyNN/__init__.py | 13 +- .../spif_live_spikes_connection.py | 2 +- spynnaker/pyNN/external_devices/__init__.py | 2 +- ...ernal_spinnaker_link_fpga_retina_device.py | 1 - .../abstract_push_bot_output_device.py | 2 +- .../external_devices_models/spif_devices.py | 5 +- .../spif_input_device.py | 13 +- .../spif_output_device.py | 4 +- .../spif_retina_device.py | 4 - ...threshold_type_multicast_device_control.py | 2 +- ...bstract_supports_one_to_one_sdram_input.py | 3 +- ...tter_population_vertex_neurons_synapses.py | 2 - spynnaker/pyNN/models/abstract_pynn_model.py | 20 +-- .../models/common/multi_spike_recorder.py | 2 +- .../pyNN/models/common/neuron_recorder.py | 8 +- .../common/population_application_vertex.py | 1 - .../connectors/abstract_connector.py | 1 - .../connectors/from_file_connector.py | 1 - .../pyNN/models/neuron/connection_holder.py | 2 - .../pyNN/models/neuron/generator_data.py | 4 - .../pyNN/models/neuron/master_pop_table.py | 116 ++++++------------ spynnaker/pyNN/models/neuron/neuron_data.py | 53 ++++---- ...tion_machine_local_only_combined_vertex.py | 39 +++--- .../neuron/population_machine_neurons.py | 43 ++----- spynnaker/pyNN/models/projection.py | 82 ++++--------- spynnaker/pyNN/models/recorder.py | 39 ++---- spynnaker/pyNN/spinnaker.py | 3 +- ...pynnaker_external_device_plugin_manager.py | 2 - unittests/test_doc_checker.py | 37 ++++++ 29 files changed, 191 insertions(+), 315 deletions(-) create mode 100644 unittests/test_doc_checker.py diff --git a/spynnaker/pyNN/__init__.py b/spynnaker/pyNN/__init__.py index 1f38898f6b0..396c2c9f796 100644 --- a/spynnaker/pyNN/__init__.py +++ b/spynnaker/pyNN/__init__.py @@ -252,7 +252,7 @@ def distance(src_cell: IDMixin, tgt_cell: IDMixin, :param scale_factor: allows for different units in the pre- and post-position (the post-synaptic position is multiplied by this quantity). - :param float offset: + :param offset: :param periodic_boundaries: """ return _pynn_distance( @@ -275,31 +275,22 @@ def setup(timestep: Optional[Union[float, Literal["auto"]]] = None, :param timestep: the time step of the simulations in microseconds; if `None`, the configuration value is used - :type timestep: float or None :param min_delay: the minimum delay of the simulation - :type min_delay: float or str :param max_delay: Ignored and logs a warning if provided - :type max_delay: float or str or None :param database_socket_addresses: the sockets used by external devices for the database notification protocol - :type database_socket_addresses: - iterable(~spinn_utilities.socket_address.SocketAddress) :param time_scale_factor: multiplicative factor to the machine time step (does not affect the neuron models accuracy) - :type time_scale_factor: int or None :param n_chips_required: Deprecated! Use n_boards_required instead. Must be `None` if n_boards_required specified. - :type n_chips_required: int or None :param n_boards_required: if you need to be allocated a machine (for spalloc) before building your graph, then fill this in with a general idea of the number of boards you need so that the spalloc system can allocate you a machine big enough for your needs. - :type n_boards_required: int or None :param extra_params: other keyword arguments used to configure PyNN :return: MPI rank (always 0 on SpiNNaker) - :rtype: int :raises \ ~spinn_front_end_common.utilities.exceptions.ConfigurationException: if both ``n_chips_required`` and ``n_boards_required`` are used. @@ -662,7 +653,7 @@ def record(variables: Union[str, Sequence[str]], source: PopulationBase, variable names. For a given `celltype` class, `celltype.recordable` contains a list of variables that can be recorded for that `celltype`. :param source: where to record from - :param str filename: file name to write data to + :param filename: file name to write data to :param sampling_interval: how often to sample the recording, not ignored so far :param annotations: the annotations to data writers diff --git a/spynnaker/pyNN/connections/spif_live_spikes_connection.py b/spynnaker/pyNN/connections/spif_live_spikes_connection.py index 3cdbbf5ff0b..d9c426e9fb6 100644 --- a/spynnaker/pyNN/connections/spif_live_spikes_connection.py +++ b/spynnaker/pyNN/connections/spif_live_spikes_connection.py @@ -135,7 +135,7 @@ def __init__(self, receive_labels: Optional[Iterable[str]], def add_receive_label(self, label: str) -> None: """ - :param str label: + :param label: """ if label not in self.__receive_labels: self.__receive_labels.append(label) diff --git a/spynnaker/pyNN/external_devices/__init__.py b/spynnaker/pyNN/external_devices/__init__.py index ce612ee0117..c04e49a66e9 100644 --- a/spynnaker/pyNN/external_devices/__init__.py +++ b/spynnaker/pyNN/external_devices/__init__.py @@ -212,7 +212,7 @@ def EthernetControlPopulation( control an external device which is connected to the host. :param n_neurons: The number of neurons in the control population - :param type model: + :param model: Class of a model that creates a vertex of type :py:class:`AbstractEthernetController` :param label: An optional label for the population diff --git a/spynnaker/pyNN/external_devices_models/external_spinnaker_link_fpga_retina_device.py b/spynnaker/pyNN/external_devices_models/external_spinnaker_link_fpga_retina_device.py index dff308d51fa..2541bed0e5c 100644 --- a/spynnaker/pyNN/external_devices_models/external_spinnaker_link_fpga_retina_device.py +++ b/spynnaker/pyNN/external_devices_models/external_spinnaker_link_fpga_retina_device.py @@ -134,7 +134,6 @@ def _get_mask(self, mode: str) -> int: def get_n_neurons(mode: str, polarity: str) -> int: """ :param mode: ``128`` or ``64`` or ``32`` or ``16`` - :param parity: ``UP`` or ``DOWN`` or ``MERGED`` """ if mode == ExternalFPGARetinaDevice.MODE_128: if (polarity == ExternalFPGARetinaDevice.UP_POLARITY or diff --git a/spynnaker/pyNN/external_devices_models/push_bot/abstract_push_bot_output_device.py b/spynnaker/pyNN/external_devices_models/push_bot/abstract_push_bot_output_device.py index 919b2160a59..2a39452eb12 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/abstract_push_bot_output_device.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/abstract_push_bot_output_device.py @@ -59,7 +59,7 @@ def max_value(self) -> Decimal: @property def time_between_send(self) -> int: """ - :rtype: int + Time between sends """ return self._time_between_send diff --git a/spynnaker/pyNN/external_devices_models/spif_devices.py b/spynnaker/pyNN/external_devices_models/spif_devices.py index c076de6d6cd..fc07159c8f9 100644 --- a/spynnaker/pyNN/external_devices_models/spif_devices.py +++ b/spynnaker/pyNN/external_devices_models/spif_devices.py @@ -444,9 +444,8 @@ def set_xp_key_delayed( """ Get a command to set the key of the output via the FPGA later. This tells the FPGA to route this key to the external device. - :param int index: The index of the channel to set (0-5) - :param callable(int)->int key_func: The function to call to get the key - :rtype: MulticastCommand + :param index: The index of the channel to set (0-5) + :param key_func: The function to call to get the key """ return SpiNNFPGARegister.XP_KEY_BASE.delayed_command(key_func, index) diff --git a/spynnaker/pyNN/external_devices_models/spif_input_device.py b/spynnaker/pyNN/external_devices_models/spif_input_device.py index ed737e9ea0d..aee43352a4f 100644 --- a/spynnaker/pyNN/external_devices_models/spif_input_device.py +++ b/spynnaker/pyNN/external_devices_models/spif_input_device.py @@ -150,18 +150,14 @@ def __init__(self, pipe: int, n_neurons: int, n_neurons_per_partition: int, def __is_power_of_2(self, v: int) -> bool: """ Determine if a value is a power of 2 - :param int v: The value to test - :rtype: bool + :param v: The value to test """ return (v & (v - 1) == 0) and (v != 0) def __incoming_fpgas( self, board_address: Optional[str], chip_coords: Optional[Tuple[int, int]]) -> List[FPGAConnection]: - """ Get the incoming FPGA connections - - :rtype: list(FPGAConnection) - """ + """ Get the incoming FPGA connections """ # We use every other odd link return [FPGAConnection(SPIF_FPGA_ID, i, board_address, chip_coords) for i in SPIF_INPUT_FPGA_LINKS] @@ -169,10 +165,7 @@ def __incoming_fpgas( def __outgoing_fpga( self, board_address: Optional[str], chip_coords: Optional[Tuple[int, int]]) -> FPGAConnection: - """ Get the outgoing FPGA connection (for commands) - - :rtype: FGPA_Connection - """ + """ Get the outgoing FPGA connection (for commands) """ return FPGAConnection( SPIF_FPGA_ID, SPIF_OUTPUT_FPGA_LINK, board_address, chip_coords) diff --git a/spynnaker/pyNN/external_devices_models/spif_output_device.py b/spynnaker/pyNN/external_devices_models/spif_output_device.py index 5908bb656ff..4a080bac75a 100644 --- a/spynnaker/pyNN/external_devices_models/spif_output_device.py +++ b/spynnaker/pyNN/external_devices_models/spif_output_device.py @@ -78,7 +78,7 @@ def __init__(self, board_address: Optional[str] = None, :param board_address: The board IP address of the SPIF device :param chip_coords: The chip coordinates of the SPIF device :param label: The label to give the SPIF device - :param bool create_database: + :param create_database: Whether the database will be used to decode keys or not :param database_notify_host: The host that will read the database :param database_notify_port_num: @@ -86,7 +86,7 @@ def __init__(self, board_address: Optional[str] = None, :param database_ack_port_num: The port to listen on for responses from the host reading the database - :param int output_key_shift: + :param output_key_shift: The shift to apply to the population indices when added to the key """ super(SPIFOutputDevice, self).__init__( diff --git a/spynnaker/pyNN/external_devices_models/spif_retina_device.py b/spynnaker/pyNN/external_devices_models/spif_retina_device.py index 7b9e646ba5a..49a3c8aa62d 100644 --- a/spynnaker/pyNN/external_devices_models/spif_retina_device.py +++ b/spynnaker/pyNN/external_devices_models/spif_retina_device.py @@ -187,8 +187,6 @@ def __incoming_fpgas( """ Get the incoming FPGA connections. - - :rtype: list(FPGAConnection) """ # We use every other odd link return [FPGAConnection(SPIF_FPGA_ID, i, board_address, chip_coords) @@ -199,8 +197,6 @@ def __outgoing_fpga( chip_coords: Optional[Tuple[int, int]]) -> FPGAConnection: """ Get the outgoing FPGA connection (for commands). - - :rtype: FGPA_Connection """ return FPGAConnection( SPIF_FPGA_ID, SPIF_OUTPUT_FPGA_LINK, board_address, chip_coords) diff --git a/spynnaker/pyNN/external_devices_models/threshold_type_multicast_device_control.py b/spynnaker/pyNN/external_devices_models/threshold_type_multicast_device_control.py index 8f50b1e5cad..d0b0b52bba3 100644 --- a/spynnaker/pyNN/external_devices_models/threshold_type_multicast_device_control.py +++ b/spynnaker/pyNN/external_devices_models/threshold_type_multicast_device_control.py @@ -43,7 +43,7 @@ class ThresholdTypeMulticastDeviceControl(AbstractThresholdType): def __init__(self, devices: Sequence[AbstractMulticastControllableDevice]): """ - :param device: + :param devices: """ super().__init__( [Struct([ diff --git a/spynnaker/pyNN/extra_algorithms/splitter_components/abstract_supports_one_to_one_sdram_input.py b/spynnaker/pyNN/extra_algorithms/splitter_components/abstract_supports_one_to_one_sdram_input.py index b6b4d117206..69c54ecb4b8 100644 --- a/spynnaker/pyNN/extra_algorithms/splitter_components/abstract_supports_one_to_one_sdram_input.py +++ b/spynnaker/pyNN/extra_algorithms/splitter_components/abstract_supports_one_to_one_sdram_input.py @@ -28,7 +28,6 @@ def handles_source_vertex(self, projection: Projection) -> bool: Determine if the source vertex of the given projection is to be handled by the target splitter. - :param Projection projection: The projection to check the source of - :rtype: bool + :param projection: The projection to check the source of """ raise NotImplementedError diff --git a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex_neurons_synapses.py b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex_neurons_synapses.py index 09d8dddb9b7..2e1b7e45f72 100644 --- a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex_neurons_synapses.py +++ b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex_neurons_synapses.py @@ -611,8 +611,6 @@ def __shared_synapse_sdram( structural_sz: int, dynamics_sz: int) -> MultiRegionSDRAM: """ Get the SDRAM shared between synapse cores. - - :rtype: ~pacman.model.resources.MultiRegionSDRAM """ regions = PopulationSynapsesMachineVertexLead.SYNAPSE_REGIONS sdram = MultiRegionSDRAM() diff --git a/spynnaker/pyNN/models/abstract_pynn_model.py b/spynnaker/pyNN/models/abstract_pynn_model.py index 32f9a66c37f..fa76b1a99f4 100644 --- a/spynnaker/pyNN/models/abstract_pynn_model.py +++ b/spynnaker/pyNN/models/abstract_pynn_model.py @@ -46,7 +46,7 @@ def verify_may_set(cls, param: str) -> None: exception; used to avoid setting global limits after a Population has been created. - :param str param: + :param param: The parameter name that can be used to set the value being changed in the Population constructor instead. """ @@ -122,8 +122,6 @@ def absolute_max_atoms_per_core( # pylint: disable=no-self-argument The absolute maximum number of atoms per core. This is an integer regardless of the number of dimensions in any vertex. - - :rtype: int """ return sys.maxsize @@ -131,8 +129,6 @@ def absolute_max_atoms_per_core( # pylint: disable=no-self-argument def get_parameter_names(cls) -> Sequence[str]: """ Get the names of the parameters of the model. - - :rtype: list(str) """ return cls.default_parameters.keys() # pylint: disable=no-member @@ -141,8 +137,7 @@ def has_parameter(cls, name: str) -> bool: """ Determine if the model has a parameter with the given name. - :param str name: The name of the parameter to check for - :rtype: bool + :param name: The name of the parameter to check for """ return name in cls.default_parameters @@ -165,10 +160,9 @@ def create_vertex( """ Create a vertex for a population of the model. - :param int n_neurons: The number of neurons in the population - :param str label: The label to give to the vertex + :param n_neurons: The number of neurons in the population + :param label: The label to give to the vertex :return: An application vertex for the population - :rtype: PopulationApplicationVertex """ raise NotImplementedError @@ -176,8 +170,6 @@ def create_vertex( def name(self) -> str: """ The name of this model. - - :rtype: str """ return self.__class__.__name__ @@ -193,10 +185,8 @@ def describe(self, template: Optional[str] = 'modeltype_default.txt', If ``template`` is ``None``, then a dictionary containing the template context will be returned. - :param str template: Template filename + :param template: Template filename :param engine: Template substitution engine - :type engine: str or ~pyNN.descriptions.TemplateEngine or None - :rtype: str or dict """ context = { "name": self.name diff --git a/spynnaker/pyNN/models/common/multi_spike_recorder.py b/spynnaker/pyNN/models/common/multi_spike_recorder.py index d963cbcc0f4..090dbb4b9d9 100644 --- a/spynnaker/pyNN/models/common/multi_spike_recorder.py +++ b/spynnaker/pyNN/models/common/multi_spike_recorder.py @@ -34,7 +34,7 @@ def __init__(self) -> None: @property def record(self) -> bool: """ - :rtype: bool + If this recorder is recording or not """ return self.__record diff --git a/spynnaker/pyNN/models/common/neuron_recorder.py b/spynnaker/pyNN/models/common/neuron_recorder.py index 21444890f1a..59b61c82487 100644 --- a/spynnaker/pyNN/models/common/neuron_recorder.py +++ b/spynnaker/pyNN/models/common/neuron_recorder.py @@ -58,9 +58,8 @@ def get_sampling_interval(sampling_rate: float) -> float: """ Return the current sampling interval given a sampling rate. - :param float sampling_rate: The sampling rate in time steps + :param sampling_rate: The sampling rate in time steps :return: Sampling interval in microseconds - :rtype: float """ return sampling_rate * SpynnakerDataView.get_simulation_time_step_ms() @@ -366,8 +365,7 @@ def get_sampling_interval_ms(self, variable: str) -> float: """ Get the sampling interval of a variable. - :param str variable: The variable to get the sampling interval of - :rtype: float + :param variable: The variable to get the sampling interval of """ if (variable in self.__per_timestep_variables or variable in self.__events_per_core_variables): @@ -439,7 +437,7 @@ def is_recordable(self, variable: str) -> bool: @property def recording_variables(self) -> Iterable[str]: """ - :rtype: iterable(str) + Names of the variables recording """ for variable, rate in self.__sampling_rates.items(): if rate > 0: diff --git a/spynnaker/pyNN/models/common/population_application_vertex.py b/spynnaker/pyNN/models/common/population_application_vertex.py index 69b82652bc1..cda1ba561d8 100644 --- a/spynnaker/pyNN/models/common/population_application_vertex.py +++ b/spynnaker/pyNN/models/common/population_application_vertex.py @@ -101,7 +101,6 @@ def get_parameter_values( :param selector: a description of the subrange to accept, or ``None`` for all. See: :py:meth:`~spinn_utilities.ranged.AbstractSized.selector_to_ids` - :rtype: ParameterHolder :raise KeyError: if the parameter is not something that can be read """ raise KeyError( diff --git a/spynnaker/pyNN/models/neural_projections/connectors/abstract_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/abstract_connector.py index 34d6b2dc23c..e8b8fc20870 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/abstract_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/abstract_connector.py @@ -278,7 +278,6 @@ def get_n_connections_to_post_vertex_maximum( in the post vertex from neurons in the pre vertex. :param SynapseInformation synapse_info: - :rtype: int """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neural_projections/connectors/from_file_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/from_file_connector.py index bd16190486e..f7b14fe257c 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/from_file_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/from_file_connector.py @@ -112,6 +112,5 @@ def get_reader(self, file: str) -> BaseFile: # @ReservedAssignment Get a file reader object using the PyNN methods. :return: A pynn StandardTextFile or similar - :rtype: ~pyNN.recording.files.StandardTextFile """ return StandardTextFile(file, mode="r") diff --git a/spynnaker/pyNN/models/neuron/connection_holder.py b/spynnaker/pyNN/models/neuron/connection_holder.py index b51cfcba014..9a1b5297cc4 100644 --- a/spynnaker/pyNN/models/neuron/connection_holder.py +++ b/spynnaker/pyNN/models/neuron/connection_holder.py @@ -125,8 +125,6 @@ def add_connections(self, connections: ConnectionsArray) -> None: def connections(self) -> List[ConnectionsArray]: """ The connections stored. - - :rtype: list(~numpy.ndarray) """ return self.__connections or [] diff --git a/spynnaker/pyNN/models/neuron/generator_data.py b/spynnaker/pyNN/models/neuron/generator_data.py index ff65cba7be1..d5dd06dd144 100644 --- a/spynnaker/pyNN/models/neuron/generator_data.py +++ b/spynnaker/pyNN/models/neuron/generator_data.py @@ -93,8 +93,6 @@ def __init__( def size(self) -> int: """ The size of the generated data, in bytes. - - :rtype: int """ return sum(len(i) for i in self.__data) * BYTES_PER_WORD @@ -102,7 +100,5 @@ def size(self) -> int: def gen_data(self) -> Sequence[NDArray[uint32]]: """ The data to be written for this connection. - - :rtype: list(~numpy.ndarray(~numpy.uint32)) """ return self.__data diff --git a/spynnaker/pyNN/models/neuron/master_pop_table.py b/spynnaker/pyNN/models/neuron/master_pop_table.py index d908cd1df85..56ff170f41f 100644 --- a/spynnaker/pyNN/models/neuron/master_pop_table.py +++ b/spynnaker/pyNN/models/neuron/master_pop_table.py @@ -54,9 +54,8 @@ def _n_bits(field: ctypes._CField) -> int: """ Get the number of bits in a field (ctypes doesn't do this). - :param _ctypes.CField field: a ctype field from a structure + :param field: a ctype field from a structure :return: the number of bits - :rtype: int """ # ctypes stores the number of bits in a bitfield in the top 16 bits; # if it isn't a bitfield, this is 0 @@ -74,10 +73,9 @@ def _make_array(ctype: Type[_T], n_items: int) -> ctypes.Array[_T]: Make an array of ctype items; done separately as the syntax is a little odd! - :param _ctypes.PyCSimpleType ctype: A ctype - :param int n_items: The number of items in the array + :param ctype: A ctype + :param n_items: The number of items in the array :return: a ctype array - :rtype: _ctypes.PyCArrayType """ array_type = ctype * n_items # type: ignore return array_type() # type: ignore @@ -159,8 +157,7 @@ def _to_numpy(array: ctypes.Array) -> NDArray[uint32]: No data copying is done; it is pure type conversion. Editing the returned array will result in changes to the original. - :param _ctypes.PyCArrayType array: The array to convert - :rtype: numpy.ndarray + :param array: The array to convert """ # Nothing to do if the array is 0 sized if len(array) == 0: @@ -193,12 +190,12 @@ class _MasterPopEntry(object): def __init__(self, routing_key: int, mask: int, core_mask: int, core_shift: int, n_neurons: int, n_colour_bits: int): """ - :param int routing_key: The key to match for this entry - :param int mask: The mask to match for this entry - :param int core_mask: + :param routing_key: The key to match for this entry + :param mask: The mask to match for this entry + :param core_mask: The part of the routing_key where the core id is held - :param int core_shift: Where in the routing_key the core_id is held - :param int n_neurons: + :param core_shift: Where in the routing_key the core_id is held + :param n_neurons: The number of neurons on each core, except the last """ self.__routing_key = routing_key @@ -213,10 +210,9 @@ def append(self, address: int, row_length: int) -> int: """ Add a synaptic matrix pointer to the entry. - :param int address: The address of the synaptic matrix - :param int row_length: The length of each row in the matrix + :param address: The address of the synaptic matrix + :param row_length: The length of each row in the matrix :return: The index of the pointer within the entry - :rtype: int """ index = len(self.__addresses_and_row_lengths) if index > _MAX_ADDRESS_COUNT: @@ -233,7 +229,6 @@ def append_invalid(self) -> int: between multiple entries when necessary. :return: The index of the marker within the entry - :rtype: int """ index = len(self.__addresses_and_row_lengths) self.__addresses_and_row_lengths.append((0, 0, False)) @@ -243,8 +238,6 @@ def append_invalid(self) -> int: def routing_key(self) -> int: """ The key combo of this entry. - - :rtype: int """ return self.__routing_key @@ -252,8 +245,6 @@ def routing_key(self) -> int: def mask(self) -> int: """ The mask of the key for this entry. - - :rtype: int """ return self.__mask @@ -261,8 +252,6 @@ def mask(self) -> int: def core_mask(self) -> int: """ The mask of the key once shifted to get the source core ID. - - :rtype: int """ return self.__core_mask @@ -270,8 +259,6 @@ def core_mask(self) -> int: def core_shift(self) -> int: """ The shift of the key to get the source core ID. - - :rtype: int """ return self.__core_shift @@ -279,8 +266,6 @@ def core_shift(self) -> int: def n_neurons(self) -> int: """ The number of neurons per source core. - - :rtype: int """ return self.__n_neurons @@ -289,8 +274,6 @@ def addresses_and_row_lengths(self) -> Sequence[Tuple[int, int, bool]]: """ The memory address that this master pop entry points at (in the synaptic matrix). - - :rtype: list(tuple(int,int,bool)) """ return self.__addresses_and_row_lengths @@ -301,13 +284,12 @@ def write_to_table( """ Write entries to the master population table. - :param _MasterPopEntryCType entry: The entry to write to - :param _AddressListEntryCType_Array address_list: + :param entry: The entry to write to + :param address_list: The address_list to write to - :param int start: + :param start: The index of the entry of the address list to start at :return: The number of entries written to the address list - :rtype: int """ entry.key = self.__routing_key entry.mask = self.__mask @@ -358,10 +340,7 @@ def get_master_population_table_size( :param incoming_projections: The projections arriving at the vertex that are to be handled by this table - :type incoming_projections: - list(~spynnaker.pyNN.models.projection.Projection) :return: the size the master pop table will take in SDRAM (in bytes) - :rtype: int """ # Count the pre-machine-vertices n_entries = 0 @@ -394,9 +373,8 @@ def get_allowed_row_length(row_length: int) -> int: """ Get the next allowed row length. - :param int row_length: the row length being considered + :param row_length: the row length being considered :return: the row length available - :rtype: int :raises SynapseRowTooBigException: If the row won't fit """ if row_length > POP_TABLE_MAX_ROW_LENGTH: @@ -411,9 +389,8 @@ def get_next_allowed_address(next_address: int) -> int: """ Get the next allowed address. - :param int next_address: The next address that would be used + :param next_address: The next address that would be used :return: The next address that can be used following next_address - :rtype: int :raises SynapticConfigurationException: if the address is out of range """ @@ -438,19 +415,18 @@ def add_application_entry( """ Add an entry for an application-edge to the population table. - :param int block_start_addr: where the synaptic matrix block starts - :param int row_length: how long in words each row is - :param ~pacman.model.routing_info.BaseKeyAndMask key_and_mask: + :param block_start_addr: where the synaptic matrix block starts + :param row_length: how long in words each row is + :param key_and_mask: the key and mask for this master pop entry - :param int core_mask: + :param core_mask: Mask for the part of the key that identifies the core - :param int core_shift: The shift of the mask to get to the core_mask - :param int n_neurons: + :param core_shift: The shift of the mask to get to the core_mask + :param n_neurons: The number of neurons in each machine vertex (bar the last) - :param int n_colour_bits: + :param n_colour_bits: The number of bits to use for colour :return: The index of the entry, to be used to retrieve it - :rtype: int :raises SynapticConfigurationException: If a bad address is used. """ @@ -477,18 +453,16 @@ def __update_master_population_table( """ Add an entry in the binary search to deal with the synaptic matrix. - :param int block_start_addr: where the synaptic matrix block starts - :param int row_length: how long in words each row is - :param ~pacman.model.routing_info.BaseKeyAndMask key_and_mask: - the key and mask for this master pop entry - :param int core_mask: + :param block_start_addr: where the synaptic matrix block starts + :param row_length: how long in words each row is + :param key_and_mask: the key and mask for this master pop entry + :param core_mask: Mask for the part of the key that identifies the core - :param int core_shift: The shift of the mask to get to the core_mask - :param int n_neurons: + :param core_shift: The shift of the mask to get to the core_mask + :param n_neurons: The number of neurons in each machine vertex (bar the last) - :param int n_colour_bits: The number of bits to use for colour + :param n_colour_bits: The number of bits to use for colour :return: The index of the entry, to be used to retrieve it - :rtype: int :raises SynapticConfigurationException: If a bad address is used. """ @@ -517,20 +491,19 @@ def add_invalid_application_entry( point to anywhere. Used to keep indices in synchronisation between e.g. normal and delay entries and between entries on different cores. - :param ~pacman.model.routing_info.BaseKeyAndMask key_and_mask: + :param key_and_mask: a key_and_mask object used as part of describing an edge that will require being received to be stored in the master pop table; the whole edge will become multiple calls to this function - :param int core_mask: + :param core_mask: Mask for the part of the key that identifies the core - :param int core_shift: The shift of the mask to get to the core_mask - :param int n_neurons: + :param core_shift: The shift of the mask to get to the core_mask + :param n_neurons: The number of neurons in each machine vertex (bar the last) - :param int n_colour_bits: + :param n_colour_bits: The number of bits to use for colour :return: The index of the added entry - :rtype: int """ # If there are too many neurons per core, fail if n_neurons > _MAX_N_NEURONS: @@ -554,20 +527,19 @@ def __add_invalid_entry( to keep indices in synchronisation between e.g. normal and delay entries and between entries on different cores. - :param ~pacman.model.routing_info.BaseKeyAndMask key_and_mask: + :param key_and_mask: a key_and_mask object used as part of describing an edge that will require being received to be stored in the master pop table; the whole edge will become multiple calls to this function - :param int core_mask: + :param core_mask: Mask for the part of the key that identifies the core - :param int core_shift: The shift of the mask to get to the core_mask - :param int n_neurons: + :param core_shift: The shift of the mask to get to the core_mask + :param n_neurons: The number of neurons in each machine vertex (bar the last) - :param int n_colour_bits: + :param n_colour_bits: The number of bits used for colour :return: The index of the added entry - :rtype: int """ entry = self.__add_entry( key_and_mask, core_mask, core_shift, n_neurons, n_colour_bits) @@ -606,8 +578,6 @@ def __add_entry( def get_pop_table_data(self) -> NDArray[uint32]: """ Get the master pop table data as a numpy array. - - :rtype: ~numpy.ndarray """ # sort entries by key entries = sorted( @@ -632,8 +602,6 @@ def max_n_neurons_per_core(self) -> int: """ The maximum number of neurons per core supported when a core-mask is > 0. - - :rtype: int """ return _MAX_N_NEURONS @@ -642,8 +610,6 @@ def max_core_mask(self) -> int: """ The maximum core mask supported when n_neurons is > 0; this is the maximum number of cores that can be supported in a joined mask. - - :rtype: int """ return _MAX_CORE_MASK @@ -651,7 +617,5 @@ def max_core_mask(self) -> int: def max_index(self) -> int: """ The maximum index of a synaptic connection. - - :rtype: int """ return _MAX_ADDRESS_COUNT diff --git a/spynnaker/pyNN/models/neuron/neuron_data.py b/spynnaker/pyNN/models/neuron/neuron_data.py index b6789cd4cf5..cc3bbb37a79 100644 --- a/spynnaker/pyNN/models/neuron/neuron_data.py +++ b/spynnaker/pyNN/models/neuron/neuron_data.py @@ -45,8 +45,6 @@ def _all_one_val_gen(rd: RangeDictionary[float]) -> bool: .. note:: A random distribution is considered the same if the same distribution is used for all neurons. - - :rtype: bool """ for key in rd.keys(): if is_singleton(rd[key]): @@ -95,8 +93,6 @@ def __init__(self, app_vertex: PopulationVertex): def gen_on_machine(self) -> bool: """ Whether the neuron data can be generated on the machine or not. - - :rtype: bool """ return self.__gen_on_machine @@ -143,12 +139,10 @@ def write_data(self, spec: DataSpecificationBase, vertex_slice: Slice, """ Write the generated data. - :param ~data_specification.DataSpecificationGenerator spec: - The data specification to write to - :param ~pacman.model.graphs.common.Slice vertex_slice: - The vertex slice to generate for - :param NeuronRegions neuron_regions: The regions to write to - :param bool gen_on_machine: Whether to allow generation on machine + :param spec: The data specification to write to + :param vertex_slice: The vertex slice to generate for + :param euron_regions: The regions to write to + :param gen_on_machine: Whether to allow generation on machine """ if gen_on_machine: self.generate_data() @@ -200,9 +194,7 @@ def __get_neuron_param_data(self, vertex_slice: Slice) -> NDArray: """ Get neuron parameter data for a slice. - :param ~pacman.model.graphs.common.Slice vertex_slice: - The slice to get the data for - :rtype: ~numpy.ndarray + :param vertex_slice: The slice to get the data for """ structs = self.__app_vertex.neuron_impl.structs values = _MergedDict(self.__app_vertex.parameters, @@ -216,9 +208,9 @@ def __get_struct_data(self, struct: Struct, values: '_MergedDict', """ Get the data for a structure. - :param Struct struct: The structure to get the data for - :param RangeDictionary values: The values to fill in the structure with - :param Slice vertex_slice: The slice to get the values for + :param struct: The structure to get the data for + :param values: The values to fill in the structure with + :param vertex_slice: The slice to get the values for """ if struct.repeat_type == StructRepeat.GLOBAL: return struct.get_data(values) @@ -229,9 +221,8 @@ def __get_neuron_builder_data( """ Get the data to build neuron parameters with. - :param Slice vertex_slice: The slice to get the parameters for + :param vertex_slice: The slice to get the parameters for :return: The number of structures and the data - :rtype: tuple(int, numpy.ndarray) """ structs = self.__app_vertex.neuron_impl.structs values = _MergedDict(self.__app_vertex.parameters, @@ -246,9 +237,9 @@ def __get_builder_data( """ Get the builder data for a structure. - :param Struct struct: The structure to get the data for - :param RangeDictionary values: The values to fill in the structure with - :param Slice vertex_slice: The slice to get the values for + :param struct: The structure to get the data for + :param values: The values to fill in the structure with + :param vertex_slice: The slice to get the values for """ if struct.repeat_type == StructRepeat.GLOBAL: return struct.get_generator_data(values) @@ -260,10 +251,9 @@ def __get_neuron_builder_header( """ Get the header of the neuron builder region. - :param Slice vertex_slice: The slice to put in the header - :param int n_structs: The number of structures to generate + :param vertex_slice: The slice to put in the header + :param n_structs: The number of structures to generate :param NeuronRegions neuron_regions: The regions to point to - :rtype: numpy.ndarray """ return numpy.array([ neuron_regions.neuron_params, @@ -278,9 +268,9 @@ def read_data(self, placement: Placement, Read the current state of the data from the machine into the application vertex. - :param ~pacman.model.placements.Placement placement: + :param placement: The placement of the vertex to read - :param NeuronRegions neuron_regions: The regions to read from + :param neuron_regions: The regions to read from """ merged_dict = _MergedDict(self.__app_vertex.parameters, self.__app_vertex.state_variables) @@ -293,9 +283,9 @@ def read_initial_data(self, placement: Placement, Read the initial state of the data from the machine into the application vertex. - :param ~pacman.model.placements.Placement placement: + :param placement: The placement of the vertex to read - :param NeuronRegions neuron_regions: The regions to read from + :param neuron_regions: The regions to read from """ merged_dict = _MergedDict(self.__app_vertex.parameters, self.__app_vertex.initial_state_variables) @@ -307,10 +297,9 @@ def __do_read_data(self, placement: Placement, region: int, """ Perform the reading of data. - :param ~pacman.model.placements.Placement placement: - Where the vertex is on the machine - :param int region: The region to read from - :param MergedDict results: Where to write the results to + :param placement: Where the vertex is on the machine + :param region: The region to read from + :param results: Where to write the results to """ address = locate_memory_region_for_placement(placement, region) vertex_slice = placement.vertex.vertex_slice diff --git a/spynnaker/pyNN/models/neuron/population_machine_local_only_combined_vertex.py b/spynnaker/pyNN/models/neuron/population_machine_local_only_combined_vertex.py index 0db189c0e1e..ed117ed1f5a 100644 --- a/spynnaker/pyNN/models/neuron/population_machine_local_only_combined_vertex.py +++ b/spynnaker/pyNN/models/neuron/population_machine_local_only_combined_vertex.py @@ -150,24 +150,21 @@ def __init__( weight_scales: NDArray[floating], neuron_data: NeuronData, max_atoms_per_core: int): """ - :param ~pacman.model.resources.AbstractSDRAM sdram: - The SDRAM used by the vertex - :param str label: The label of the vertex - :param PopulationVertex app_vertex: - The associated application vertex - :param ~pacman.model.graphs.common.Slice vertex_slice: - The slice of the population that this implements - :param int slice_index: + :param sdram: The SDRAM used by the vertex + :param label: The label of the vertex + :param app_vertex: The associated application vertex + :param vertex_slice: The slice of the population that this implements + :param slice_index: The index of the slice in the ordered list of slices - :param list(int) ring_buffer_shifts: + :param ring_buffer_shifts: The shifts to apply to convert ring buffer values to S1615 values - :param list(int) weight_scales: + :param weight_scales: The scaling to apply to weights to store them in the synapses - :param int all_syn_block_sz: The maximum size of the synapses in bytes - :param int structural_sz: The size of the structural data - :param NeuronData neuron_data: + :param all_syn_block_sz: The maximum size of the synapses in bytes + :param structural_sz: The size of the structural data + :param neuron_data: The handler of neuron data - :param int max_atoms_per_core: + :param max_atoms_per_core: The maximum number of atoms per core """ super().__init__( @@ -235,9 +232,8 @@ def __get_binary_file_name(app_vertex: PopulationVertex) -> str: Get the local binary filename for this vertex. Static because at the time this is needed, the local app_vertex is not set. - :param PopulationVertex app_vertex: + :param app_vertex: The associated application vertex - :rtype: str """ # Split binary name into title and extension name, ext = os.path.splitext(app_vertex.neuron_impl.binary_name) @@ -345,13 +341,12 @@ def _parse_local_only_provenance( """ Extract and yield local-only provenance. - :param str label: The label of the node - :param int x: x coordinate of the chip where this core - :param int y: y coordinate of the core where this core - :param int p: virtual id of the core - :param list(int) provenance_data: A list of data items to interpret + :param label: The label of the node + :param x: x coordinate of the chip where this core + :param y: y coordinate of the core where this core + :param p: virtual id of the core + :param provenance_data: A list of data items to interpret :return: a list of provenance data items - :rtype: iterator of ProvenanceDataItem """ prov = LocalOnlyProvenance(*provenance_data) diff --git a/spynnaker/pyNN/models/neuron/population_machine_neurons.py b/spynnaker/pyNN/models/neuron/population_machine_neurons.py index 36518009509..d15b0b6a33f 100644 --- a/spynnaker/pyNN/models/neuron/population_machine_neurons.py +++ b/spynnaker/pyNN/models/neuron/population_machine_neurons.py @@ -104,8 +104,6 @@ def _vertex_slice(self) -> Slice: .. note:: This is likely to be available via the MachineVertex. - - :rtype: ~pacman.model.graphs.common.Slice """ raise NotImplementedError @@ -114,8 +112,6 @@ def _vertex_slice(self) -> Slice: def _slice_index(self) -> int: """ The index of the slice of this vertex in the list of slices. - - :rtype: int """ raise NotImplementedError @@ -124,8 +120,6 @@ def _slice_index(self) -> int: def _key(self) -> int: """ The key for spikes. - - :rtype: int """ raise NotImplementedError @@ -145,7 +139,7 @@ def _set_key(self, key: int) -> None: .. note:: This is required because this class cannot have any storage. - :param int key: The key to be set + :param key: The key to be set """ raise NotImplementedError @@ -154,8 +148,6 @@ def _set_key(self, key: int) -> None: def _neuron_regions(self) -> NeuronRegions: """ The region identifiers for the neuron regions. - - :rtype: .NeuronRegions """ raise NotImplementedError @@ -164,8 +156,6 @@ def _neuron_regions(self) -> NeuronRegions: def _neuron_data(self) -> NeuronData: """ The neuron data handler. - - :rtype: NeuronData """ raise NotImplementedError @@ -174,8 +164,6 @@ def _neuron_data(self) -> NeuronData: def _max_atoms_per_core(self) -> int: """ The maximum number of atoms on a core, used for neuron data transfer. - - :rtype: int """ raise NotImplementedError @@ -191,10 +179,10 @@ def _parse_neuron_provenance(self, x: int, y: int, p: int, """ Extract and yield neuron provenance. - :param int x: x coordinate of the chip where this core - :param int y: y coordinate of the core where this core - :param int p: virtual id of the core - :param list(int) provenance_data: A list of data items to interpret + :param x: x coordinate of the chip where this core + :param y: y coordinate of the core where this core + :param p: virtual id of the core + :param provenance_data: A list of data items to interpret """ neuron_prov = NeuronProvenance(*provenance_data) with ProvenanceWriter() as db: @@ -212,9 +200,8 @@ def _write_neuron_data_spec( """ Write the data specification of the neuron data. - :param ~data_specification.DataSpecificationGenerator spec: - The data specification to write to - :param list(int) ring_buffer_shifts: + :param spec: The data specification to write to + :param ring_buffer_shifts: The shifts to apply to convert ring buffer values to S1615 values """ # Get and store the key @@ -254,9 +241,8 @@ def _rewrite_neuron_data_spec( """ Re-Write the data specification of the neuron data. - :param ~data_specification.DataSpecificationGenerator spec: - The data specification to write to - :param list(int) ring_buffer_shifts: + :param spec: The data specification to write to + :param ring_buffer_shifts: The shifts to apply to convert ring buffer values to S1615 values """ # Write the current source parameters @@ -272,9 +258,8 @@ def _write_neuron_core_parameters( """ Write the neuron parameters region. - :param ~data_specification.DataSpecificationGenerator spec: - The data specification to write to - :param list(int) ring_buffer_shifts: + :param spec: The data specification to write to + :param ring_buffer_shifts: The shifts to apply to convert ring buffer values to S1615 values """ n_atoms = self._vertex_slice.n_atoms @@ -440,8 +425,7 @@ def read_parameters_from_machine(self, placement: Placement) -> None: Read the parameters and state of the neurons from the machine at the current time. - :param ~pacman.model.placements.Placement placement: - Where to read the data from + :param placement: Where to read the data from """ self._neuron_data.read_data(placement, self._neuron_regions) @@ -451,8 +435,7 @@ def read_initial_parameters_from_machine( Read the parameters and state of the neurons from the machine as they were at the last time 0. - :param ~pacman.model.placements.Placement placement: - Where to read the data from + :param placement: Where to read the data from """ self._neuron_data.read_initial_data(placement, self._neuron_regions) diff --git a/spynnaker/pyNN/models/projection.py b/spynnaker/pyNN/models/projection.py index b79ff9c4336..d0bff83305f 100644 --- a/spynnaker/pyNN/models/projection.py +++ b/spynnaker/pyNN/models/projection.py @@ -84,17 +84,15 @@ def __init__( download_synapses: bool = False, partition_id: Optional[str] = None): """ - :param ~spynnaker.pyNN.models.populations.PopulationBase \ - pre_synaptic_population: - :param ~spynnaker.pyNN.models.populations.PopulationBase \ - post_synaptic_population: - :param AbstractConnector connector: - :param AbstractSynapseDynamics synapse_type: - :param None source: Unsupported; must be `None` - :param str receptor_type: - :param ~pyNN.space.Space space: - :param str label: - :param bool download_synapses: + :param pre_synaptic_population: + :param post_synaptic_population: + :param connector: + :param synapse_type: + :param source: Unsupported; must be `None` + :param receptor_type: + :param space: + :param label: + :param download_synapses: """ if source is not None: raise NotImplementedError( @@ -213,9 +211,8 @@ def __init__( @staticmethod def __check_population(param: _Pop) -> bool: """ - :param ~spynnaker.pyNN.models.populations.PopulationBase param: + :param param: :return: Whether the parameter is a view - :rtype: bool """ if isinstance(param, Population): # Projections definitely work from Populations @@ -243,12 +240,11 @@ def get(self, attribute_names: Union[str, Sequence[str]], SpiNNaker always gathers. :param attribute_names: list of attributes to gather - :type attribute_names: str or iterable(str) - :param str format: ``"list"`` or ``"array"`` - :param bool gather: gather over all nodes - :param bool with_address: + :param format: ``"list"`` or ``"array"`` + :param gather: gather over all nodes + :param with_address: True if the source and target are to be included - :param str multiple_synapses: + :param multiple_synapses: What to do with the data if format="array" and if the multiple source-target pairs with the same values exist. Currently only "last" is supported @@ -280,12 +276,10 @@ def save( SpiNNaker always gathers. :param attribute_names: - :type attribute_names: str or list(str) :param file: filename or open handle (which will be closed) - :type file: str or pyNN.recording.files.BaseFile - :param str format: - :param bool gather: Ignored - :param bool with_address: + :param format: + :param gather: Ignored + :param with_address: """ if not gather: warn_once( @@ -319,10 +313,9 @@ def __get_data( Internal data getter to add notify option. :param attribute_names: list of attributes to gather - :type attribute_names: str or iterable(str) - :param str format: ``"list"`` or ``"array"`` - :param bool with_address: - :param callable(ConnectionHolder,None) notify: + :param format: ``"list"`` or ``"array"`` + :param with_address: + :param notify: :return: values selected """ # fix issue with 1 versus many @@ -363,10 +356,8 @@ def __save_callback( metadata: Dict[str, Any], data: ConnectionHolder) -> None: """ :param save_file: - :type save_file: str or pyNN.recording.files.BaseFile - :param dict(str,object) metadata: + :param metadata: :param data: - :type data: ConnectionHolder or numpy.ndarray """ # Convert structured array to normal numpy array if hasattr(data, "dtype") and hasattr(data.dtype, "names"): @@ -392,8 +383,6 @@ def __save_callback( def pre(self) -> _Pop: """ The pre-population or population view. - - :rtype: ~spynnaker.pyNN.models.populations.PopulationBase """ return self._synapse_information.pre_population @@ -401,15 +390,13 @@ def pre(self) -> _Pop: def post(self) -> _Pop: """ The post-population or population view. - - :rtype: ~spynnaker.pyNN.models.populations.PopulationBase """ return self._synapse_information.post_population @property def label(self) -> str: """ - :rtype: str + Label of this Projection """ return self.__label @@ -420,16 +407,10 @@ def __repr__(self) -> str: @property def _synapse_information(self) -> SynapseInformation: - """ - :rtype: SynapseInformation - """ return self.__synapse_information @property def _projection_edge(self) -> ProjectionApplicationEdge: - """ - :rtype: ProjectionApplicationEdge - """ return self.__projection_edge def _find_existing_edge( @@ -441,14 +422,9 @@ def _find_existing_edge( edge which has the same post- and pre- vertex :param pre_synaptic_vertex: the source vertex of the multapse - :type pre_synaptic_vertex: - ~pacman.model.graphs.application.ApplicationVertex :param post_synaptic_vertex: The destination vertex of the multapse - :type post_synaptic_vertex: - ~pacman.model.graphs.application.ApplicationVertex - :param str partition_id: The partition ID of the edge to find + :param partition_id: The partition ID of the edge to find :return: `None` or the edge going to these vertices. - :rtype: ~.ApplicationEdge """ # Find edges ending at the postsynaptic vertex partitions = ( @@ -470,13 +446,6 @@ def _get_synaptic_data( fixed_values: List[Tuple[str, int]], notify: Optional[Callable[[ConnectionHolder], None]] ) -> ConnectionHolder: - """ - :param bool as_list: - :param list(str) data_to_get: - :param list(tuple(str,int)) fixed_values: - :param callable(ConnectionHolder,None) notify: - :rtype: ConnectionHolder - """ post_vertex = self.__projection_edge.post_vertex pre_vertex = self.__projection_edge.pre_vertex @@ -532,10 +501,11 @@ def size(self, gather: bool = True) -> Never: # @UnusedVariable .. note:: SpiNNaker always gathers. + .. warning:: Not implemented. - :param bool gather: + :param gather: If False, only get the number of connections locally. """ _ = gather @@ -545,6 +515,6 @@ def set_download_synapses(self, download_synapses: bool) -> None: """ Set whether synapses should be downloaded when the simulation pauses. - :param bool download_synapses: Whether to download synapses or not + :param download_synapses: Whether to download synapses or not """ self.__synapse_information.download_on_pause = download_synapses diff --git a/spynnaker/pyNN/models/recorder.py b/spynnaker/pyNN/models/recorder.py index 9c31d9dc106..8c6883f094b 100644 --- a/spynnaker/pyNN/models/recorder.py +++ b/spynnaker/pyNN/models/recorder.py @@ -48,9 +48,9 @@ class Recorder(object): def __init__( self, population: Population, vertex: PopulationApplicationVertex): """ - :param ~spynnaker.pyNN.models.populations.Population population: + :param population: the population to record for - :param ~pacman.model.graphs.application.ApplicationVertex vertex: + :param vertex: the SpiNNaker graph vertex used by the population """ self.__population = population @@ -68,8 +68,6 @@ def write_to_files_indicators(self) -> Mapping[str, IoDest]: """ What variables should be written to files, and where should they be written. - - :rtype: dict(str, neo.io.baseio.BaseIO or str or None) """ return self.__write_to_files_indicators @@ -84,17 +82,14 @@ def record( names. For a given `celltype` class, `celltype.recordable` contains a list of variables that can be recorded for that `celltype`. Can also be ``None`` to reset the list of variables. - :type variables: str or list(str) or None :param to_file: a file to automatically record to (optional). :py:meth:`write_data` will be automatically called when `sim.end()` is called. - :type to_file: ~neo.io or ~neo.rawio or str :param int sampling_interval: a value in milliseconds, and an integer multiple of the simulation timestep. :param indexes: The indexes of neurons to record from. This is non-standard PyNN and equivalent to creating a view with these indexes and asking the View to record. - :type indexes: None or list(int) """ if variables is None: # reset the list of things to record if sampling_interval is not None: @@ -134,9 +129,8 @@ def __turn_on_all_record( self, sampling_interval: Optional[int], to_file: IoDest, indexes: Optional[Collection[int]]) -> None: """ - :param int sampling_interval: the interval to record them + :param sampling_interval: the interval to record them :param to_file: If set, a file to write to (by handle or name) - :type to_file: neo.io.baseio.BaseIO or str or None :param indexes: List of indexes to record or `None` for all :raises SimulatorRunningException: If `sim.run` is currently running :raises SimulatorNotSetupException: If called before `sim.setup` @@ -158,13 +152,11 @@ def turn_on_record( """ Tell the vertex to record data. - :param str variable: The variable to record, supported variables to + :param variable: The variable to record, supported variables to record are: ``gsyn_exc``, ``gsyn_inh``, ``v``, ``spikes``. - :param int sampling_interval: the interval to record them + :param sampling_interval: the interval to record them :param to_file: If set, a file to write to (by handle or name) - :type to_file: neo.io.baseio.BaseIO or str or None :param indexes: List of indexes to record or `None` for all - :type indexes: list(int) or None :raises SimulatorRunningException: If `sim.run` is currently running :raises SimulatorNotSetupException: If called before `sim.setup` :raises SimulatorShutdownException: If called after `sim.end` @@ -197,8 +189,6 @@ def turn_on_record( def recording_label(self) -> str: """ The label from the vertex is applicable or a default. - - :rtype: str """ SpynnakerDataView.check_user_can_act() return self.__vertex.label or "!!UNLABELLED VERTEX!!" @@ -209,7 +199,6 @@ def turn_off_all_recording( Turns off recording, is used by a pop saying ``.record()``. :param indexes: - :type indexes: list or None """ for variable in self.__vertex.get_recordable_variables(): self.__vertex.set_not_recording(variable, indexes) @@ -220,13 +209,12 @@ def extract_neo_block( """ Extracts block from the vertices and puts them into a Neo block. - :param list(str) variables: the variables to extract - :param slice view_indexes: the indexes to be included in the view - :param bool clear: if the variables should be cleared after reading - :param dict(str,object) annotations: + :param variables: the variables to extract + :param view_indexes: the indexes to be included in the view + :param clear: if the variables should be cleared after reading + :param annotations: annotations to put on the Neo block :return: The Neo block - :rtype: ~neo.core.Block :raises \ ~spinn_front_end_common.utilities.exceptions.ConfigurationException: If the recording not setup correctly @@ -249,13 +237,12 @@ def csv_neo_block( """ Extracts block from the vertices and puts them into a Neo block. - :param str variables: the variables to extract - :param list(str) variables: the variables to extract - :param slice view_indexes: the indexes to be included in the view - :param dict(str,object) annotations: + :param variables: the variables to extract + :param variables: the variables to extract + :param view_indexes: the indexes to be included in the view + :param annotations: annotations to put on the Neo block :return: The Neo block - :rtype: ~neo.core.Block :raises \ ~spinn_front_end_common.utilities.exceptions.ConfigurationException: If the recording not setup correctly diff --git a/spynnaker/pyNN/spinnaker.py b/spynnaker/pyNN/spinnaker.py index c1a05df7bd8..9e0c5fe876c 100644 --- a/spynnaker/pyNN/spinnaker.py +++ b/spynnaker/pyNN/spinnaker.py @@ -218,7 +218,6 @@ def num_processes(self) -> int: Meaningless on SpiNNaker, so we pretend there's one MPI process :return: Constant: 1 - :rtype: int """ return 1 @@ -359,7 +358,7 @@ def register_binary_search_path(search_path: str) -> None: .. deprecated:: 7.0 Use :py:meth:`SpynnakerDataView.register_binary_search_path`. - :param str search_path: absolute search path for binaries + :param search_path: absolute search path for binaries """ SpynnakerDataView.register_binary_search_path(search_path) diff --git a/spynnaker/pyNN/spynnaker_external_device_plugin_manager.py b/spynnaker/pyNN/spynnaker_external_device_plugin_manager.py index 80831a5bc14..fd112521985 100644 --- a/spynnaker/pyNN/spynnaker_external_device_plugin_manager.py +++ b/spynnaker/pyNN/spynnaker_external_device_plugin_manager.py @@ -128,7 +128,6 @@ def activate_live_output_for( :param use_prefix: Determines if the spike packet will contain a common prefix for the spikes - :param label: The label of the gatherer vertex :param partition_ids: The names of the partitions to create edges for :param translate_keys: @@ -213,7 +212,6 @@ def update_live_packet_gather_tracker( :param vertex_to_record_from: :param params: :param partition_ids: - :param translate_keys: """ # add to the tracker SpynnakerDataView.add_live_packet_gatherer_parameters( diff --git a/unittests/test_doc_checker.py b/unittests/test_doc_checker.py new file mode 100644 index 00000000000..079cad84b93 --- /dev/null +++ b/unittests/test_doc_checker.py @@ -0,0 +1,37 @@ +# Copyright (c) 2017 The University of Manchester +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import sys +import unittest + +from spinn_utilities.config_setup import unittest_setup +from spinn_utilities.testing.docs_checker import DocsChecker + + +class TestCfgChecker(unittest.TestCase): + + def setUp(self) -> None: + unittest_setup() + + def test_doc_checks(self) -> None: + class_file = sys.modules[self.__module__].__file__ + assert class_file is not None + abs_class_file = os.path.abspath(class_file) + unittest_dir = os.path.dirname(abs_class_file) + repo_dir = os.path.dirname(unittest_dir) + checker = DocsChecker( + check_init=False, check_short=False, check_params=False) + checker.check_dir(repo_dir) + checker.check_no_errors() From 3a35ded026b3112e6a9c2c7b5322efc2df3076a7 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 26 Jun 2025 16:10:17 +0100 Subject: [PATCH 4/7] fix encoding --- unittests/connector_tests/test_weights_delays_connector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittests/connector_tests/test_weights_delays_connector.py b/unittests/connector_tests/test_weights_delays_connector.py index 1bf61017009..44f1a41ae04 100644 --- a/unittests/connector_tests/test_weights_delays_connector.py +++ b/unittests/connector_tests/test_weights_delays_connector.py @@ -1,4 +1,4 @@ -# Copyright (c) 2017 The University of Manchester +# Copyright (c) 2017 The University of Manchester # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. From 9c27f74ce204ac02068ad10e4eb15e195d183c19 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 26 Jun 2025 16:10:59 +0100 Subject: [PATCH 5/7] remove types from docs --- .../abstract_push_bot_retina_device.py | 2 +- .../ethernet/push_bot_retina_device.py | 2 +- .../pyNN/extra_algorithms/neuron_expander.py | 1 - .../splitter_delay_vertex_slice.py | 6 +- ...tter_population_vertex_neurons_synapses.py | 10 +- .../spynnaker_splitter_selector.py | 3 +- ...ker_neuron_network_specification_report.py | 2 - .../abstract_accepts_incoming_synapses.py | 2 +- .../models/common/local_only_2d_common.py | 4 +- .../pyNN/models/common/neuron_recorder.py | 1 - spynnaker/pyNN/models/defaults.py | 10 +- .../connectors/abstract_connector.py | 5 +- .../connectors/all_but_me_connector.py | 2 +- ...istance_dependent_probability_connector.py | 4 - .../connectors/fixed_number_pre_connector.py | 3 - .../connectors/fixed_probability_connector.py | 6 +- .../connectors/pool_dense_connector.py | 10 +- .../delay_afferent_application_edge.py | 6 +- .../neural_projections/synapse_information.py | 2 +- .../neuron/abstract_pynn_neuron_model.py | 15 +- .../abstract_pynn_neuron_model_standard.py | 18 +- .../pyNN/models/neuron/connection_holder.py | 12 +- .../neuron/local_only/abstract_local_only.py | 5 +- .../local_only/local_only_pool_dense.py | 2 +- spynnaker/pyNN/models/neuron/neuron_data.py | 4 +- .../neuron_models/neuron_model_if_trunc.py | 1 - .../timing_dependence_spike_nearest_pair.py | 22 +- .../neuron/population_machine_common.py | 23 +- ...tion_machine_local_only_combined_vertex.py | 2 - .../neuron/population_machine_neurons.py | 4 - .../neuron/population_machine_synapses.py | 24 +- .../population_machine_synapses_provenance.py | 10 +- .../neuron/population_machine_vertex.py | 31 +- .../population_neurons_machine_vertex.py | 28 +- ...pulation_synapses_machine_vertex_common.py | 40 ++- ...population_synapses_machine_vertex_lead.py | 11 +- ...pulation_synapses_machine_vertex_shared.py | 11 +- .../pyNN/models/neuron/population_vertex.py | 183 +++--------- .../elimination/abstract_elimination.py | 8 +- .../random_by_weight_elimination.py | 6 +- .../formation/abstract_formation.py | 6 +- .../formation/distance_dependent_formation.py | 22 +- .../abstract_partner_selection.py | 6 +- .../abstract_generate_on_machine.py | 8 - .../abstract_has_parameter_names.py | 2 - .../abstract_plastic_synapse_dynamics.py | 39 +-- .../abstract_sdram_synapse_dynamics.py | 37 +-- .../abstract_static_synapse_dynamics.py | 31 +- .../abstract_supports_signed_weights.py | 16 -- .../abstract_synapse_dynamics.py | 63 ++--- .../abstract_synapse_dynamics_structural.py | 49 +--- .../synapse_dynamics_neuromodulation.py | 11 +- .../synapse_dynamics_static.py | 10 +- .../synapse_dynamics/synapse_dynamics_stdp.py | 45 +-- .../synapse_dynamics_structural_common.py | 58 +--- .../synapse_dynamics_structural_static.py | 21 +- .../synapse_dynamics_structural_stdp.py | 33 +-- .../synapse_dynamics_utils.py | 41 ++- .../synapse_dynamics_weight_changable.py | 14 +- .../synapse_dynamics_weight_changer.py | 4 +- spynnaker/pyNN/models/neuron/synapse_io.py | 150 +++++----- .../synapse_types/abstract_synapse_type.py | 3 - .../synapse_types/synapse_type_alpha.py | 22 -- .../synapse_types/synapse_type_delta.py | 8 - .../synapse_type_dual_exponential.py | 24 -- .../synapse_types/synapse_type_exponential.py | 16 -- .../neuron/synapse_types/synapse_type_semd.py | 36 --- .../pyNN/models/neuron/synaptic_matrices.py | 61 ++-- .../pyNN/models/neuron/synaptic_matrix_app.py | 76 ++--- .../threshold_type_fixed_prob.py | 4 - .../threshold_type_maass_stochastic.py | 6 - .../threshold_types/threshold_type_static.py | 2 - spynnaker/pyNN/models/populations/assembly.py | 2 - .../pyNN/models/populations/population.py | 1 - .../models/populations/population_view.py | 6 +- spynnaker/pyNN/models/recorder.py | 2 +- .../models/spike_source/spike_source_array.py | 4 +- .../spike_source/spike_source_array_vertex.py | 4 +- .../spike_source/spike_source_from_file.py | 2 - .../spike_source/spike_source_poisson.py | 8 +- .../spike_source_poisson_machine_vertex.py | 27 +- .../spike_source_poisson_variable.py | 4 +- .../spike_source_poisson_vertex.py | 72 ++--- .../delays/delay_extension_machine_vertex.py | 20 +- .../delays/delay_extension_vertex.py | 23 +- .../spike_injector/spike_injector.py | 8 +- .../protocols/munich_io_ethernet_protocol.py | 53 +--- .../munich_io_spinnaker_link_protocol.py | 267 ++++-------------- .../pyNN/utilities/bit_field_utilities.py | 22 +- spynnaker/pyNN/utilities/data_population.py | 4 +- .../pyNN/utilities/neo_buffer_database.py | 206 +++++--------- spynnaker/pyNN/utilities/neo_compare.py | 38 +-- spynnaker/pyNN/utilities/neo_convertor.py | 48 ++-- spynnaker/pyNN/utilities/neo_csv.py | 167 +++++------ spynnaker/pyNN/utilities/running_stats.py | 15 +- spynnaker/pyNN/utilities/struct.py | 35 +-- spynnaker/pyNN/utilities/utility_calls.py | 69 ++--- .../scripts/synfire_npop_run.py | 4 - .../scripts/synfire_runner.py | 46 --- 99 files changed, 791 insertions(+), 1831 deletions(-) diff --git a/spynnaker/pyNN/external_devices_models/push_bot/abstract_push_bot_retina_device.py b/spynnaker/pyNN/external_devices_models/push_bot/abstract_push_bot_retina_device.py index bf783c933ab..b945e3bd4d5 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/abstract_push_bot_retina_device.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/abstract_push_bot_retina_device.py @@ -33,7 +33,7 @@ def __init__(self, protocol: MunichIoSpiNNakerLinkProtocol, resolution: Optional[PushBotRetinaResolution]): """ :param protocol: - :param PushBotRetinaResolution: + :param resolution: """ self._protocol = protocol self._resolution = resolution diff --git a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_retina_device.py b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_retina_device.py index 294b202dbc0..4f49511fba3 100644 --- a/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_retina_device.py +++ b/spynnaker/pyNN/external_devices_models/push_bot/ethernet/push_bot_retina_device.py @@ -42,7 +42,7 @@ def __init__( retina_injector_label: str = "PushBotRetinaInjector"): """ :param protocol: - :param PushBotRetinaResolution resolution: + :param resolution: :param pushbot_ip_address: :param pushbot_port: :param injector_port: diff --git a/spynnaker/pyNN/extra_algorithms/neuron_expander.py b/spynnaker/pyNN/extra_algorithms/neuron_expander.py index 53590528062..2c473e7e562 100644 --- a/spynnaker/pyNN/extra_algorithms/neuron_expander.py +++ b/spynnaker/pyNN/extra_algorithms/neuron_expander.py @@ -88,7 +88,6 @@ def _fill_in_initial_data(expanded_pop_vertices: List[ Once expander has run, fill in the connection data. :param expanded_pop_vertices: List of machine vertices to read data from - :param transceiver: How to talk to the machine """ progress = ProgressBar( len(expanded_pop_vertices), "Getting initial values") diff --git a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_delay_vertex_slice.py b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_delay_vertex_slice.py index bffe4dfeeaa..2be80f6825a 100644 --- a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_delay_vertex_slice.py +++ b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_delay_vertex_slice.py @@ -115,8 +115,7 @@ def create_machine_vertex( """ Creates a delay extension machine vertex and adds to the tracker. - :param ~pacman.model.graphs.machine.MachineVertex source_vertex: - The source of the delay + :param source_app_vertex: The source of the delay :return: machine vertex """ label = f"Delay extension for {source_app_vertex}" @@ -153,7 +152,6 @@ def get_machine_vertex( """ Get a delay extension machine vertex for a given vertex slice. - :param ~pacman.model.graphs.common.Slice vertex_slice: - The slice to get the data for + :param vertex_slice: The slice to get the data for """ return self._machine_vertex_by_slice[vertex_slice] diff --git a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex_neurons_synapses.py b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex_neurons_synapses.py index 2e1b7e45f72..1fc6df95e4d 100644 --- a/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex_neurons_synapses.py +++ b/spynnaker/pyNN/extra_algorithms/splitter_components/splitter_population_vertex_neurons_synapses.py @@ -307,7 +307,6 @@ def __add_lead_synapse_core( back to S1615 values :param weight_scales: The scale to apply to weights to encode them in the 16-bit synapses - :param synapse_vertices: A list to add the core to :param neuron_vertex: The neuron vertex the synapses will feed into :param atoms_per_core: The maximum atoms per core @@ -351,8 +350,7 @@ def __add_shared_synapse_core( :param synapse_references: References to the synapse regions :param shared_synapse_sdram: :param feedback_partition: - :param synapse_vertices: A list to add the core to - :param PopulationNeuronsMachineVertex neuron_vertex: +` :param neuron_vertex: The neuron vertex the synapses will feed into :return: The """ @@ -582,8 +580,6 @@ def __get_neuron_sdram( """ Gets the resources of the neurons of a slice of atoms from a given application vertex. - - :param vertex_slice: the slice """ n_record = len(self.governed_app_vertex.neuron_recordables) variable_sdram = \ @@ -641,7 +637,6 @@ def __get_synapse_sdram( Get the resources of the synapses of a slice of atoms from a given application vertex. - :param vertex_slice: the slice :param shared_sdram: The SDRAM shared between cores, if this is to be included """ @@ -684,9 +679,6 @@ def __independent_synapse_sdram(self) -> MultiRegionSDRAM: def __proj_dependent_synapse_sdram(self) -> MultiRegionSDRAM: """ Get the SDRAM used by synapse cores dependent on the projections. - - :param incoming_projections: - The projections to consider in the calculations """ regions = PopulationSynapsesMachineVertexLead.SYNAPSE_REGIONS sdram = MultiRegionSDRAM() diff --git a/spynnaker/pyNN/extra_algorithms/splitter_components/spynnaker_splitter_selector.py b/spynnaker/pyNN/extra_algorithms/splitter_components/spynnaker_splitter_selector.py index 6a155f3c8f9..78adad5b08d 100644 --- a/spynnaker/pyNN/extra_algorithms/splitter_components/spynnaker_splitter_selector.py +++ b/spynnaker/pyNN/extra_algorithms/splitter_components/spynnaker_splitter_selector.py @@ -81,8 +81,7 @@ def spynnaker_vertex_selector(app_vertex: ApplicationVertex) -> None: Will delegate to the non-sPyNNaker selector if no heuristic is known for the application vertex. - :param ~pacman.model.graphs.application.ApplicationVertex app_vertex: - application vertex to give a splitter object to + :param app_vertex: application vertex to give a splitter object to """ if not app_vertex.has_splitter: if isinstance(app_vertex, PopulationVertex): diff --git a/spynnaker/pyNN/extra_algorithms/spynnaker_neuron_network_specification_report.py b/spynnaker/pyNN/extra_algorithms/spynnaker_neuron_network_specification_report.py index 5d8ea01dc0b..2f16b129509 100644 --- a/spynnaker/pyNN/extra_algorithms/spynnaker_neuron_network_specification_report.py +++ b/spynnaker/pyNN/extra_algorithms/spynnaker_neuron_network_specification_report.py @@ -51,8 +51,6 @@ def spynnaker_neuron_graph_network_specification_report() -> None: """ Produces a report describing the graph created from the neural populations and projections. - - :param report_folder: the report folder to put figure into """ # create holders for data dot_diagram, exe_not_found_exn = _get_diagram(_GRAPH_TITLE) diff --git a/spynnaker/pyNN/models/abstract_models/abstract_accepts_incoming_synapses.py b/spynnaker/pyNN/models/abstract_models/abstract_accepts_incoming_synapses.py index 2e56b4c7570..1b5df063898 100644 --- a/spynnaker/pyNN/models/abstract_models/abstract_accepts_incoming_synapses.py +++ b/spynnaker/pyNN/models/abstract_models/abstract_accepts_incoming_synapses.py @@ -66,7 +66,7 @@ def get_connections_from_machine( """ Get the connections from the machine post-run. - :param ApplicationEdge app_edge: + :param app_edge: The edge for which the data is being read :param synapse_info: The specific projection within the edge diff --git a/spynnaker/pyNN/models/common/local_only_2d_common.py b/spynnaker/pyNN/models/common/local_only_2d_common.py index b6c316670dc..3ee3742056e 100644 --- a/spynnaker/pyNN/models/common/local_only_2d_common.py +++ b/spynnaker/pyNN/models/common/local_only_2d_common.py @@ -68,7 +68,7 @@ def get_delay_for_source(incoming: "Projection") -> Tuple[ """ Get the vertex which will send data from a given source projection, along with the delay stage and locally-handled delay value - :param Projection incoming: The incoming projection to get the delay from + :param incoming: The incoming projection to get the delay from :return: The vertex, the local delay, the delay stage, the partition id """ # pylint: disable=protected-access @@ -126,7 +126,7 @@ def get_sources_for_target(app_vertex: "PopulationVertex") -> Dict[ Get all the application vertex sources that will hit the given application vertex. - :param PopulationVertex app_vertex: The vertex being targeted + :param app_vertex: The vertex being targeted :return: A dict of source ApplicationVertex to list of source information """ diff --git a/spynnaker/pyNN/models/common/neuron_recorder.py b/spynnaker/pyNN/models/common/neuron_recorder.py index 59b61c82487..ebb0e48599b 100644 --- a/spynnaker/pyNN/models/common/neuron_recorder.py +++ b/spynnaker/pyNN/models/common/neuron_recorder.py @@ -296,7 +296,6 @@ def _get_placement_matrix_data( """ Processes a placement for matrix data. - :param placements: the placements object :param vertex: the vertex to read from :param region: the recording region id :param expected_rows: diff --git a/spynnaker/pyNN/models/defaults.py b/spynnaker/pyNN/models/defaults.py index a3b62c395c5..a64f26ad6fb 100644 --- a/spynnaker/pyNN/models/defaults.py +++ b/spynnaker/pyNN/models/defaults.py @@ -45,9 +45,9 @@ def get_map_from_init( Get an argument initialisation dictionary by examining an ``__init__`` method or function. - :param callable init_method: The method. - :param frozenset(str) skip: The arguments to be skipped, if any - :param frozenset(str) include: The arguments that must be present, if any + :param init_method: The method. + :param skip: The arguments to be skipped, if any + :param include: The arguments that must be present, if any :return: an initialisation dictionary """ init_args = inspect.getfullargspec(init_method) @@ -77,7 +77,7 @@ def default_parameters(parameters: Iterable[str]) -> Callable: ``__init__`` method of a class that is additionally decorated with :py:meth:`defaults` - :param iterable(str) parameters: + :param parameters: The names of the arguments that are parameters """ def wrap(method: Callable) -> Callable: @@ -117,7 +117,7 @@ def default_initial_values(state_variables: Iterable[str]) -> Callable: ``__init__`` method of a class that is additionally decorated with :py:meth:`defaults` - :param iterable(str) state_variables: + :param state_variables: The names of the arguments that are state variables """ def wrap(method: Callable) -> Callable: diff --git a/spynnaker/pyNN/models/neural_projections/connectors/abstract_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/abstract_connector.py index e8b8fc20870..adbc4b0b92c 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/abstract_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/abstract_connector.py @@ -262,7 +262,6 @@ def get_n_connections_from_pre_vertex_maximum( Not all concrete connectors support omitting the delay range. - :param delays: :param n_post_atoms: :param synapse_info: :param min_delay: @@ -277,7 +276,7 @@ def get_n_connections_to_post_vertex_maximum( Get the maximum number of connections to any neuron in the post vertex from neurons in the pre vertex. - :param SynapseInformation synapse_info: + :param synapse_info: """ raise NotImplementedError @@ -554,7 +553,7 @@ def __pop_label(pop: Union[Population, PopulationView]) -> str: def get_provenance_data(self, synapse_info: SynapseInformation) -> None: """ - :param SynapseInformation synapse_info: + :param synapse_info: """ # Convert to native Python integer; provenance system assumption ncd = self.__n_clipped_delays.item() diff --git a/spynnaker/pyNN/models/neural_projections/connectors/all_but_me_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/all_but_me_connector.py index 245c881f473..0950c7909c4 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/all_but_me_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/all_but_me_connector.py @@ -78,7 +78,7 @@ def __init__(self, n_neurons_per_group: Optional[int] = None, :param verbose: Whether to output extra information about the connectivity to a CSV file - :param callable callback: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: diff --git a/spynnaker/pyNN/models/neural_projections/connectors/distance_dependent_probability_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/distance_dependent_probability_connector.py index 689a875058d..20c2f10846d 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/distance_dependent_probability_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/distance_dependent_probability_connector.py @@ -92,10 +92,6 @@ def __init__( .. note:: Not supported by sPyNNaker. """ - # :param ~pyNN.space.Space space: - # a Space object, needed if you wish to specify distance-dependent - # weights or delays. - super().__init__(safe, callback, verbose) self.__d_expression = d_expression self.__allow_self_connections = allow_self_connections diff --git a/spynnaker/pyNN/models/neural_projections/connectors/fixed_number_pre_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/fixed_number_pre_connector.py index 879d352fe9b..91438db8aa9 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/fixed_number_pre_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/fixed_number_pre_connector.py @@ -87,9 +87,6 @@ def __init__( .. note:: Not supported by sPyNNaker. """ - # :param ~pyNN.space.Space space: - # a Space object, needed if you wish to specify distance-dependent - # weights or delays - not implemented super().__init__(safe, callback, verbose) # We absolutely require an integer at this point! self.__n_pre = self._roundsize(n, "FixedNumberPreConnector") diff --git a/spynnaker/pyNN/models/neural_projections/connectors/fixed_probability_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/fixed_probability_connector.py index 7f83238232d..39c24f1f595 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/fixed_probability_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/fixed_probability_connector.py @@ -70,15 +70,15 @@ def __init__( if the connector is used to connect a Population to itself, this flag determines whether a neuron is allowed to connect to itself, or only to other neurons in the Population. - :param bool safe: + :param safe: If ``True``, check that weights and delays have valid values. If ``False``, this check is skipped. - :param bool verbose: + :param verbose: Whether to output extra information about the connectivity to a CSV file :param rng: Seeded random number generator, or `None` to make one when needed - :param callable callback: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: diff --git a/spynnaker/pyNN/models/neural_projections/connectors/pool_dense_connector.py b/spynnaker/pyNN/models/neural_projections/connectors/pool_dense_connector.py index d6745b8d7c0..1c02e71fc2d 100644 --- a/spynnaker/pyNN/models/neural_projections/connectors/pool_dense_connector.py +++ b/spynnaker/pyNN/models/neural_projections/connectors/pool_dense_connector.py @@ -101,7 +101,7 @@ def __init__(self, weights: ArrayLike, is "inhibitory". :param safe: (ignored) :param verbose: (ignored) - :param callable callback: + :param callback: if given, a callable that display a progress bar on the terminal. .. note:: @@ -305,14 +305,12 @@ def get_local_only_data( delay_stage: int, post_vertex_slice: Slice, weight_scales: NDArray[floating]) -> NDArray[uint32]: """ - :param spec: :param app_edge: - :param pre_vertex_slice: + :param local_delay: + :param delay_stage: :param post_vertex_slice: - :param key: - :param mask: - :param n_colour_bits: :param weight_scales: + :return: """ # Write numbers of things diff --git a/spynnaker/pyNN/models/neural_projections/delay_afferent_application_edge.py b/spynnaker/pyNN/models/neural_projections/delay_afferent_application_edge.py index 5a27efd3dfc..42540345005 100644 --- a/spynnaker/pyNN/models/neural_projections/delay_afferent_application_edge.py +++ b/spynnaker/pyNN/models/neural_projections/delay_afferent_application_edge.py @@ -32,8 +32,8 @@ def __init__(self, pre_vertex: PopulationApplicationVertex, delay_vertex: DelayExtensionVertex, label: Optional[str] = None): """ - :param PopulationApplicationVertex pre_vertex: - :param DelayExtensionVertex delay_vertex: - :param str label: + :param pre_vertex: + :param delay_vertex: + :param label: """ super().__init__(pre_vertex, delay_vertex, label=label) diff --git a/spynnaker/pyNN/models/neural_projections/synapse_information.py b/spynnaker/pyNN/models/neural_projections/synapse_information.py index 6d07bb4fd97..be7946e670e 100644 --- a/spynnaker/pyNN/models/neural_projections/synapse_information.py +++ b/spynnaker/pyNN/models/neural_projections/synapse_information.py @@ -75,7 +75,7 @@ def __init__(self, connector: AbstractConnector, Whether the synapse type came from synapse dynamics :param weights: The synaptic weights :param delays: The total synaptic delays - :param bool download_on_pause: + :param download_on_pause: Whether to download the synapse matrix when the simulation pauses :param partition_id: The partition id for the application edge when not standard; if diff --git a/spynnaker/pyNN/models/neuron/abstract_pynn_neuron_model.py b/spynnaker/pyNN/models/neuron/abstract_pynn_neuron_model.py index 786099a7869..65414abedda 100644 --- a/spynnaker/pyNN/models/neuron/abstract_pynn_neuron_model.py +++ b/spynnaker/pyNN/models/neuron/abstract_pynn_neuron_model.py @@ -98,7 +98,7 @@ def reset_all(cls) -> None: def __init__(self, model: AbstractNeuronImpl): """ - :param AbstractNeuronImpl model: The model implementation + :param model: The model implementation """ self.__model = model @@ -121,14 +121,13 @@ def create_vertex( n_synapse_cores: Optional[int] = None, allow_delay_extensions: Optional[bool] = None) -> PopulationVertex: """ - :param float spikes_per_second: - :param float ring_buffer_sigma: - :param int incoming_spike_buffer_size: - :param bool drop_late_spikes: + :param spikes_per_second: + :param ring_buffer_sigma: + :param incoming_spike_buffer_size: + :param drop_late_spikes: :param splitter: - :type splitter: SplitterPopulationVertex or None - :param int seed: - :param int n_colour_bits: + :param seed: + :param n_colour_bits: """ if neurons_per_core is None: neurons_per_core = \ diff --git a/spynnaker/pyNN/models/neuron/abstract_pynn_neuron_model_standard.py b/spynnaker/pyNN/models/neuron/abstract_pynn_neuron_model_standard.py index 4715face400..0482cf7bbf4 100644 --- a/spynnaker/pyNN/models/neuron/abstract_pynn_neuron_model_standard.py +++ b/spynnaker/pyNN/models/neuron/abstract_pynn_neuron_model_standard.py @@ -51,18 +51,14 @@ def __init__( threshold_type: AbstractThresholdType, additional_input_type: Optional[AbstractAdditionalInput] = None): """ - :param str model_name: Name of the model. - :param str binary: Name of the implementation executable. - :param NeuronModel neuron_model: - The model of the neuron body - :param AbstractInputType input_type: The model of synaptic input types - :param AbstractSynapseType synapse_type: - The model of the synapses' dynamics - :param AbstractThresholdType threshold_type: - The model of the firing threshold + :param model_name: Name of the model. + :param binary: Name of the implementation executable. + :param neuron_model: The model of the neuron body + :param input_type: The model of synaptic input types + :param synapse_type: The model of the synapses' dynamics + :param threshold_type: The model of the firing threshold :param additional_input_type: The model (if any) of additional environmental inputs - :type additional_input_type: AbstractAdditionalInput or None """ super().__init__(NeuronImplStandard( model_name, binary, neuron_model, input_type, synapse_type, @@ -83,7 +79,7 @@ def create_vertex( n_synapse_cores: Optional[int] = None, allow_delay_extensions: Optional[bool] = None) -> PopulationVertex: """ - :param int n_steps_per_timestep: + :param n_steps_per_timestep: """ cast(NeuronImplStandard, self._model).n_steps_per_timestep = n_steps_per_timestep diff --git a/spynnaker/pyNN/models/neuron/connection_holder.py b/spynnaker/pyNN/models/neuron/connection_holder.py index 9a1b5297cc4..be41deb0f00 100644 --- a/spynnaker/pyNN/models/neuron/connection_holder.py +++ b/spynnaker/pyNN/models/neuron/connection_holder.py @@ -74,16 +74,14 @@ def __init__( notify: Optional[Callable[['ConnectionHolder'], None]] = None): """ :param data_items_to_return: A list of data fields to be returned - :type data_items_to_return: list(str) or tuple(str) or None - :param bool as_list: + :param as_list: True if the data will be returned as a list, False if it is to be returned as a matrix (or series of matrices) - :param int n_pre_atoms: The number of atoms in the pre-vertex - :param int n_post_atoms: The number of atoms in the post-vertex + :param n_pre_atoms: The number of atoms in the pre-vertex + :param n_post_atoms: The number of atoms in the post-vertex :param connections: Any initial connections, as a numpy structured array of source, target, weight and delay - :type connections: list(~numpy.ndarray) or None :param fixed_values: A list of tuples of field names and fixed values to be appended to the other fields per connection, formatted as @@ -93,12 +91,10 @@ def __init__( If the field is to be returned, the name must also appear in data_items_to_return, which determines the order of items in the result. - :type fixed_values: list(tuple(str,int)) or None :param notify: A callback to call when the connections have all been added. This should accept a single parameter, which will contain the data requested - :type notify: callable(ConnectionHolder, None) or None """ self.__data_items_to_return = data_items_to_return self.__as_list = as_list @@ -113,7 +109,7 @@ def add_connections(self, connections: ConnectionsArray) -> None: """ Add connections to the holder to be returned. - :param ~numpy.ndarray connections: + :param connections: The connection to add, as a numpy structured array of source, target, weight and delay """ diff --git a/spynnaker/pyNN/models/neuron/local_only/abstract_local_only.py b/spynnaker/pyNN/models/neuron/local_only/abstract_local_only.py index 68dddcbf316..67d74349497 100644 --- a/spynnaker/pyNN/models/neuron/local_only/abstract_local_only.py +++ b/spynnaker/pyNN/models/neuron/local_only/abstract_local_only.py @@ -51,11 +51,8 @@ def get_parameters_usage_in_bytes( """ Get the size of the parameters in bytes. - :param int n_atoms: The number of atoms in the vertex + :param n_atoms: The number of atoms in the vertex :param incoming_projections: The projections to get the size of - :type incoming_projections: - list(~spynnaker.pyNN.models.projection.Projection) - :rtype: int """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neuron/local_only/local_only_pool_dense.py b/spynnaker/pyNN/models/neuron/local_only/local_only_pool_dense.py index cd5d372c936..00172e9a239 100644 --- a/spynnaker/pyNN/models/neuron/local_only/local_only_pool_dense.py +++ b/spynnaker/pyNN/models/neuron/local_only/local_only_pool_dense.py @@ -70,7 +70,7 @@ class LocalOnlyPoolDense(AbstractLocalOnly, AbstractSupportsSignedWeights): def __init__(self, delay: WEIGHTS_DELAYS_IN = None): """ - :param float delay: + :param delay: The delay used in the connection; by default 1 time step """ # Store the sources to avoid recalculation diff --git a/spynnaker/pyNN/models/neuron/neuron_data.py b/spynnaker/pyNN/models/neuron/neuron_data.py index cc3bbb37a79..af24c9f5a07 100644 --- a/spynnaker/pyNN/models/neuron/neuron_data.py +++ b/spynnaker/pyNN/models/neuron/neuron_data.py @@ -141,7 +141,7 @@ def write_data(self, spec: DataSpecificationBase, vertex_slice: Slice, :param spec: The data specification to write to :param vertex_slice: The vertex slice to generate for - :param euron_regions: The regions to write to + :param neuron_regions: The regions to write to :param gen_on_machine: Whether to allow generation on machine """ if gen_on_machine: @@ -253,7 +253,7 @@ def __get_neuron_builder_header( :param vertex_slice: The slice to put in the header :param n_structs: The number of structures to generate - :param NeuronRegions neuron_regions: The regions to point to + :param neuron_regions: The regions to point to """ return numpy.array([ neuron_regions.neuron_params, diff --git a/spynnaker/pyNN/models/neuron/neuron_models/neuron_model_if_trunc.py b/spynnaker/pyNN/models/neuron/neuron_models/neuron_model_if_trunc.py index 73c6d2da8e4..e73ce3f6c64 100644 --- a/spynnaker/pyNN/models/neuron/neuron_models/neuron_model_if_trunc.py +++ b/spynnaker/pyNN/models/neuron/neuron_models/neuron_model_if_trunc.py @@ -52,7 +52,6 @@ def __init__( tau_refrac: ModelParameter): r""" :param v_init: :math:`V_{init}` - :param v_rest: :math:`V_{rest}` :param tau_m: :math:`\tau_{m}` :param cm: :math:`C_m` :param i_offset: :math:`I_{offset}` diff --git a/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_spike_nearest_pair.py b/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_spike_nearest_pair.py index f4f588a0441..cb5c9d7ac47 100644 --- a/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_spike_nearest_pair.py +++ b/spynnaker/pyNN/models/neuron/plasticity/stdp/timing_dependence/timing_dependence_spike_nearest_pair.py @@ -47,10 +47,10 @@ class TimingDependenceSpikeNearestPair(AbstractTimingDependence): def __init__(self, tau_plus: float = 20.0, tau_minus: float = 20.0, A_plus: float = 0.01, A_minus: float = 0.01): r""" - :param float tau_plus: :math:`\tau_+` - :param float tau_minus: :math:`\tau_-` - :param float A_plus: :math:`A^+` - :param float A_minus: :math:`A^-` + :param tau_plus: :math:`\tau_+` + :param tau_minus: :math:`\tau_-` + :param A_plus: :math:`A^+` + :param A_minus: :math:`A^-` """ super().__init__(SynapseStructureWeightOnly()) self.__tau_plus = tau_plus @@ -66,8 +66,6 @@ def __init__(self, tau_plus: float = 20.0, tau_minus: float = 20.0, def tau_plus(self) -> float: r""" :math:`\tau_+` - - :rtype: float """ return self.__tau_plus @@ -75,8 +73,6 @@ def tau_plus(self) -> float: def tau_minus(self) -> float: r""" :math:`\tau_-` - - :rtype: float """ return self.__tau_minus @@ -84,8 +80,6 @@ def tau_minus(self) -> float: def A_plus(self) -> float: r""" :math:`A^+` - - :rtype: float """ return self.__a_plus @@ -97,8 +91,6 @@ def A_plus(self, new_value: float) -> None: def A_minus(self) -> float: r""" :math:`A^-` - - :rtype: float """ return self.__a_minus @@ -118,8 +110,6 @@ def is_same_as( def vertex_executable_suffix(self) -> str: """ The suffix to be appended to the vertex executable for this rule. - - :rtype: str """ return "nearest_pair" @@ -127,8 +117,6 @@ def vertex_executable_suffix(self) -> str: def pre_trace_n_bytes(self) -> int: """ The number of bytes used by the pre-trace of the rule per neuron. - - :rtype: int """ # Pair rule requires no pre-synaptic trace when only the nearest # Neighbours are considered and, a single 16-bit R1 trace @@ -143,8 +131,6 @@ def get_parameters_sdram_usage_in_bytes(self) -> int: def n_weight_terms(self) -> int: """ The number of weight terms expected by this timing rule. - - :rtype: int """ return 1 diff --git a/spynnaker/pyNN/models/neuron/population_machine_common.py b/spynnaker/pyNN/models/neuron/population_machine_common.py index 31b8a68a7a3..e3b16c5cd1c 100644 --- a/spynnaker/pyNN/models/neuron/population_machine_common.py +++ b/spynnaker/pyNN/models/neuron/population_machine_common.py @@ -85,19 +85,16 @@ def __init__( n_provenance_items: int, profile_tags: Mapping[int, str], binary_file_name: str): """ - :param str label: The label of the vertex - :param PopulationVertex app_vertex: - The associated application vertex - :param ~pacman.model.graphs.common.Slice vertex_slice: - The slice of the population that this implements - :param ~pacman.model.resources.AbstractSDRAM sdram: - The SDRAM used by the vertex - :param .CommonRegions regions: The regions to be assigned - :param int n_provenance_items: + :param label: The label of the vertex + :param app_vertex: The associated application vertex + :param vertex_slice: The slice of the population that this implements + :param sdram: The SDRAM used by the vertex + :param regions: The regions to be assigned + :param n_provenance_items: The number of additional provenance items to be read - :param dict(int,str) profile_tags: + :param profile_tags: A mapping of profile identifiers to names - :param str binary_file_name: The name of the binary file + :param binary_file_name: The name of the binary file """ super().__init__(label, app_vertex, vertex_slice) self.__sdram = sdram @@ -145,9 +142,9 @@ def _write_common_data_spec( """ Write the data specification for the common regions. - :param ~data_specification.DataSpecificationGenerator spec: + :param spec: The data specification to write to - :param list(int) rec_regions: + :param rec_regions: A list of sizes of each recording region (including empty ones) """ # Write the setup region diff --git a/spynnaker/pyNN/models/neuron/population_machine_local_only_combined_vertex.py b/spynnaker/pyNN/models/neuron/population_machine_local_only_combined_vertex.py index ed117ed1f5a..5ffaed3f4af 100644 --- a/spynnaker/pyNN/models/neuron/population_machine_local_only_combined_vertex.py +++ b/spynnaker/pyNN/models/neuron/population_machine_local_only_combined_vertex.py @@ -160,8 +160,6 @@ def __init__( The shifts to apply to convert ring buffer values to S1615 values :param weight_scales: The scaling to apply to weights to store them in the synapses - :param all_syn_block_sz: The maximum size of the synapses in bytes - :param structural_sz: The size of the structural data :param neuron_data: The handler of neuron data :param max_atoms_per_core: diff --git a/spynnaker/pyNN/models/neuron/population_machine_neurons.py b/spynnaker/pyNN/models/neuron/population_machine_neurons.py index d15b0b6a33f..5c0bee9b7d4 100644 --- a/spynnaker/pyNN/models/neuron/population_machine_neurons.py +++ b/spynnaker/pyNN/models/neuron/population_machine_neurons.py @@ -91,8 +91,6 @@ def _pop_vertex(self) -> PopulationVertex: .. note:: This is likely to be available via the MachineVertex. - - :rtype: PopulationVertex """ raise NotImplementedError @@ -242,8 +240,6 @@ def _rewrite_neuron_data_spec( Re-Write the data specification of the neuron data. :param spec: The data specification to write to - :param ring_buffer_shifts: - The shifts to apply to convert ring buffer values to S1615 values """ # Write the current source parameters self._write_current_source_parameters(spec) diff --git a/spynnaker/pyNN/models/neuron/population_machine_synapses.py b/spynnaker/pyNN/models/neuron/population_machine_synapses.py index df1ebf3e08f..42fc9958b00 100644 --- a/spynnaker/pyNN/models/neuron/population_machine_synapses.py +++ b/spynnaker/pyNN/models/neuron/population_machine_synapses.py @@ -69,8 +69,6 @@ def _pop_vertex(self) -> PopulationVertex: .. note:: This is likely to be available via the MachineVertex. - - :rtype: PopulationVertex """ raise NotImplementedError @@ -87,8 +85,6 @@ def vertex_slice(self) -> Slice: def _synaptic_matrices(self) -> SynapticMatrices: """ The object holding synaptic matrices. - - :rtype: SynapticMatrices """ raise NotImplementedError @@ -97,8 +93,6 @@ def _synaptic_matrices(self) -> SynapticMatrices: def _synapse_regions(self) -> SynapseRegions: """ The identifiers of synaptic regions. - - :rtype: .SynapseRegions """ raise NotImplementedError @@ -107,8 +101,6 @@ def _synapse_regions(self) -> SynapseRegions: def _max_atoms_per_core(self) -> int: """ The maximum number of atoms on any core targeted by these synapses. - - :rtype: int """ raise NotImplementedError @@ -123,8 +115,6 @@ def set_do_synapse_regeneration(self) -> None: def _synapse_references(self) -> SynapseRegionReferences: """ The references to synapse regions. Override to provide these. - - :rtype: .SynapseRegionReferences """ return SynapseRegionReferences() @@ -152,13 +142,12 @@ def _write_synapse_data_spec( """ Write the data specification for the synapse data. - :param ~data_specification.DataSpecificationGenerator spec: - The data specification to write to - :param list(int) ring_buffer_shifts: + :param spec: The data specification to write to + :param ring_buffer_shifts: The shifts to apply to convert ring buffer values to S1615 values - :param list(int) weight_scales: + :param weight_scales: The scaling to apply to weights to store them in the synapses - :param int structural_sz: The size of the structural data + :param structural_sz: The size of the structural data """ # Write the synapse parameters self._write_synapse_parameters(spec, ring_buffer_shifts) @@ -209,9 +198,8 @@ def _write_synapse_parameters( """ Write the synapse parameters data region. - :param ~data_specification.DataSpecificationGenerator spec: - The data specification to write to - :param list(int) ring_buffer_shifts: + :param spec: The data specification to write to + :param ring_buffer_shifts: The shifts to apply to convert ring buffer values to S1615 values """ # Reserve space diff --git a/spynnaker/pyNN/models/neuron/population_machine_synapses_provenance.py b/spynnaker/pyNN/models/neuron/population_machine_synapses_provenance.py index ad9bab02bf3..4d9a48cbd0d 100644 --- a/spynnaker/pyNN/models/neuron/population_machine_synapses_provenance.py +++ b/spynnaker/pyNN/models/neuron/population_machine_synapses_provenance.py @@ -73,11 +73,11 @@ def _parse_synapse_provenance( """ Extract and yield synapse provenance. - :param str label: The label of the node - :param int x: x coordinate of the chip where this core - :param int y: y coordinate of the core where this core - :param int p: virtual id of the core - :param list(int) provenance_data: A list of data items to interpret + :param label: The label of the node + :param x: x coordinate of the chip where this core + :param y: y coordinate of the core where this core + :param p: virtual id of the core + :param provenance_data: A list of data items to interpret """ synapse_prov = SynapseProvenance(*provenance_data) diff --git a/spynnaker/pyNN/models/neuron/population_machine_vertex.py b/spynnaker/pyNN/models/neuron/population_machine_vertex.py index dd6b37f41f7..27235a76227 100644 --- a/spynnaker/pyNN/models/neuron/population_machine_vertex.py +++ b/spynnaker/pyNN/models/neuron/population_machine_vertex.py @@ -174,23 +174,22 @@ def __init__( max_atoms_per_core: int, synaptic_matrices: SynapticMatrices, neuron_data: NeuronData): """ - :param ~pacman.model.resources.AbstractSDRAM sdram: + :param sdram: The SDRAM used by the vertex - :param str label: The label of the vertex - :param PopulationVertex app_vertex: + :param label: The label of the vertex + :param app_vertex: The associated application vertex - :param ~pacman.model.graphs.common.Slice vertex_slice: + :param vertex_slice: The slice of the population that this implements - :param int slice_index: + :param slice_index: The index of the slice in the ordered list of slices - :param list(int) ring_buffer_shifts: + :param ring_buffer_shifts: The shifts to apply to convert ring buffer values to S1615 values - :param list(int) weight_scales: + :param weight_scales: The scaling to apply to weights to store them in the synapses - :param int structural_sz: The size of the structural data - :param int n_neuron_bits: The number of bits to use for neuron IDs - :param SynapticMatrices synaptic_matrices: The synaptic matrices - :param NeuronData neuron_data: The handler of neuron data + :param structural_sz: The size of the structural data + :param synaptic_matrices: The synaptic matrices + :param neuron_data: The handler of neuron data """ super().__init__( label, app_vertex, vertex_slice, sdram, @@ -353,11 +352,11 @@ def _parse_spike_processing_provenance( """ Extract and yield spike processing provenance. - :param str label: The label of the node - :param int x: x coordinate of the chip where this core - :param int y: y coordinate of the core where this core - :param int p: virtual id of the core - :param list(int) provenance_data: A list of data items to interpret + :param label: The label of the node + :param x: x coordinate of the chip where this core + :param y: y coordinate of the core where this core + :param p: virtual id of the core + :param provenance_data: A list of data items to interpret """ prov = SpikeProcessingProvenance(*provenance_data) diff --git a/spynnaker/pyNN/models/neuron/population_neurons_machine_vertex.py b/spynnaker/pyNN/models/neuron/population_neurons_machine_vertex.py index d3cfa07c306..082102074e8 100644 --- a/spynnaker/pyNN/models/neuron/population_neurons_machine_vertex.py +++ b/spynnaker/pyNN/models/neuron/population_neurons_machine_vertex.py @@ -125,23 +125,18 @@ def __init__( weight_scales: NDArray[floating], neuron_data: NeuronData, max_atoms_per_core: int): """ - :param ~pacman.model.resources.AbstractSDRAM sdram: - The SDRAM used by the vertex - :param str label: The label of the vertex - :param PopulationVertex app_vertex: - The associated application vertex - :param ~pacman.model.graphs.common.Slice vertex_slice: - The slice of the population that this implements - :param int slice_index: + :param sdram: The SDRAM used by the vertex + :param label: The label of the vertex + :param app_vertex: The associated application vertex + :param vertex_slice: The slice of the population that this implements + :param slice_index: The index of the slice in the ordered list of slices - :param list(int) ring_buffer_shifts: + :param ring_buffer_shifts: The shifts to apply to convert ring buffer values to S1615 values - :param list(int) weight_scales: + :param weight_scales: The scaling to apply to weights to store them in the synapses - :param NeuronData neuron_data: - The handler of neuron data - :param int max_atoms_per_core: - The maximum number of atoms per core + :param neuron_data: The handler of neuron data + :param max_atoms_per_core: The maximum number of atoms per core """ super().__init__( label, app_vertex, vertex_slice, sdram, self.COMMON_REGIONS, @@ -287,9 +282,8 @@ def get_n_bytes_for_transfer(n_neurons: int, n_synapse_types: int) -> int: """ Calculate the number of bytes needed for a transfer. - :param int n_neurons: number of neurons - :param int n_synapse_types: number of synapse types - :rtype: int + :param n_neurons: number of neurons + :param n_synapse_types: number of synapse types """ n_bytes = (2 ** get_n_bits(n_neurons) * n_synapse_types * diff --git a/spynnaker/pyNN/models/neuron/population_synapses_machine_vertex_common.py b/spynnaker/pyNN/models/neuron/population_synapses_machine_vertex_common.py index 4bba6481081..e7b7fff6581 100644 --- a/spynnaker/pyNN/models/neuron/population_synapses_machine_vertex_common.py +++ b/spynnaker/pyNN/models/neuron/population_synapses_machine_vertex_common.py @@ -160,13 +160,10 @@ def __init__( self, sdram: AbstractSDRAM, label: str, app_vertex: PopulationVertex, vertex_slice: Slice): """ - :param ~pacman.model.resources.AbstractSDRAM sdram: - The SDRAM used by the vertex - :param str label: The label of the vertex - :param PopulationVertex app_vertex: - The associated application vertex - :param ~pacman.model.graphs.common.Slice vertex_slice: - The slice of the population that this implements + :param sdram: The SDRAM used by the vertex + :param label: The label of the vertex + :param app_vertex: The associated application vertex + :param vertex_slice: The slice of the population that this implements """ super().__init__( label, app_vertex, vertex_slice, sdram, self.COMMON_REGIONS, @@ -192,9 +189,6 @@ def set_neuron_vertex_and_partition_id( """ Set the neuron vertex and partition ID for the case with a self-connection. - - :param ~pacman.model.graphs.machine.MachineEdge neuron_to_synapse_edge: - The edge that we will receive spikes from """ self.__neuron_vertex = neuron_vertex self.__partition_id = partition_id @@ -210,8 +204,7 @@ def _write_sdram_edge_spec(self, spec: DataSpecificationGenerator) -> None: """ Write information about SDRAM Edge. - :param DataSpecificationGenerator spec: - The generator of the specification to write + :param spec: The generator of the specification to write """ assert self.__sdram_partition is not None send_size = self.__sdram_partition.get_sdram_size_of_region_for(self) @@ -231,8 +224,7 @@ def _write_key_spec(self, spec: DataSpecificationGenerator) -> None: """ Write key configuration region. - :param DataSpecificationGenerator spec: - The generator of the specification to write + :param spec: The generator of the specification to write """ spec.reserve_memory_region( region=self.REGIONS.KEY_REGION, size=KEY_CONFIG_SIZE, @@ -282,11 +274,11 @@ def _parse_synapse_provenance( """ Extract and yield synapse provenance. - :param str label: The label of the node - :param int x: x coordinate of the chip where this core - :param int y: y coordinate of the core where this core - :param int p: virtual id of the core - :param list(int) provenance_data: A list of data items to interpret + :param label: The label of the node + :param x: x coordinate of the chip where this core + :param y: y coordinate of the core where this core + :param p: virtual id of the core + :param provenance_data: A list of data items to interpret """ raise NotImplementedError @@ -296,11 +288,11 @@ def _parse_spike_processing_fast_provenance( """ Extract and yield spike processing provenance. - :param str label: The label of the node - :param int x: x coordinate of the chip where this core - :param int y: y coordinate of the core where this core - :param int p: virtual id of the core - :param list(int) provenance_data: A list of data items to interpret + :param label: The label of the node + :param x: x coordinate of the chip where this core + :param y: y coordinate of the core where this core + :param p: virtual id of the core + :param provenance_data: A list of data items to interpret """ prov = SpikeProcessingFastProvenance(*provenance_data) diff --git a/spynnaker/pyNN/models/neuron/population_synapses_machine_vertex_lead.py b/spynnaker/pyNN/models/neuron/population_synapses_machine_vertex_lead.py index 5281922bd37..ee01de6fde6 100644 --- a/spynnaker/pyNN/models/neuron/population_synapses_machine_vertex_lead.py +++ b/spynnaker/pyNN/models/neuron/population_synapses_machine_vertex_lead.py @@ -66,13 +66,10 @@ def __init__( synapse_references: SynapseRegionReferences, max_atoms_per_core: int, synaptic_matrices: SynapticMatrices): """ - :param ~pacman.model.resources.AbstractSDRAM sdram: - The SDRAM used by the vertex - :param str label: The label of the vertex - :param PopulationVertex app_vertex: - The associated application vertex - :param ~pacman.model.graphs.common.Slice vertex_slice: - The slice of the population that this implements + :param sdram: The SDRAM used by the vertex + :param label: The label of the vertex + :param app_vertex: The associated application vertex + :param vertex_slice: The slice of the population that this implements """ super().__init__( sdram, label, app_vertex, vertex_slice) diff --git a/spynnaker/pyNN/models/neuron/population_synapses_machine_vertex_shared.py b/spynnaker/pyNN/models/neuron/population_synapses_machine_vertex_shared.py index 5fb5e596250..9072c16e755 100644 --- a/spynnaker/pyNN/models/neuron/population_synapses_machine_vertex_shared.py +++ b/spynnaker/pyNN/models/neuron/population_synapses_machine_vertex_shared.py @@ -45,13 +45,10 @@ def __init__( app_vertex: PopulationVertex, vertex_slice: Slice, synapse_references: SynapseRegionReferences): """ - :param ~pacman.model.resources.AbstractSDRAM sdram: - The SDRAM used by the vertex - :param str label: The label of the vertex - :param PopulationVertex app_vertex: - The associated application vertex - :param ~pacman.model.graphs.common.Slice vertex_slice: - The slice of the population that this implements + :param sdram: The SDRAM used by the vertex + :param label: The label of the vertex + :param app_vertex: The associated application vertex + :param vertex_slice: The slice of the population that this implements """ super().__init__(sdram, label, app_vertex, vertex_slice) self.__synapse_references = synapse_references diff --git a/spynnaker/pyNN/models/neuron/population_vertex.py b/spynnaker/pyNN/models/neuron/population_vertex.py index 71f28d25edd..55ac3131375 100644 --- a/spynnaker/pyNN/models/neuron/population_vertex.py +++ b/spynnaker/pyNN/models/neuron/population_vertex.py @@ -141,8 +141,6 @@ def _all_gen(rd: RangeDictionary) -> bool: """ Determine if all the values of a ranged dictionary can be generated. - - :rtype: bool """ for key in rd.keys(): if is_singleton(rd[key]): @@ -519,8 +517,6 @@ def synapse_core_binary_file_name(self) -> str: def combined_binary_exists(self) -> bool: """ Whether the combined binary file exists. - - :rtype: bool """ # If we are in virtual machine mode, we can work without binaries # so easier to assume they exist @@ -537,8 +533,6 @@ def combined_binary_exists(self) -> bool: def split_binaries_exist(self) -> bool: """ Whether the split binary files exist. - - :rtype: bool """ # If we are in virtual machine mode, we can work without binaries # so easier to assume they exist @@ -559,8 +553,6 @@ def use_combined_core(self) -> bool: Whether the vertex should operate on a combined neuron-synapse core, or if a split synapse-core is more appropriate. - - :rtype: bool """ # If there are no binaries at all, complain! if not self.combined_binary_exists and not self.split_binaries_exist: @@ -669,8 +661,6 @@ def n_synapse_cores_required(self) -> int: """ The estimated number of synapse cores required, when using a split synapse-neuron core model. - - :rtype: int """ return self.__update_n_synapse_cores() @@ -838,8 +828,6 @@ def synapse_dynamics(self) -> AbstractSynapseDynamics: """ The synapse dynamics used by the synapses e.g. plastic or static. Settable. - - :rtype: AbstractSynapseDynamics """ return self.__synapse_dynamics @@ -853,8 +841,7 @@ def synapse_dynamics( After setting, the dynamics might not be the type set as it can be combined with the existing dynamics in exciting ways. - :param AbstractSynapseDynamics synapse_dynamics: - The synapse dynamics to set + :param synapse_dynamics: The synapse dynamics to set """ merged = self.__synapse_dynamics.merge(synapse_dynamics) assert isinstance(merged, ( @@ -866,8 +853,7 @@ def add_incoming_projection(self, projection: Projection) -> None: """ Add a projection incoming to this vertex. - :param ~spynnaker.pyNN.models.projection.Projection projection: - The new projection to add + :param projection: The new projection to add """ # Reset the ring buffer shifts as a projection has been added SpynnakerDataView.set_requires_mapping() @@ -887,8 +873,6 @@ def add_incoming_projection(self, projection: Projection) -> None: def self_projection(self) -> Optional[Projection]: """ Any projection from this vertex to itself. - - :rtype: ~spynnaker.pyNN.models.projection.Projection or None """ return self.__self_projection @@ -908,8 +892,6 @@ def atoms_shape(self) -> Tuple[int, ...]: def size(self) -> int: """ The number of neurons in the vertex. - - :rtype: int """ return self.__n_atoms @@ -917,8 +899,6 @@ def size(self) -> int: def incoming_spike_buffer_size(self) -> int: """ The size of the incoming spike buffer to be used on the cores. - - :rtype: int """ return self.__incoming_spike_buffer_size @@ -926,8 +906,6 @@ def incoming_spike_buffer_size(self) -> int: def parameters(self) -> RangeDictionary[float]: """ The parameters of the neurons in the population. - - :rtype: ~spinn_utilities.ranged.RangeDictionary """ return self.__parameters @@ -935,8 +913,6 @@ def parameters(self) -> RangeDictionary[float]: def state_variables(self) -> RangeDictionary[float]: """ The state variables of the neuron in the population. - - :rtype: ~spinn_utilities.ranged.RangeDictionary """ return self.__state_variables @@ -944,8 +920,6 @@ def state_variables(self) -> RangeDictionary[float]: def initial_state_variables(self) -> RangeDictionary[float]: """ The initial values of the state variables of the neurons. - - :rtype: ~spinn_utilities.ranged.RangeDictionary """ return self.__initial_state_variables @@ -953,8 +927,6 @@ def initial_state_variables(self) -> RangeDictionary[float]: def neuron_impl(self) -> AbstractNeuronImpl: """ The neuron implementation. - - :rtype: AbstractNeuronImpl """ return self.__neuron_impl @@ -962,8 +934,6 @@ def neuron_impl(self) -> AbstractNeuronImpl: def n_profile_samples(self) -> int: """ The maximum number of profile samples to report. - - :rtype: int """ return self.__n_profile_samples @@ -971,8 +941,6 @@ def n_profile_samples(self) -> int: def neuron_recorder(self) -> NeuronRecorder: """ The recorder for neurons. - - :rtype: NeuronRecorder """ return self.__neuron_recorder @@ -980,8 +948,6 @@ def neuron_recorder(self) -> NeuronRecorder: def synapse_recorder(self) -> NeuronRecorder: """ The recorder for synapses. - - :rtype: NeuronRecorder """ return self.__synapse_recorder @@ -989,16 +955,13 @@ def synapse_recorder(self) -> NeuronRecorder: def drop_late_spikes(self) -> bool: """ Whether spikes should be dropped if not processed in a timestep. - - :rtype: bool """ return self.__drop_late_spikes def get_sdram_usage_for_core_neuron_params(self, n_atoms: int) -> int: """ - :param int n_atoms: The number of atoms per core + :param n_atoms: The number of atoms per core :return: The SDRAM required for the core neuron parameters - :rtype: int """ return ( self.CORE_PARAMS_BASE_SIZE + @@ -1010,9 +973,8 @@ def get_sdram_usage_for_neuron_params(self, n_atoms: int) -> int: """ Calculate the SDRAM usage for just the neuron parameters region. - :param int n_atoms: The number of atoms per core + :param n_atoms: The number of atoms per core :return: The SDRAM required for the neuron region - :rtype: int """ return sum(s.get_size_in_whole_words(n_atoms) if s.repeat_type == StructRepeat.PER_NEURON @@ -1023,9 +985,8 @@ def get_sdram_usage_for_neuron_generation(self, n_atoms: int) -> int: """ Calculate the SDRAM usage for the neuron generation region. - :param int n_atoms: The number of atoms per core + :param n_atoms: The number of atoms per core :return: The SDRAM required for the neuron generator region - :rtype: int """ return (self.__get_sdram_usage_for_neuron_struct_generation(n_atoms) + self.__neuron_recorder.get_generator_sdram_usage_in_bytes( @@ -1036,9 +997,8 @@ def __get_sdram_usage_for_neuron_struct_generation( """ Calculate the SDRAM usage for the neuron struct generation region. - :param int n_atoms: The number of atoms per core + :param n_atoms: The number of atoms per core :return: The SDRAM required for the neuron generator region - :rtype: int """ # Uses nothing if not generatable structs = self.__neuron_impl.structs @@ -1061,9 +1021,8 @@ def get_sdram_usage_for_current_source_params(self, n_atoms: int) -> int: """ Calculate the SDRAM usage for the current source parameters region. - :param int n_atoms: The number of atoms to account for + :param n_atoms: The number of atoms to account for :return: The SDRAM required for the current source region - :rtype: int """ # If non at all, just output size of 0 declaration if not self.__current_sources: @@ -1299,14 +1258,14 @@ def get_neurons_recording( @property def weight_scale(self) -> float: """ - :rtype: float + Get the weight scaling required by the implementaion. """ return self.__neuron_impl.get_global_weight_scale() @property def ring_buffer_sigma(self) -> float: """ - :rtype: float + How many SD above the mean to go for upper bound of ring buffer size """ return self.__ring_buffer_sigma @@ -1317,7 +1276,9 @@ def ring_buffer_sigma(self, ring_buffer_sigma: float) -> None: @property def spikes_per_second(self) -> float: """ - :rtype: float + Expected spike rate. + + Comes from value passed into init otherwise cfg file """ return self.__spikes_per_second @@ -1330,8 +1291,7 @@ def set_synapse_dynamics( """ Set the synapse dynamics of this population. - :param AbstractSynapseDynamics synapse_dynamics: - The synapse dynamics to set + :param synapse_dynamics: The synapse dynamics to set """ self.synapse_dynamics = synapse_dynamics @@ -1351,8 +1311,6 @@ def describe(self) -> Dict[str, Union[str, Dict[str, Any]]]: If template is `None`, then a dictionary containing the template context will be returned. - - :rtype: dict(str, any) """ parameters = dict(self.get_parameter_values( self.__pynn_model.default_parameters.keys())) @@ -1369,8 +1327,7 @@ def get_synapse_id_by_target(self, target: str) -> Optional[int]: """ Get the id of synapse using its target name. - :param str target: The synapse to get the id of - :rtype: int + :param target: The synapse to get the id of """ return self.__neuron_impl.get_synapse_id_by_target(target) @@ -1390,8 +1347,6 @@ def inject( def current_sources(self) -> List[AbstractCurrentSource]: """ Current sources needed to be available to machine vertex. - - :rtype: list(AbstractCurrentSource) """ return self.__current_sources @@ -1399,8 +1354,6 @@ def current_sources(self) -> List[AbstractCurrentSource]: def current_source_id_list(self) -> Dict[AbstractCurrentSource, Selector]: """ Current source ID list needed to be available to machine vertex. - - :rtype: dict(AbstractCurrentSource,any) """ return self.__current_source_id_list @@ -1428,8 +1381,6 @@ def get_ring_buffer_shifts(self) -> List[int]: """ Get the shift of the ring buffers for transfer of values into the input buffers for this model. - - :rtype: list(int) """ n_synapse_types = self.__neuron_impl.get_n_synapse_types() max_weights = numpy.zeros(n_synapse_types) @@ -1473,8 +1424,7 @@ def __get_weight_scale(ring_buffer_to_input_left_shift: int) -> float: shifted left by ring_buffer_to_input_left_shift to produce an s1615 fixed point number. - :param int ring_buffer_to_input_left_shift: - :rtype: float + :param ring_buffer_to_input_left_shift: """ return float(math.pow(2, 16 - (ring_buffer_to_input_left_shift + 1))) @@ -1484,9 +1434,7 @@ def get_weight_scales( """ Get the weight scaling to apply to weights in synapses. - :param list(int) ring_buffer_shifts: - The shifts to convert to weight scales - :rtype: list(int) + :param ring_buffer_shifts: The shifts to convert to weight scales """ weight_scale = self.__neuron_impl.get_global_weight_scale() return numpy.array([ @@ -1520,8 +1468,6 @@ def get_connections_from_machine( def get_synapse_params_size(self) -> int: """ Get the size of the synapse parameters, in bytes. - - :rtype: int """ # This will only hold ring buffer scaling for the neuron synapse # types @@ -1531,8 +1477,6 @@ def get_synapse_params_size(self) -> int: def get_synapse_dynamics_size(self, n_atoms: int) -> int: """ Get the size of the synapse dynamics region, in bytes. - - :rtype: int """ if isinstance(self.__synapse_dynamics, AbstractLocalOnly): return self.__synapse_dynamics.get_parameters_usage_in_bytes( @@ -1545,9 +1489,7 @@ def get_structural_dynamics_size(self, n_atoms: int) -> int: """ Get the size of the structural dynamics region, in bytes. - :param int n_atoms: - The number of atoms in the slice - :rtype: int + :param n_atoms: The number of atoms in the slice """ if not _is_structural(self.__synapse_dynamics): return 0 @@ -1560,12 +1502,7 @@ def get_synapses_size(self, n_post_atoms: int) -> int: """ Get the maximum SDRAM usage for the synapses on a vertex slice. - :param int n_post_atoms: The number of atoms projected to - :param incoming_projections: - The projections to consider in the calculations - :type incoming_projections: - list(~spynnaker.pyNN.models.projection.Projection) - :rtype: int + :param n_post_atoms: The number of atoms projected to """ if isinstance(self.__synapse_dynamics, AbstractLocalOnly): return 0 @@ -1580,11 +1517,9 @@ def __add_matrix_size(self, address: int, projection: Projection, Add to the address the size of the matrices for the projection to the vertex slice. - :param int address: The address to start from - :param ~spynnaker.pyNN.models.projection.Projection: - The projection to add - :param int n_post_atoms: The number of atoms projected to - :rtype: int + :param address: The address to start from + :param projection: The projection to add + :param n_post_atoms: The number of atoms projected to """ # pylint: disable=protected-access synapse_info = projection._synapse_information @@ -1631,10 +1566,9 @@ def get_max_row_info( """ Get maximum row length data. - :param SynapseInformation synapse_info: Information about synapses - :param int n_post_atoms: The number of atoms projected to - :param ProjectionApplicationEdge app_edge: The edge of the projection - :rtype: MaxRowInfo + :param synapse_info: Information about synapses + :param n_post_atoms: The number of atoms projected to + :param app_edge: The edge of the projection """ key = (app_edge, synapse_info, n_post_atoms) if key in self.__max_row_info: @@ -1647,8 +1581,6 @@ def get_max_row_info( def get_synapse_expander_size(self) -> int: """ Get the size of the synapse expander region, in bytes. - - :rtype: int """ size = SYNAPSES_BASE_GENERATOR_SDRAM_USAGE_IN_BYTES size += (self.__neuron_impl.get_n_synapse_types() * @@ -1673,8 +1605,7 @@ def __generator_info_size(synapse_info: SynapseInformation) -> int: """ The number of bytes required by the generator information. - :param SynapseInformation synapse_info: The synapse information to use - :rtype: int + :param synapse_info: The synapse information to use """ if not synapse_info.may_generate_on_machine(): return 0 @@ -1694,8 +1625,6 @@ def __generator_info_size(synapse_info: SynapseInformation) -> int: def synapse_executable_suffix(self) -> str: """ The suffix of the executable name due to the type of synapses in use. - - :rtype: str """ return self.__synapse_dynamics.get_vertex_executable_suffix() @@ -1703,8 +1632,6 @@ def synapse_executable_suffix(self) -> str: def neuron_recordables(self) -> List[str]: """ The names of variables that can be recorded by the neuron. - - :rtype: list(str) """ return self.__neuron_recorder.get_recordable_variables() @@ -1712,8 +1639,6 @@ def neuron_recordables(self) -> List[str]: def synapse_recordables(self) -> List[str]: """ The names of variables that can be recorded by the synapses. - - :rtype: list(str) """ return self.__synapse_recorder.get_recordable_variables() @@ -1723,10 +1648,9 @@ def get_common_constant_sdram( """ Get the amount of SDRAM used by common parts. - :param int n_record: The number of recording regions - :param int n_provenance: The number of provenance items - :param CommonRegions common_regions: Region IDs - :rtype: MultiRegionSDRAM + :param n_record: The number of recording regions + :param n_provenance: The number of provenance items + :param common_regions: Region IDs """ sdram = MultiRegionSDRAM() sdram.add_cost(common_regions.system, SYSTEM_BYTES_REQUIREMENT) @@ -1747,17 +1671,13 @@ def get_neuron_variable_sdram(self, vertex_slice: Slice) -> AbstractSDRAM: """ Get the amount of SDRAM per timestep used by neuron parts. - :param ~pacman.model.graphs.common.Slice vertex_slice: - The slice of neurons to get the size of - :rtype: int + :param vertex_slice: The slice of neurons to get the size of """ return self.__neuron_recorder.get_variable_sdram_usage(vertex_slice) def get_max_neuron_variable_sdram(self, n_neurons: int) -> AbstractSDRAM: """ Get the amount of SDRAM per timestep used by neuron parts. - - :rtype: int """ return self.__neuron_recorder.get_max_variable_sdram_usage(n_neurons) @@ -1765,9 +1685,7 @@ def get_synapse_variable_sdram(self, vertex_slice: Slice) -> AbstractSDRAM: """ Get the amount of SDRAM per timestep used by synapse parts. - :param ~pacman.model.graphs.common.Slice vertex_slice: - The slice of neurons to get the size of - :rtype: int + :param vertex_slice: The slice of neurons to get the size of """ if _is_structural(self.__synapse_dynamics): self.__synapse_recorder.set_max_rewires_per_ts( @@ -1777,8 +1695,6 @@ def get_synapse_variable_sdram(self, vertex_slice: Slice) -> AbstractSDRAM: def get_max_synapse_variable_sdram(self, n_neurons: int) -> AbstractSDRAM: """ Get the amount of SDRAM per timestep used by synapse parts. - - :rtype: int """ if _is_structural(self.__synapse_dynamics): self.__synapse_recorder.set_max_rewires_per_ts( @@ -1791,8 +1707,7 @@ def get_neuron_constant_sdram( """ Get the amount of fixed SDRAM used by neuron parts. - :param NeuronRegions neuron_regions: Region IDs - :rtype: int + :param Region IDs """ params_cost = self.get_sdram_usage_for_neuron_params(n_atoms) sdram = MultiRegionSDRAM() @@ -1817,8 +1732,6 @@ def get_neuron_constant_sdram( def incoming_projections(self) -> Iterable[Projection]: """ The projections that target this population vertex. - - :rtype: iterable(~spynnaker.pyNN.models.projection.Projection) """ for proj_list in self.__incoming_projections.values(): yield from proj_list @@ -1829,8 +1742,6 @@ def get_incoming_projections_from( """ The projections that target this population vertex from the given source. - - :rtype: iterable(~spynnaker.pyNN.models.projection.Projection) """ return self.__incoming_projections[source_vertex] @@ -1848,8 +1759,6 @@ def incoming_poisson_projections(self) -> Sequence[Projection]: def pop_seed(self) -> Sequence[int]: """ The seed to use for the population overall; a list of four integers. - - :rtype: list(int) """ return self.__pop_seed @@ -1857,10 +1766,8 @@ def core_seed(self, vertex_slice: Slice) -> Sequence[int]: """ The seed to use for a core. - :param ~pacman.model.graphs.common.Slice vertex_slice: - The machine vertex that the seed is for + :param vertex_slice: The machine vertex that the seed is for :return: A list of 4 integers - :rtype: list(int) """ if vertex_slice not in self.__core_seeds: self.__core_seeds[vertex_slice] = create_mars_kiss_seeds( @@ -1871,8 +1778,7 @@ def copy_initial_state_variables(self, vertex_slice: Slice) -> None: """ Copies the state variables into the initial state variables. - :param ~pacman.model.graphs.common.Slice vertex_slice: - The slice to copy now + :param vertex_slice: The slice to copy now """ for key in self.__state_variables.keys(): value = self.__state_variables[key][vertex_slice.get_raster_ids()] @@ -1887,8 +1793,6 @@ def copy_initial_state_variables(self, vertex_slice: Slice) -> None: def read_initial_values(self) -> bool: """ Whether initial values need to be stored. - - :rtype: bool """ return self.__read_initial_values @@ -1904,7 +1808,7 @@ def n_colour_bits(self) -> int: def get_n_atom_bits(self) -> int: """ - :rtype: int + How many bits are required """ return get_n_bits(min(self.n_atoms, self.get_max_atoms_per_core())) @@ -1912,8 +1816,6 @@ def can_generate_on_machine(self) -> bool: """ Determine if the parameters of this vertex can be generated on the machine - - :rtype: bool """ # Check that all the structs can actually be generated for struct in self.__neuron_impl.structs: @@ -1990,7 +1892,7 @@ def add_projection(self, projection: Projection) -> None: """ Adds the projection. - :param Projection projection: + :param projection: """ # pylint: disable=protected-access s_dynamics = projection._synapse_information.synapse_dynamics @@ -2082,16 +1984,14 @@ def _ring_buffer_expected_upper_bound( All arguments should be assumed real values except n_synapses_in which will be an integer. - :param float weight_mean: Mean of weight distribution (in either nA or + :param weight_mean: Mean of weight distribution (in either nA or microSiemens as required) - :param float weight_std_dev: SD of weight distribution - :param float spikes_per_second: Maximum expected Poisson rate in Hz - :param int machine_timestep: in us - :param int n_synapses_in: No of connected synapses - :param float sigma: How many SD above the mean to go for upper bound; + :param weight_std_dev: SD of weight distribution + :param spikes_per_second: Maximum expected Poisson rate in Hz + :param n_synapses_in: No of connected synapses + :param sigma: How many SD above the mean to go for upper bound; a good starting choice is 5.0. Given length of simulation we can set this for approximate number of saturation events. - :rtype: float """ # E[ number of spikes ] in a timestep average_spikes_per_timestep = ( @@ -2144,8 +2044,7 @@ def get_max_weight(self, s_type: int) -> float: """ Get the max weight. - :param int s_type: synapse_type - :rtype: float + :param s_type: synapse_type """ if self.delay_running_totals[s_type].variance == 0.0: return max(self.total_weights[s_type], self.biggest_weight[s_type]) diff --git a/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/elimination/abstract_elimination.py b/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/elimination/abstract_elimination.py index eb9d41a0164..ebe2efcbf21 100644 --- a/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/elimination/abstract_elimination.py +++ b/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/elimination/abstract_elimination.py @@ -30,8 +30,6 @@ class AbstractElimination(AbstractHasParameterNames, metaclass=AbstractBase): def vertex_executable_suffix(self) -> str: """ The suffix to be appended to the vertex executable for this rule. - - :rtype: str """ raise NotImplementedError @@ -39,8 +37,6 @@ def vertex_executable_suffix(self) -> str: def get_parameters_sdram_usage_in_bytes(self) -> int: """ Get the amount of SDRAM used by the parameters of this rule. - - :rtype: int """ raise NotImplementedError @@ -50,7 +46,7 @@ def write_parameters(self, spec: DataSpecificationBase, """ Write the parameters of the rule to the spec. - :param ~data_specification.DataSpecificationGenerator spec: - :param float weight_scale: + :param spec: + :param weight_scale: """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/elimination/random_by_weight_elimination.py b/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/elimination/random_by_weight_elimination.py index 773c831e949..6c6ea507376 100644 --- a/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/elimination/random_by_weight_elimination.py +++ b/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/elimination/random_by_weight_elimination.py @@ -33,14 +33,14 @@ def __init__( self, threshold: float, prob_elim_depressed: float = 0.0245, prob_elim_potentiated: float = 1.36e-4): """ - :param float threshold: + :param threshold: Below this weight is considered depression, above or equal to this weight is considered potentiation (or the static weight of the connection on static weight connections) - :param float prob_elim_depressed: + :param prob_elim_depressed: The probability of elimination if the weight has been depressed (ignored on static weight connections) - :param float prob_elim_potentiated: + :param prob_elim_potentiated: The probability of elimination of the weight has been potentiated or has not changed (and also used on static weight connections) """ diff --git a/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/formation/abstract_formation.py b/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/formation/abstract_formation.py index eb345363067..0a8c8b5691a 100644 --- a/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/formation/abstract_formation.py +++ b/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/formation/abstract_formation.py @@ -30,8 +30,6 @@ class AbstractFormation(AbstractHasParameterNames, metaclass=AbstractBase): def vertex_executable_suffix(self) -> str: """ The suffix to be appended to the vertex executable for this rule. - - :rtype: str """ raise NotImplementedError @@ -39,8 +37,6 @@ def vertex_executable_suffix(self) -> str: def get_parameters_sdram_usage_in_bytes(self) -> int: """ Get the amount of SDRAM used by the parameters of this rule. - - :rtype: int """ raise NotImplementedError @@ -49,6 +45,6 @@ def write_parameters(self, spec: DataSpecificationBase) -> None: """ Write the parameters of the rule to the spec. - :param ~data_specification.DataSpecificationGenerator spec: + :param spec: """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/formation/distance_dependent_formation.py b/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/formation/distance_dependent_formation.py index c6095c8980d..4e8f41e4ae0 100644 --- a/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/formation/distance_dependent_formation.py +++ b/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/formation/distance_dependent_formation.py @@ -52,15 +52,14 @@ def __init__( sigma_form_lateral: float = 1.0): """ :param grid: (x, y) dimensions of the grid of distance - :type grid: tuple(int,int) or list(int) or ~numpy.ndarray(int) - :param float p_form_forward: + :param p_form_forward: The peak probability of formation on feed-forward connections - :param float sigma_form_forward: + :param sigma_form_forward: The spread of probability with distance of formation on feed-forward connections - :param float p_form_lateral: + :param p_form_lateral: The peak probability of formation on lateral connections - :param float sigma_form_lateral: + :param sigma_form_lateral: The spread of probability with distance of formation on lateral connections """ @@ -93,10 +92,9 @@ def generate_distance_probability_array( """ Generate the exponentially decaying probability LUTs. - :param float probability: peak probability - :param float sigma: spread + :param probability: peak probability + :param sigma: spread :return: distance-dependent probabilities - :rtype: ~numpy.ndarray(float) """ euclidian_distances = numpy.ones(self.__grid ** 2) * numpy.nan for row in range(euclidian_distances.shape[0]): @@ -135,14 +133,12 @@ def distance(self, x0: ArrayLike, x1: ArrayLike, Compute the distance between points x0 and x1 place on the grid using periodic boundary conditions. - :param ~numpy.ndarray(int) x0: first point in space - :param ~numpy.ndarray(int) x1: second point in space - :param ~numpy.ndarray(int) grid: shape of grid - :param str metric: + :param x0: first point in space + :param x1: second point in space + :param metric: distance metric, i.e. ``euclidian`` or ``manhattan`` or ``equidistant`` :return: the distance - :rtype: float """ delta = numpy.abs(numpy.asarray(x0) - numpy.asarray(x1)) if (delta[0] > self.__grid[0] * .5) and self.__grid[0] > 0: diff --git a/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/partner_selection/abstract_partner_selection.py b/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/partner_selection/abstract_partner_selection.py index 65413d44cce..982b3880825 100644 --- a/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/partner_selection/abstract_partner_selection.py +++ b/spynnaker/pyNN/models/neuron/structural_plasticity/synaptogenesis/partner_selection/abstract_partner_selection.py @@ -31,8 +31,6 @@ class AbstractPartnerSelection( def vertex_executable_suffix(self) -> str: """ The suffix to be appended to the vertex executable for this rule. - - :rtype: str """ raise NotImplementedError @@ -40,8 +38,6 @@ def vertex_executable_suffix(self) -> str: def get_parameters_sdram_usage_in_bytes(self) -> int: """ Get the amount of SDRAM used by the parameters of this rule. - - :rtype: int """ raise NotImplementedError @@ -50,6 +46,6 @@ def write_parameters(self, spec: DataSpecificationBase) -> None: """ Write the parameters of the rule to the spec. - :param ~data_specification.DataSpecificationGenerator spec: + :param spec: """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_generate_on_machine.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_generate_on_machine.py index 1a621a3c2f0..c4d1d7550a3 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_generate_on_machine.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_generate_on_machine.py @@ -47,8 +47,6 @@ def generate_on_machine(self) -> bool: Determines if this instance should be generated on the machine. Default implementation returns True - - :rtype: bool """ return True @@ -57,8 +55,6 @@ def generate_on_machine(self) -> bool: def gen_matrix_id(self) -> int: """ The ID of the on-machine matrix generator. - - :rtype: int """ raise NotImplementedError @@ -71,8 +67,6 @@ def gen_matrix_params( ) -> NDArray[uint32]: """ Any parameters required by the matrix generator. - - :rtype: ~numpy.ndarray(uint32) """ raise NotImplementedError @@ -81,7 +75,5 @@ def gen_matrix_params( def gen_matrix_params_size_in_bytes(self) -> int: """ The size of the parameters of the matrix generator in bytes. - - :rtype: int """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_has_parameter_names.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_has_parameter_names.py index 84e3aac7443..e53d221f34b 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_has_parameter_names.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_has_parameter_names.py @@ -28,7 +28,5 @@ class AbstractHasParameterNames(object, metaclass=AbstractBase): def get_parameter_names(self) -> Iterable[str]: """ Get the parameter names available from the component. - - :rtype: iterable(str) """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_plastic_synapse_dynamics.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_plastic_synapse_dynamics.py index 9dce7cc59f5..1e8a7793213 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_plastic_synapse_dynamics.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_plastic_synapse_dynamics.py @@ -37,8 +37,7 @@ def get_n_words_for_plastic_connections(self, n_connections: int) -> int: """ Get the number of 32-bit words for `n_connections` in a single row. - :param int n_connections: - :rtype: int + :param n_connections: """ raise NotImplementedError @@ -65,17 +64,14 @@ def get_plastic_synaptic_data( Lengths are returned as an array made up of an integer for each row, for each of the fixed-plastic and plastic-plastic regions. - :param ~numpy.ndarray connections: The connections to get data for - :param ~numpy.ndarray connection_row_indices: + :param connections: The connections to get data for + :param connection_row_indices: The row into which each connection should go - :param int n_rows: The total number of rows - :param int n_synapse_types: The number of synapse types - :param int max_n_synapses: The maximum number of synapses to generate - :param int max_atoms_per_core: The maximum number of atoms on a core + :param n_rows: The total number of rows + :param n_synapse_types: The number of synapse types + :param max_n_synapses: The maximum number of synapses to generate + :param max_atoms_per_core: The maximum number of atoms on a core :return: (fp_data (2D), pp_data (2D), fp_size (1D), pp_size (1D)) - :rtype: - tuple(~numpy.ndarray, ~numpy.ndarray, ~numpy.ndarray, - ~numpy.ndarray) """ raise NotImplementedError @@ -84,8 +80,6 @@ def get_n_plastic_plastic_words_per_row( self, pp_size: NDArray[uint32]) -> NDArray[integer]: """ Get the number of plastic plastic words to be read from each row. - - :param ~numpy.ndarray pp_size: """ raise NotImplementedError @@ -94,8 +88,6 @@ def get_n_fixed_plastic_words_per_row( self, fp_size: NDArray[uint32]) -> NDArray[integer]: """ Get the number of fixed plastic words to be read from each row. - - :param ~numpy.ndarray fp_size: """ raise NotImplementedError @@ -107,8 +99,8 @@ def get_n_synapses_in_rows( Get the number of synapses in each of the rows with plastic sizes `pp_size` and `fp_size`. - :param ~numpy.ndarray pp_size: - :param ~numpy.ndarray fp_size: + :param pp_size: + :param fp_size: """ raise NotImplementedError @@ -122,14 +114,13 @@ def read_plastic_synaptic_data( Read the connections indicated in the connection indices from the data in `pp_data` and `fp_data`. - :param int n_synapse_types: - :param ~numpy.ndarray pp_size: 1D - :param ~numpy.ndarray pp_data: 2D - :param ~numpy.ndarray fp_size: 1D - :param ~numpy.ndarray fp_data: 2D - :param int max_atoms_per_core: + :param n_synapse_types: + :param pp_size: 1D + :param pp_data: 2D + :param fp_size: 1D + :param fp_data: 2D + :param max_atoms_per_core: :return: array with columns ``source``, ``target``, ``weight``, ``delay`` - :rtype: ~numpy.ndarray """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_sdram_synapse_dynamics.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_sdram_synapse_dynamics.py index 155c2a90396..bb4f5ec0f40 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_sdram_synapse_dynamics.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_sdram_synapse_dynamics.py @@ -40,8 +40,7 @@ def is_same_as(self, synapse_dynamics: AbstractSynapseDynamics) -> bool: """ Determines if this synapse dynamics is the same as another. - :param AbstractSynapseDynamics synapse_dynamics: - :rtype: bool + :param synapse_dynamics: """ raise NotImplementedError @@ -51,9 +50,8 @@ def get_parameters_sdram_usage_in_bytes( """ Get the SDRAM usage of the synapse dynamics parameters in bytes. - :param int n_neurons: - :param int n_synapse_types: - :rtype: int + :param n_neurons: + :param n_synapse_types: """ raise NotImplementedError @@ -65,11 +63,10 @@ def write_parameters( """ Write the synapse parameters to the spec. - :param ~data_specification.DataSpecificationGenerator spec: - The specification to write to - :param int region: region ID to write to - :param float global_weight_scale: The weight scale applied globally - :param list(float) synapse_weight_scales: + :param spec: The specification to write to + :param region: region ID to write to + :param global_weight_scale: The weight scale applied globally + :param synapse_weight_scales: The total weight scale applied to each synapse including the global weight scale """ @@ -81,8 +78,7 @@ def get_max_synapses(self, n_words: int) -> int: Get the maximum number of synapses that can be held in the given number of words. - :param int n_words: The number of words the synapses must fit in - :rtype: int + :param n_words: The number of words the synapses must fit in """ raise NotImplementedError @@ -101,15 +97,14 @@ def convert_per_connection_data_to_rows( Converts per-connection data generated from connections into row-based data to be returned from get_synaptic_data. - :param ~numpy.ndarray connection_row_indices: + :param connection_row_indices: The index of the row that each item should go into - :param int n_rows: + :param n_rows: The number of rows - :param ~numpy.ndarray data: + :param data: The non-row-based data - :param int max_n_synapses: + :param max_n_synapses: The maximum number of synapses to generate in each row - :rtype: list(~numpy.ndarray) """ return [ data[connection_row_indices == i][:max_n_synapses].reshape(-1) @@ -121,9 +116,8 @@ def get_n_items( Get the number of items in each row as 4-byte values, given the item size. - :param ~numpy.ndarray rows: - :param int item_size: - :rtype: ~numpy.ndarray + :param rows: + :param item_size: """ return numpy.array([ int(math.ceil(float(row.size) / float(item_size))) @@ -133,8 +127,7 @@ def get_words(self, rows: List[NDArray]) -> List[NDArray[uint32]]: """ Convert the row data to words. - :param ~numpy.ndarray rows: - :rtype: ~numpy.ndarray + :param rows: """ words = [numpy.pad( row, (0, (4 - (row.size % 4)) & 0x3), mode="constant", diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_static_synapse_dynamics.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_static_synapse_dynamics.py index 95dcd4e56ed..76b998a6559 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_static_synapse_dynamics.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_static_synapse_dynamics.py @@ -35,8 +35,7 @@ def get_n_words_for_static_connections(self, n_connections: int) -> int: """ Get the number of 32-bit words for `n_connections` in a single row. - :param int n_connections: - :rtype: int + :param n_connections: """ raise NotImplementedError @@ -59,15 +58,14 @@ def get_static_synaptic_data( Lengths are returned as an array made up of an integer for each row, for the fixed-fixed region. - :param ~numpy.ndarray connections: The connections to get data for - :param ~numpy.ndarray connection_row_indices: + :param connections: The connections to get data for + :param connection_row_indices: The row into which each connection should go - :param int n_rows: The number of rows to write - :param int n_synapse_types: The number of synapse types - :param int max_n_synapses: The maximum number of synapses to generate - :param int max_atoms_per_core: The maximum number of atoms on a core + :param n_rows: The number of rows to write + :param n_synapse_types: The number of synapse types + :param max_n_synapses: The maximum number of synapses to generate + :param max_atoms_per_core: The maximum number of atoms on a core :return: (ff_data, ff_size) - :rtype: tuple(list(~numpy.ndarray), ~numpy.ndarray) """ raise NotImplementedError @@ -78,8 +76,7 @@ def get_n_static_words_per_row( Get the number of bytes to be read per row for the static data given the size that was written to each row. - :param ~numpy.ndarray ff_size: - :rtype: ~numpy.ndarray + :param ff_size: """ raise NotImplementedError @@ -89,8 +86,7 @@ def get_n_synapses_in_rows( """ Get the number of synapses in the rows with sizes `ff_size`. - :param ~numpy.ndarray ff_size: - :rtype: ~numpy.ndarray + :param ff_size: """ raise NotImplementedError @@ -102,10 +98,9 @@ def read_static_synaptic_data( """ Read the connections from the words of data in `ff_data`. - :param int n_synapse_types: - :param ~numpy.ndarray ff_size: - :param list(~numpy.ndarray) ff_data: - :param int max_atoms_per_core: - :rtype: ~numpy.ndarray + :param n_synapse_types: + :param ff_size: + :param ff_data: + :param max_atoms_per_core: """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_supports_signed_weights.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_supports_signed_weights.py index a1846b35c10..f8acfd26edb 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_supports_signed_weights.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_supports_signed_weights.py @@ -30,8 +30,6 @@ def get_positive_synapse_index( Get the synapse type that positive weights will arrive at. :param incoming_projection: The projection targeted - :type incoming_projection: ~spynnaker.pyNN.models.projection.Projection - :rtype: int """ raise NotImplementedError @@ -42,8 +40,6 @@ def get_negative_synapse_index( Get the synapse type that negative weights will arrive at. :param incoming_projection: The projection targeted - :type incoming_projection: ~spynnaker.pyNN.models.projection.Projection - :rtype: int """ raise NotImplementedError @@ -57,8 +53,6 @@ def get_maximum_positive_weight( This must be a value >= 0. :param incoming_projection: The projection targeted - :type incoming_projection: ~spynnaker.pyNN.models.projection.Projection - :rtype: float """ raise NotImplementedError @@ -72,8 +66,6 @@ def get_minimum_negative_weight( This must be a value <= 0. :param incoming_projection: The projection targeted - :type incoming_projection: ~spynnaker.pyNN.models.projection.Projection - :rtype: int """ raise NotImplementedError @@ -87,8 +79,6 @@ def get_mean_positive_weight( This must be a value >= 0. :param incoming_projection: The projection targeted - :type incoming_projection: ~spynnaker.pyNN.models.projection.Projection - :rtype: float """ raise NotImplementedError @@ -102,8 +92,6 @@ def get_mean_negative_weight( This must be a value <= 0. :param incoming_projection: The projection targeted - :type incoming_projection: ~spynnaker.pyNN.models.projection.Projection - :rtype: float """ raise NotImplementedError @@ -117,8 +105,6 @@ def get_variance_positive_weight( This must be a value >= 0. :param incoming_projection: The projection targeted - :type incoming_projection: ~spynnaker.pyNN.models.projection.Projection - :rtype: float """ raise NotImplementedError @@ -132,7 +118,5 @@ def get_variance_negative_weight( This must be a value <= 0. :param incoming_projection: The projection targeted - :type incoming_projection: ~spynnaker.pyNN.models.projection.Projection - :rtype: float """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_synapse_dynamics.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_synapse_dynamics.py index 80e9eae654c..b845f6acc0a 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_synapse_dynamics.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_synapse_dynamics.py @@ -124,8 +124,7 @@ def merge(self, synapse_dynamics: AbstractSynapseDynamics Merge with the given synapse_dynamics and return the result, or error if merge is not possible. - :param AbstractSynapseDynamics synapse_dynamics: - :rtype: AbstractSynapseDynamics + :param synapse_dynamics: """ raise NotImplementedError @@ -133,8 +132,6 @@ def merge(self, synapse_dynamics: AbstractSynapseDynamics def get_vertex_executable_suffix(self) -> str: """ Get the executable suffix for a vertex for this dynamics. - - :rtype: str """ raise NotImplementedError @@ -143,8 +140,6 @@ def get_vertex_executable_suffix(self) -> str: def changes_during_run(self) -> bool: """ Whether the synapses change during a run. - - :rtype: bool """ raise NotImplementedError @@ -152,8 +147,6 @@ def changes_during_run(self) -> bool: def weight(self) -> WEIGHTS: """ The weight of connections. - - :rtype: float """ return self.__weight @@ -207,8 +200,6 @@ def _convert_weight(self, weight: WEIGHTS_DELAYS_IN) -> WEIGHTS: def delay(self) -> DELAYS: """ The delay of connections. - - :rtype: float """ return self.__delay @@ -218,8 +209,6 @@ def is_combined_core_capable(self) -> bool: """ Whether the synapse dynamics can run on a core combined with the neuron, or if a separate core is needed. - - :rtype: bool """ raise NotImplementedError @@ -229,8 +218,6 @@ def is_split_core_capable(self) -> bool: """ Whether the synapse dynamics can run on a core split from the neuron, or if only a combined core is possible. - - :rtype: bool """ raise NotImplementedError @@ -238,8 +225,7 @@ def get_value(self, key: str) -> Any: """ Get a property. - :param str key: the name of the property - :rtype: Any or float or int or list(float) or list(int) + :param key: the name of the property """ if hasattr(self, key): return getattr(self, key) @@ -250,9 +236,8 @@ def set_value(self, key: str, value: Any) -> None: """ Set a property. - :param str key: the name of the parameter to change + :param key: the name of the parameter to change :param value: the new value of the parameter to assign - :type value: Any or float or int or list(float) or list(int) """ if hasattr(self, key): setattr(self, key, value) @@ -278,8 +263,8 @@ def get_delay_minimum( from the graph, but requires fixes in the synaptic manager to happen first before this can be utilised fully. - :param AbstractConnector connector: connector - :param SynapseInformation synapse_info: synapse info + :param connector: connector + :param synapse_info: synapse info """ return connector.get_delay_minimum(synapse_info) @@ -289,9 +274,9 @@ def get_delay_variance( """ Get the variance in delay for the synapses. - :param AbstractConnector connector: - :param ~numpy.ndarray delays: - :param SynapseInformation synapse_info: + :param connector: + :param delays: + :param synapse_info: """ return connector.get_delay_variance(delays, synapse_info) @@ -301,8 +286,8 @@ def get_weight_mean( """ Get the mean weight for the synapses. - :param AbstractConnector connector: - :param SynapseInformation synapse_info: + :param connector: + :param synapse_info: """ return connector.get_weight_mean(synapse_info.weights, synapse_info) @@ -312,8 +297,8 @@ def get_weight_maximum( """ Get the maximum weight for the synapses. - :param AbstractConnector connector: - :param SynapseInformation synapse_info: + :param connector: + :param synapse_info: """ return connector.get_weight_maximum(synapse_info) @@ -323,9 +308,9 @@ def get_weight_variance( """ Get the variance in weight for the synapses. - :param AbstractConnector connector: - :param ~numpy.ndarray weights: - :param SynapseInformation synapse_info: + :param connector: + :param weights: + :param synapse_info: """ return connector.get_weight_variance(weights, synapse_info) @@ -334,8 +319,7 @@ def get_synapse_id_by_target(self, target: str) -> Optional[int]: Get the index of the synapse type based on the name, or `None` if the name is not found. - :param str target: The name of the synapse - :rtype: int or None + :param target: The name of the synapse """ _ = target return None @@ -349,17 +333,10 @@ def get_connected_vertices( Get the machine vertices that are connected to each other with this connector. - :param SynapseInformation s_info: - The synapse information of the connection + :param s_info: The synapse information of the connection :param source_vertex: The source of the spikes - :type source_vertex: - ~pacman.model.graphs.application.ApplicationVertex :param target_vertex: The target of the spikes - :type target_vertex: - ~pacman.model.graphs.application.ApplicationVertex :return: A list of tuples of (target machine vertex, list of sources) - :rtype: list(tuple(~pacman.model.graphs.machine.MachineVertex, - list(~pacman.model.graphs.AbstractVertex))) """ # By default, just ask the connector return s_info.connector.get_connected_vertices( @@ -370,8 +347,6 @@ def absolute_max_atoms_per_core(self) -> int: """ The absolute maximum number of atoms per core supported by this synapse dynamics object. - - :rtype: int """ # By default, we can only support the maximum row length per core return POP_TABLE_MAX_ROW_LENGTH @@ -387,9 +362,7 @@ def validate_connection( on multi-dimensional vertices. :param application_edge: The edge of the connection - :type application_edge: - ~pacman.model.graphs.application.ApplicationEdge - :param SynapseInformation synapse_info: The synaptic information + :param synapse_info: The synaptic information """ # By default, just ask the connector synapse_info.connector.validate_connection( diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_synapse_dynamics_structural.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_synapse_dynamics_structural.py index ba966384c3a..83a7b3a58e4 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_synapse_dynamics_structural.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/abstract_synapse_dynamics_structural.py @@ -60,11 +60,8 @@ def get_structural_parameters_sdram_usage_in_bytes( :param incoming_projections: The projections that target the vertex in question - :type incoming_projections: - list(~spynnaker.pyNN.models.projection.Projection) - :param int n_neurons: + :param n_neurons: :return: the size of the parameters, in bytes - :rtype: int :raises PacmanInvalidParameterException: If the parameters make no sense. """ @@ -79,16 +76,12 @@ def write_structural_parameters( """ Write structural plasticity parameters. - :param ~data_specification.DataSpecificationGenerator spec: - The data specification to write to - :param int region: region ID - :param list(float) weight_scales: Weight scaling for each synapse type - :param ~pacman.model.graphs.application.ApplicationVertex app_vertex: - The target application vertex - :param ~pacman.model.graphs.common.Slice vertex_slice: - The slice of the target vertex to generate for - :param SynapticMatrices synaptic_matrices: - The synaptic matrices for this vertex + :param spec: The data specification to write to + :param region: region ID + :param weight_scales: Weight scaling for each synapse type + :param app_vertex: The target application vertex + :param vertex_slice: The slice of the target vertex to generate for + :param synaptic_matrices: The synaptic matrices for this vertex """ raise NotImplementedError @@ -100,10 +93,10 @@ def set_connections( """ Set connections for structural plasticity. - :param ~numpy.ndarray connections: - :param ~pacman.model.graphs.common.Slice post_vertex_slice: - :param ProjectionApplicationEdge app_edge: - :param SynapseInformation synapse_info: + :param connections: + :param post_vertex_slice: + :param app_edge: + :param synapse_info: """ raise NotImplementedError @@ -112,8 +105,6 @@ def set_connections( def f_rew(self) -> float: """ The frequency of rewiring. - - :rtype: float """ raise NotImplementedError @@ -122,8 +113,6 @@ def f_rew(self) -> float: def s_max(self) -> int: """ The maximum number of synapses. - - :rtype: int """ raise NotImplementedError @@ -132,8 +121,6 @@ def s_max(self) -> int: def with_replacement(self) -> bool: """ Whether to allow replacement when creating synapses. - - :rtype: bool """ raise NotImplementedError @@ -150,8 +137,6 @@ def seed(self) -> Optional[int]: def initial_weight(self) -> float: """ The weight of a formed connection. - - :rtype: float """ raise NotImplementedError @@ -160,8 +145,6 @@ def initial_weight(self) -> float: def initial_delay(self) -> InitialDelay: """ The delay of a formed connection. - - :rtype: float or (float, float) """ raise NotImplementedError @@ -170,8 +153,6 @@ def initial_delay(self) -> InitialDelay: def partner_selection(self) -> AbstractPartnerSelection: """ The partner selection rule. - - :rtype: AbstractPartnerSelection """ raise NotImplementedError @@ -180,8 +161,6 @@ def partner_selection(self) -> AbstractPartnerSelection: def formation(self) -> AbstractFormation: """ The formation rule. - - :rtype: AbstractFormation """ raise NotImplementedError @@ -190,8 +169,6 @@ def formation(self) -> AbstractFormation: def elimination(self) -> AbstractElimination: """ The elimination rule. - - :rtype: AbstractElimination """ raise NotImplementedError @@ -200,7 +177,7 @@ def check_initial_delay(self, max_delay_ms: int) -> None: """ Check that delays can be done without delay extensions. - :param int max_delay_ms: The maximum delay supported, in milliseconds + :param max_delay_ms: The maximum delay supported, in milliseconds :raises Exception: if the delay is out of range """ raise NotImplementedError @@ -209,7 +186,5 @@ def check_initial_delay(self, max_delay_ms: int) -> None: def get_max_rewires_per_ts(self) -> int: """ Get the max number of rewires per timestep. - - :rtype: int """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_neuromodulation.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_neuromodulation.py index 20319422fda..bd951af37ef 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_neuromodulation.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_neuromodulation.py @@ -95,8 +95,6 @@ def __init__( def tau_c(self) -> float: """ The tau c value passed into the init. - - :rtype: float """ return self.__tau_c @@ -104,8 +102,6 @@ def tau_c(self) -> float: def tau_d(self) -> float: """ The tau d value passed into the init. - - :rtype: float """ return self.__tau_d @@ -113,8 +109,6 @@ def tau_d(self) -> float: def w_min(self) -> float: """ The w min value passed into the init. - - :rtype: float """ return self.__w_min @@ -122,8 +116,6 @@ def w_min(self) -> float: def w_max(self) -> float: """ The w max value passed into the init. - - :rtype: float """ return self.__w_max @@ -147,8 +139,7 @@ def is_neuromodulation_same_as( """ Checks that tau c, tau d, w max and w min are all the same. - :param SynapseDynamicsNeuromodulation other: - :rtype: bool + :param other: """ return (self.__tau_c == other.tau_c and self.__tau_d == other.tau_d and self.__w_min == other.w_min and self.__w_max == other.w_max) diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_static.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_static.py index 4ce894cfff8..2c04e97c729 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_static.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_static.py @@ -64,10 +64,9 @@ def __init__( pad_to_length: Optional[int] = None): """ - :param float weight: + :param weight: :param delay: Use ``None`` to get the simulator default minimum delay. - :type delay: float or None - :param int pad_to_length: + :param pad_to_length: """ super(AbstractStaticSynapseDynamics, self).__init__( delay=delay, weight=weight) @@ -148,11 +147,6 @@ def get_static_synaptic_data( def _pad_row(self, rows: List[NDArray], no_bytes_per_connection: int) -> List[NDArray]: - """ - :param list(~numpy.ndarray) rows: - :param int no_bytes_per_connection: - :rtype: list(~numpy.ndarray) - """ assert self.__pad_to_length is not None return [ numpy.concatenate([ diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_stdp.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_stdp.py index 5d2d7acbb5a..44529dd31eb 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_stdp.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_stdp.py @@ -102,16 +102,14 @@ def __init__( delay: _In_Types = None, pad_to_length: Optional[int] = None, backprop_delay: bool = True): """ - :param AbstractTimingDependence timing_dependence: - :param AbstractWeightDependence weight_dependence: - :param None voltage_dependence: not supported - :param float dendritic_delay_fraction: must be 1.0! - :param float weight: + :param timing_dependence: + :param weight_dependence: + :param voltage_dependence: not supported + :param dendritic_delay_fraction: must be 1.0! + :param weight: :param delay: Use ``None`` to get the simulator default minimum delay. - :type delay: float or None :param pad_to_length: - :type pad_to_length: int or None - :param bool backprop_delay: + :param backprop_delay: """ if timing_dependence is None or weight_dependence is None: raise NotImplementedError( @@ -223,7 +221,7 @@ def weight_dependence(self) -> AbstractWeightDependence: @property def timing_dependence(self) -> AbstractTimingDependence: """ - :rtype: AbstractTimingDependence + timing dependence to use for the STDP rule """ return self.__timing_dependence @@ -231,8 +229,6 @@ def timing_dependence(self) -> AbstractTimingDependence: def dendritic_delay_fraction(self) -> float: """ Settable. - - :rtype: float """ return self.__dendritic_delay_fraction @@ -244,8 +240,6 @@ def dendritic_delay_fraction(self, new_value: float) -> None: def backprop_delay(self) -> bool: """ Settable. - - :rtype: bool """ return self.__backprop_delay @@ -256,7 +250,7 @@ def backprop_delay(self, backprop_delay: bool) -> None: @property def neuromodulation(self) -> Optional[SynapseDynamicsNeuromodulation]: """ - :rtype: SynapseDynamicsNeuromodulation + Synapses that target a neuromodulation receptor. """ return self.__neuromodulation @@ -274,7 +268,7 @@ def is_same_as(self, synapse_dynamics: AbstractSynapseDynamics) -> bool: def get_vertex_executable_suffix(self) -> str: """ - :rtype: str + an executable suffix based on timing, weights and neuromodulation """ # Get the suffix values for timing and weight dependence timing_suffix = self.__timing_dependence.vertex_executable_suffix @@ -292,9 +286,8 @@ def get_vertex_executable_suffix(self) -> str: def get_parameters_sdram_usage_in_bytes( self, n_neurons: int, n_synapse_types: int) -> int: """ - :param int n_neurons: - :param int n_synapse_types: - :rtype: int + :param n_neurons: + :param n_synapse_types: """ # 32-bits for back-prop delay size = BYTES_PER_WORD @@ -334,9 +327,6 @@ def write_parameters( @property def _n_header_bytes(self) -> int: - """ - :rtype: int - """ # The header contains a single timestamp and pre-trace n_bytes = ( TIME_STAMP_BYTES + self.__timing_dependence.pre_trace_n_bytes) @@ -347,11 +337,6 @@ def _n_header_bytes(self) -> int: def __get_n_connections( self, n_connections: int, check_length_padded: bool = True) -> int: - """ - :param int n_connections: - :param bool check_length_padded: - :rtype: int - """ synapse_structure = self.__timing_dependence.synaptic_structure if self.__pad_to_length is not None and check_length_padded: n_connections = max(n_connections, self.__pad_to_length) @@ -376,8 +361,7 @@ def __get_n_connections( get_n_words_for_plastic_connections) def get_n_words_for_plastic_connections(self, n_connections: int) -> int: """ - :param int n_connections: - :rtype: int + :param n_connections: """ return self.__get_n_connections(n_connections) @@ -451,11 +435,6 @@ def get_plastic_synaptic_data( def _pad_row(self, rows: List[NDArray], no_bytes_per_connection: int) -> List[NDArray]: - """ - :param list(~numpy.ndarray) rows: - :param int no_bytes_per_connection: - :rtype: list(~numpy.ndarray) - """ pad_len = self.__pad_to_length or 1 # Row elements are (individual) bytes return [ diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_structural_common.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_structural_common.py index 8aa08ab2c2b..ff327300ade 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_structural_common.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_structural_common.py @@ -104,9 +104,6 @@ class SynapseDynamicsStructuralCommon( __slots__ = () def get_parameter_names(self) -> Iterable[str]: - """ - :rtype: list(str) - """ yield from [ 'initial_weight', 'initial_delay', 'f_rew', 'p_rew', 's_max', 'with_replacement'] @@ -118,8 +115,6 @@ def get_parameter_names(self) -> Iterable[str]: def p_rew(self) -> float: """ The period of rewiring. - - :rtype: float """ return 1. / self.f_rew @@ -170,11 +165,6 @@ def write_structural_parameters( def __get_structural_projections( self, incoming_projections: Iterable[Projection] ) -> List[Projection]: - """ - :param list(Projection) incoming_projections: - Projections to filter to structural only - :rtype: list(Projection) - """ structural_projections = list() seen_app_edges = set() for proj in incoming_projections: @@ -196,13 +186,10 @@ def __write_common_rewiring_data( """ Write the non-sub-population synapse parameters to the spec. - :param ~data_specification.DataSpecificationGenerator spec: - the data spec - :param ~pacman.model.graphs.application.ApplicationVertex app_vertex: - The application vertex being generated - :param ~pacman.model.graphs.common.Slice vertex_slice: - The slice of the target vertex to generate for - :param int n_pre_pops: the number of pre-populations + :param spec: the data spec + :param app_vertex: The application vertex being generated + :param vertex_slice: The slice of the target vertex to generate for + :param n_pre_pops: the number of pre-populations """ time_step_us = SpynnakerDataView.get_simulation_time_step_us() spec.comment("Writing common rewiring data") @@ -249,18 +236,12 @@ def __write_prepopulation_info( synaptic_matrices: SynapticMatrices) -> Tuple[ _PopIndexType, _SubpopIndexType, _SubpopIndexType]: """ - :param ~data_specification.DataSpecificationGenerator spec: - :param ~pacman.model.graphs.application.ApplicationVertex app_vertex: + :param spec: + :param app_vertex: the vertex for which data specs are being prepared :param structural_projections: Projections that are structural - :param machine_edges_by_app: - map of application edge to associated machine edges - :type machine_edges_by_app: - dict(~pacman.model.graphs.application.ApplicationEdge, - list(~pacman.model.graphs.machine.MachineEdge)) - :param dict(int,float) weight_scales: - :param SynapticMatrices synaptic_matrices: - :rtype: dict(tuple(PopulationVertex,SynapseInformation),int) + :param weight_scales: + :param synaptic_matrices: """ spec.comment("Writing pre-population info") pop_index: _PopIndexType = dict() @@ -332,14 +313,10 @@ def __write_post_to_pre_table( """ Post to pre table is basically the transpose of the synaptic matrix. - :param ~data_specification.DataSpecificationGenerator spec: + :param spec: :param pop_index: - :type pop_index: - dict(tuple(PopulationVertex,SynapseInformation), int) - :param ~pacman.model.graphs.application.ApplicationVertex app_vertex: - the vertex for which data specs are being prepared - :param ~pacman.model.graphs.common.Slice vertex_slice: - The target slice + :param app_vertex: the vertex for which data specs are being prepared + :param vertex_slice: The target slice """ # Get connections for this post slice slice_conns = self.connections[app_vertex, vertex_slice.lo_atom] @@ -426,7 +403,7 @@ def get_structural_parameters_sdram_usage_in_bytes( def get_vertex_executable_suffix(self) -> str: """ - :rtype: str + executable suffix based on details """ name = "_structural" name += self.partner_selection.vertex_executable_suffix @@ -437,8 +414,7 @@ def get_vertex_executable_suffix(self) -> str: def is_same_as( self, synapse_dynamics: AbstractSynapseDynamicsStructural) -> bool: """ - :param SynapseDynamicsStructuralCommon synapse_dynamics: - :rtype: bool + :param synapse_dynamics: """ # Note noqa:E721 because exact type comparison is required here return ( @@ -459,8 +435,6 @@ def is_same_as( def connections(self) -> ConnectionsInfo: """ Initial connectivity as defined via connector. - - :rtype: dict """ raise NotImplementedError @@ -476,11 +450,7 @@ def _get_seeds( but the same for the same app_vertex. It should be different every time called with `None`. - :param app_vertex: - :type app_vertex: - ~pacman.model.graphs.application.ApplicationVertex or None :return: list of random seed (4 words), generated randomly - :rtype: list(int) """ raise NotImplementedError @@ -489,7 +459,7 @@ def check_initial_delay(self, max_delay_ms: float) -> None: """ Check that delays can be done without delay extensions. - :param float max_delay_ms: The maximum delay supported, in milliseconds + :param max_delay_ms: The maximum delay supported, in milliseconds :raises ValueError: if the delay is out of range """ if isinstance(self.initial_delay, tuple): diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_structural_static.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_structural_static.py index 8b97fda0c59..e17a1cd49f6 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_structural_static.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_structural_static.py @@ -115,29 +115,26 @@ def __init__( weight: float = StaticSynapse.default_parameters['weight'], delay: Optional[float] = None): """ - :param AbstractPartnerSelection partner_selection: - The partner selection rule - :param AbstractFormation formation: The formation rule - :param AbstractElimination elimination: The elimination rule - :param float f_rew: How many rewiring attempts will be done per second. - :param float initial_weight: + :param partner_selection: The partner selection rule + :param formation: The formation rule + :param elimination: The elimination rule + :param f_rew: How many rewiring attempts will be done per second. + :param initial_weight: Weight assigned to a newly formed connection :param initial_delay: Delay assigned to a newly formed connection; a single value means a fixed delay value, or a tuple of two values means the delay will be chosen at random from a uniform distribution between the given values - :type initial_delay: float or (float, float) - :param int s_max: Maximum fan-in per target layer neuron - :param bool with_replacement: + :param s_max: Maximum fan-in per target layer neuron + :param with_replacement: If set to True (default), a new synapse can be formed in a location where a connection already exists; if False, then it must form where no connection already exists - :param int seed: seed the random number generators - :param float weight: The weight of connections formed by the connector + :param seed: seed the random number generators + :param weight: The weight of connections formed by the connector :param delay: The delay of connections formed by the connector Use ``None`` to get the simulator default minimum delay. - :type delay: float or None """ super().__init__(weight=weight, delay=delay, pad_to_length=s_max) diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_structural_stdp.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_structural_stdp.py index 75dae03dc67..5b6b6662dd9 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_structural_stdp.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_structural_stdp.py @@ -118,40 +118,33 @@ def __init__( delay: _In_Types = None, backprop_delay: bool = True): """ - :param AbstractPartnerSelection partner_selection: - The partner selection rule - :param AbstractFormation formation: The formation rule - :param AbstractElimination elimination: The elimination rule - :param AbstractTimingDependence timing_dependence: - The STDP timing dependence rule - :param AbstractWeightDependence weight_dependence: - The STDP weight dependence rule - :param None voltage_dependence: - The STDP voltage dependence (unsupported) - :param float dendritic_delay_fraction: + :param partner_selection: The partner selection rule + :param formation: The formation rule + :param elimination: The elimination rule + :param timing_dependence: The STDP timing dependence rule + :param weight_dependence: The STDP weight dependence rule + :param voltage_dependence: The STDP voltage dependence (unsupported) + :param dendritic_delay_fraction: The STDP dendritic delay fraction - :param float f_rew: + :param f_rew: How many rewiring attempts will be done per second. - :param float initial_weight: + :param initial_weight: Weight assigned to a newly formed connection :param initial_delay: Delay assigned to a newly formed connection; a single value means a fixed delay value, or a tuple of two values means the delay will be chosen at random from a uniform distribution between the given values - :type initial_delay: float or tuple(float, float) - :param int s_max: Maximum fan-in per target layer neuron - :param bool with_replacement: + :param s_max: Maximum fan-in per target layer neuron + :param with_replacement: If set to True (default), a new synapse can be formed in a location where a connection already exists; if False, then it must form where no connection already exists :param seed: seed for the random number generators - :type seed: int or None - :param float weight: The weight of connections formed by the connector + :param weight: The weight of connections formed by the connector :param delay: The delay of connections formed by the connector Use ``None`` to get the simulator default minimum delay. - :type delay: float or None - :param bool backprop_delay: Whether back-propagated delays are used + :param backprop_delay: Whether back-propagated delays are used """ super().__init__( timing_dependence, weight_dependence, voltage_dependence, diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_utils.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_utils.py index b000683c1dd..b35b9f6c090 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_utils.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_utils.py @@ -21,9 +21,6 @@ def _calculate_stdp_times( pre_spikes: NDArray[integer], post_spikes: NDArray[integer], plastic_delay: int) -> Tuple[NDArray[integer], NDArray[integer]]: - """ - :rtype: tuple(~numpy.ndarray, ~numpy.ndarray) - """ # If no post spikes, no changes if len(post_spikes) == 0: return numpy.zeros(0, dtype=uint32), numpy.zeros(0, dtype=uint32) @@ -52,16 +49,15 @@ def calculate_spike_pair_additive_stdp_weight( """ Calculates the expected STDP weight for SpikePair Additive STDP. - :param iterable(int) pre_spikes: - :param iterable(int) post_spikes: - :param float initial_weight: - :param int plastic_delay: parameter of the STDP model - :param float a_plus: parameter of the STDP model - :param float a_minus: parameter of the STDP model - :param float tau_plus: parameter of the STDP model - :param float tau_minus: parameter of the STDP model + :param pre_spikes: + :param post_spikes: + :param initial_weight: + :param plastic_delay: parameter of the STDP model + :param a_plus: parameter of the STDP model + :param a_minus: parameter of the STDP model + :param tau_plus: parameter of the STDP model + :param tau_minus: parameter of the STDP model :return: overall weight - :rtype: float """ potentiation_times, depression_times = _calculate_stdp_times( pre_spikes, post_spikes, plastic_delay) @@ -84,18 +80,17 @@ def calculate_spike_pair_multiplicative_stdp_weight( """ Calculates the expected STDP weight for SpikePair Multiplicative STDP. - :param iterable(int) pre_spikes: Spikes going into the model - :param iterable(int) post_spikes: Spikes recorded on the model - :param float initial_weight: Starting weight for the model - :param int plastic_delay: parameter of the STDP model - :param float min_weight: parameter of the STDP model - :param float max_weight: parameter of the STDP model - :param float a_plus: parameter of the STDP model - :param float a_minus: parameter of the STDP model - :param float tau_plus: parameter of the STDP model - :param float tau_minus: parameter of the STDP model + :param pre_spikes: Spikes going into the model + :param post_spikes: Spikes recorded on the model + :param initial_weight: Starting weight for the model + :param plastic_delay: parameter of the STDP model + :param min_weight: parameter of the STDP model + :param max_weight: parameter of the STDP model + :param a_plus: parameter of the STDP model + :param a_minus: parameter of the STDP model + :param tau_plus: parameter of the STDP model + :param tau_minus: parameter of the STDP model :return: overall weight - :rtype: float """ potentiation_times, depression_times = _calculate_stdp_times( pre_spikes, post_spikes, plastic_delay) diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_weight_changable.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_weight_changable.py index f4ba5045ea9..6420383c5f3 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_weight_changable.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_weight_changable.py @@ -80,9 +80,8 @@ def __init__( weight: _In_Types = StaticSynapse.default_parameters['weight'], delay: _In_Types = None): """ - :param float weight: + :param weight: :param delay: Use ``None`` to get the simulator default minimum delay. - :type delay: float or None """ super().__init__(delay=delay, weight=weight) self.__weight_max = weight_max @@ -152,20 +151,12 @@ def is_same_as(self, synapse_dynamics: AbstractSynapseDynamics) -> bool: @overrides(AbstractPlasticSynapseDynamics.get_vertex_executable_suffix) def get_vertex_executable_suffix(self) -> str: - """ - :rtype: str - """ return "_weight_change" @overrides(AbstractPlasticSynapseDynamics. get_parameters_sdram_usage_in_bytes) def get_parameters_sdram_usage_in_bytes( self, n_neurons: int, n_synapse_types: int) -> int: - """ - :param int n_neurons: - :param int n_synapse_types: - :rtype: int - """ # The count of items, plus min and max for each synapse type return BYTES_PER_WORD + (BYTES_PER_SHORT * 2 * n_synapse_types) @@ -194,8 +185,7 @@ def write_parameters( get_n_words_for_plastic_connections) def get_n_words_for_plastic_connections(self, n_connections: int) -> int: """ - :param int n_connections: - :rtype: int + :param n_connections: """ n_words = n_connections // 2 if n_connections % 2 != 0: diff --git a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_weight_changer.py b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_weight_changer.py index 9dd6d14c50e..400c172d9da 100644 --- a/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_weight_changer.py +++ b/spynnaker/pyNN/models/neuron/synapse_dynamics/synapse_dynamics_weight_changer.py @@ -56,9 +56,9 @@ class SynapseDynamicsWeightChanger( def __init__(self, weight_change: float, projection: Projection): """ - :param float weight_change: + :param weight_change: The positive or negative change in weight to apply on each spike - :param Projection projection: + :param projection: The projection that this synapse dynamics is being added to """ super().__init__(delay=1, weight=weight_change) diff --git a/spynnaker/pyNN/models/neuron/synapse_io.py b/spynnaker/pyNN/models/neuron/synapse_io.py index f6e9c8e5496..9b3eff486f6 100644 --- a/spynnaker/pyNN/models/neuron/synapse_io.py +++ b/spynnaker/pyNN/models/neuron/synapse_io.py @@ -85,9 +85,8 @@ def get_maximum_delay_supported_in_ms( Get the maximum delay supported by the synapse representation before extensions are required. - :param int post_vertex_max_delay_ticks: post vertex max delay + :param post_vertex_max_delay_ticks: post vertex max delay :return: Maximum delay, in milliseconds. - :rtype: float """ return (post_vertex_max_delay_ticks * SpynnakerDataView.get_simulation_time_step_ms()) @@ -101,15 +100,14 @@ def get_max_row_info( undelayed rows in bytes (including header), words (without header) and number of synapses. - :param SynapseInformation synapse_info: + :param synapse_info: The synapse information to get the row data for - :param int n_post_atoms: + :param n_post_atoms: The number of post atoms to get the maximum for - :param int n_delay_stages: + :param n_delay_stages: The number of delay stages on the edge - :param ProjectionApplicationEdge in_edge: + :param in_edge: The incoming edge on which the synapse information is held - :rtype: MaxRowInfo :raises SynapseRowTooBigException: If the synapse information can't be represented """ @@ -186,10 +184,10 @@ def _get_allowed_row_length( Get the allowed row length in words in the population table for a desired row length in words. - :param int n_words: The number of words in the row - :param AbstractSynapseDynamics dynamics: The synapse dynamics used - :param ProjectionApplicationEdge in_edge: The incoming edge - :param int n_synapses: The number of synapses for the number of words + :param n_words: The number of words in the row + :param dynamics: The synapse dynamics used + :param in_edge: The incoming edge + :param n_synapses: The number of synapses for the number of words :raises SynapseRowTooBigException: If the given row is too big; the exception will detail the maximum number of synapses that are supported. @@ -226,24 +224,24 @@ def get_synapses( an array of words for delayed synapses. This is used to prepare information for *deployment to SpiNNaker*. - :param ~numpy.ndarray connections: + :param connections: The connections to get the synapses from - :param SynapseInformation synapse_info: + :param synapse_info: The synapse information to convert to synapses - :param int n_delay_stages: + :param n_delay_stages: The number of delay stages in total to be represented - :param int n_synapse_types: + :param n_synapse_types: The number of synapse types in total to be represented :param weight_scales: The scaling of the weights for each synapse type - :param ~pacman.model.graphs.application.ApplicationEdge app_edge: + :param app_edge: The incoming machine edge that the synapses are on - :param MaxRowInfo max_row_info: + :param max_row_info: The maximum row information for the synapses - :param bool gen_undelayed: + :param gen_undelayed: Whether to generate undelayed data - :param bool gen_delayed: + :param gen_delayed: Whether to generate delayed data - :param int max_atoms_per_core: + :param max_atoms_per_core: The maximum number of atoms on a core :return: (``row_data``, ``delayed_row_data``) where: @@ -252,8 +250,6 @@ def get_synapses( row per source, each row the same length * ``delayed_row_data`` is the delayed connectivity data arranged into a row per source per delay stage, each row the same length - :rtype: - tuple(~numpy.ndarray, ~numpy.ndarray) """ # Get delays in timesteps max_delay = app_edge.post_vertex.splitter.max_support_delay() @@ -327,20 +323,19 @@ def _get_row_data( synapse_dynamics: AbstractSynapseDynamics, max_row_n_synapses: int, max_row_n_words: int, max_atoms_per_core: int) -> _RowData: """ - :param ~numpy.ndarray connections: + :param connections: The connections to convert; the dtype is AbstractConnector.NUMPY_SYNAPSES_DTYPE - :param ~numpy.ndarray row_indices: + :param row_indices: The row into which each connection should go; same length as connections - :param int n_rows: The total number of rows - :param int n_synapse_types: The number of synapse types allowed - :param AbstractSynapseDynamics synapse_dynamics: + :param n_rows: The total number of rows + :param n_synapse_types: The number of synapse types allowed + :param synapse_dynamics: The synapse dynamics of the synapses - :param int max_row_n_synapses: The maximum number of synapses in a row - :param int max_row_n_words: The maximum number of words in a row - :param int max_atoms_per_core: The maximum number of atoms per core - :rtype: ~numpy.ndarray + :param max_row_n_synapses: The maximum number of synapses in a row + :param max_row_n_words: The maximum number of words in a row + :param max_atoms_per_core: The maximum number of atoms per core """ fp_data: Union[NDArray[uint32], List[NDArray[uint32]]] pp_data: Union[NDArray[uint32], List[NDArray[uint32]]] @@ -396,28 +391,27 @@ def convert_to_connections( Read the synapses for a given projection synapse information object out of the given data and convert to connection data - :param SynapseInformation synapse_info: + :param synapse_info: The synapse information of the synapses - :param int n_pre_atoms: The number of atoms in the pre-vertex - :param ~pacman.model.graphs.common.Slice post_vertex_slice: + :param n_pre_atoms: The number of atoms in the pre-vertex + :param post_vertex_slice: The slice of the target neurons of the synapses in the data - :param int max_row_length: + :param max_row_length: The length of each row in the data - :param int n_synapse_types: + :param n_synapse_types: The number of synapse types in total :param weight_scales: The weight scaling of each synapse type - :param bytearray data: + :param data: The raw data containing the synapses - :param bool delayed: + :param delayed: True if the data should be considered delayed - :param int post_vertex_max_delay_ticks: + :param post_vertex_max_delay_ticks: The maximum delayed ticks supported from post vertex - :param int max_atoms_per_core: + :param max_atoms_per_core: The maximum number of atoms on a core :return: The connections read from the data; the dtype is :py:const:`~.NUMPY_CONNECTORS_DTYPE` - :rtype: ~numpy.ndarray """ # If there is no data, return nothing if data is None or len(data) == 0: @@ -467,28 +461,27 @@ def read_all_synapses( Read the synapses for a given projection synapse information object out of the given delayed and undelayed data. - :param bytearray data: + :param data: The raw data containing the undelayed synapses - :param bytearray delayed_data: + :param delayed_data: The raw data containing the delayed synapses - :param SynapseInformation synapse_info: + :param synapse_info: The synapse info that generated the synapses - :param int n_synapse_types: + :param n_synapse_types: The total number of synapse types available :param weight_scales: A weight scale for each synapse type - :param int n_pre_atoms: The number of atoms in the pre-vertex - :param ~pacman.model.graphs.common.Slice post_vertex_slice: + :param n_pre_atoms: The number of atoms in the pre-vertex + :param post_vertex_slice: The slice of the post-vertex to read the synapses for - :param int post_vertex_max_delay_ticks: + :param post_vertex_max_delay_ticks: max delayed ticks supported from post vertex - :param MaxRowInfo max_row_info: + :param max_row_info: The maximum information for each of the rows - :param int max_atoms_per_core: + :param max_atoms_per_core: The maximum number of atoms on a core :return: The connections read from the data; the dtype is :py:const:`~.NUMPY_CONNECTORS_DTYPE` - :rtype: ~numpy.ndarray """ connections: List[ConnectionsArray] = [] max_row_length = max_row_info.undelayed_max_words @@ -513,12 +506,11 @@ def _parse_static_data( """ Parse static synaptic data. - :param ~numpy.ndarray row_data: The raw row data - :param AbstractStaticSynapseDynamics dynamics: + :param row_data: The raw row data + :param dynamics: The synapse dynamics that can decode the rows :return: A tuple of the recorded length of each row and the row data organised into rows - :rtype: tuple(~numpy.ndarray, list(~numpy.ndarray)) """ n_rows = row_data.shape[0] ff_size = row_data[:, 1] @@ -538,19 +530,18 @@ def _read_static_data( """ Read static data from row data. - :param AbstractStaticSynapseDynamics dynamics: + :param dynamics: The synapse dynamics that generated the data - :param int n_pre_atoms: The number of atoms on the pre-vertex - :param int n_synapse_types: + :param n_pre_atoms: The number of atoms on the pre-vertex + :param n_synapse_types: The number of synapse types available - :param ~numpy.ndarray row_data: + :param row_data: The raw row data to read - :param bool delayed: True if data should be considered delayed - :param int post_vertex_max_delay_ticks: post vertex delay maximum - :param int max_atoms_per_core: The maximum number of atoms on a core + :param delayed: True if data should be considered delayed + :param post_vertex_max_delay_ticks: post vertex delay maximum + :param max_atoms_per_core: The maximum number of atoms on a core :return: the connections read with dtype :py:const:`~.NUMPY_CONNECTORS_DTYPE` - :rtype: list(~numpy.ndarray) """ if row_data is None or not row_data.size: return numpy.zeros(0, dtype=NUMPY_CONNECTORS_DTYPE) @@ -572,15 +563,13 @@ def _parse_plastic_data( """ Parse plastic synapses from raw row data. - :param ~numpy.ndarray row_data: The raw data to parse - :param AbstractPlasticSynapseDynamics dynamics: + :param row_data: The raw data to parse + :param dynamics: The dynamics that generated the data :return: A tuple of the recorded length of the plastic-plastic data in each row; the plastic-plastic data organised into rows; the recorded length of the static-plastic data in each row; and the static-plastic data organised into rows - :rtype: tuple(~numpy.ndarray, list(~numpy.ndarray), ~numpy.ndarray, - list(~numpy.ndarray)) """ n_rows = row_data.shape[0] pp_size = row_data[:, 0] @@ -605,19 +594,18 @@ def _read_plastic_data( """ Read plastic data from raw data. - :param AbstractStaticSynapseDynamics dynamics: + :param dynamics: The synapse dynamics that generated the data - :param int n_pre_atoms: The number of atoms in the pre-vertex - :param int n_synapse_types: + :param n_pre_atoms: The number of atoms in the pre-vertex + :param n_synapse_types: The number of synapse types available - :param ~numpy.ndarray row_data: + :param row_data: The raw row data to read - :param bool delayed: True if data should be considered delayed - :param int post_vertex_max_delay_ticks: post vertex delay maximum - :param int max_atoms_per_core: The maximum number of atoms on a core + :param delayed: True if data should be considered delayed + :param post_vertex_max_delay_ticks: post vertex delay maximum + :param max_atoms_per_core: The maximum number of atoms on a core :return: the connections read with dtype :py:const:`~.NUMPY_CONNECTORS_DTYPE` - :rtype: list(~numpy.ndarray) """ if row_data is None or not row_data.size: return numpy.zeros(0, dtype=NUMPY_CONNECTORS_DTYPE) @@ -641,10 +629,9 @@ def _rescale_connections( """ Scale the connection data into machine values. - :param ~numpy.ndarray connections: The connections to be rescaled + :param connections: The connections to be rescaled :param weight_scales: The weight scale of each synapse type - :param SynapseInformation synapse_info: - The synapse information of the connections + :param synapse_info: The synapse information of the connections """ # Return the delays values to milliseconds connections["delay"] /= SpynnakerDataView.get_simulation_time_step_per_ms() @@ -661,14 +648,13 @@ def _convert_delayed_data( Take the delayed_connections and convert the source ids and delay values back to global values. - :param ~numpy.ndarray n_synapses: The number of synapses in each row - :param int n_pre_atoms: number of atoms in the pre-vertex - :param ~numpy.ndarray delayed_connections: + :param n_synapses: The number of synapses in each row + :param n_pre_atoms: number of atoms in the pre-vertex + :param delayed_connections: The connections to convert of dtype :py:const:`~.NUMPY_CONNECTORS_DTYPE` - :param int post_vertex_max_delay_ticks: post vertex delay maximum + :param post_vertex_max_delay_ticks: post vertex delay maximum :return: The converted connection with the same dtype - :rtype: ~numpy.ndarray """ # Work out the delay stage of each row; rows are the all the rows # from the first delay stage, then all from the second stage and so on diff --git a/spynnaker/pyNN/models/neuron/synapse_types/abstract_synapse_type.py b/spynnaker/pyNN/models/neuron/synapse_types/abstract_synapse_type.py index 4a01c3edb3b..9fce86667e2 100644 --- a/spynnaker/pyNN/models/neuron/synapse_types/abstract_synapse_type.py +++ b/spynnaker/pyNN/models/neuron/synapse_types/abstract_synapse_type.py @@ -31,7 +31,6 @@ def get_n_synapse_types(self) -> int: Get the number of synapse types supported. :return: The number of synapse types supported - :rtype: int """ raise NotImplementedError @@ -41,7 +40,6 @@ def get_synapse_id_by_target(self, target: str) -> Optional[int]: Get the ID of a synapse given the name. :return: The ID of the synapse - :rtype: int """ raise NotImplementedError @@ -51,6 +49,5 @@ def get_synapse_targets(self) -> Sequence[str]: Get the target names of the synapse type. :return: an array of strings (usually a list or tuple) - :rtype: iterable(str) """ raise NotImplementedError diff --git a/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_alpha.py b/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_alpha.py index 36d51a0ae57..d964b1e485e 100644 --- a/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_alpha.py +++ b/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_alpha.py @@ -57,23 +57,11 @@ def __init__( tau_syn_I: ModelParameter): r""" :param exc_response: :math:`response^\mathrm{linear}_e` - :type exc_response: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param exc_exp_response: :math:`response^\mathrm{exponential}_e` - :type exc_exp_response: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param tau_syn_E: :math:`\tau^{syn}_e` - :type tau_syn_E: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param inh_response: :math:`response^\mathrm{linear}_i` - :type inh_response: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param inh_exp_response: :math:`response^\mathrm{exponential}_i` - :type inh_exp_response: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param tau_syn_I: :math:`\tau^{syn}_i` - :type tau_syn_I: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function """ super().__init__( [Struct([ @@ -136,8 +124,6 @@ def get_synapse_targets(self) -> Tuple[str, ...]: def exc_response(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__exc_response @@ -145,8 +131,6 @@ def exc_response(self) -> ModelParameter: def exc_response(self, exc_response: ModelParameter) -> None: """ Value as passed into the init. - - :rtype: ModelParameter """ self.__exc_response = exc_response @@ -154,8 +138,6 @@ def exc_response(self, exc_response: ModelParameter) -> None: def tau_syn_E(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ # pylint: disable=invalid-name return self.__tau_syn_E @@ -164,8 +146,6 @@ def tau_syn_E(self) -> ModelParameter: def inh_response(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__inh_response @@ -173,8 +153,6 @@ def inh_response(self) -> ModelParameter: def tau_syn_I(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ # pylint: disable=invalid-name return self.__tau_syn_I diff --git a/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_delta.py b/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_delta.py index 3b33f429812..2e9ba68c70d 100644 --- a/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_delta.py +++ b/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_delta.py @@ -38,11 +38,7 @@ class SynapseTypeDelta(AbstractSynapseType): def __init__(self, isyn_exc: ModelParameter, isyn_inh: ModelParameter): """ :param isyn_exc: :math:`I^{syn}_e` - :type isyn_exc: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param isyn_inh: :math:`I^{syn}_i` - :type isyn_inh: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function """ super().__init__( [Struct([ @@ -82,8 +78,6 @@ def get_synapse_targets(self) -> Tuple[str, ...]: def isyn_exc(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__isyn_exc @@ -91,7 +85,5 @@ def isyn_exc(self) -> ModelParameter: def isyn_inh(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__isyn_inh diff --git a/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_dual_exponential.py b/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_dual_exponential.py index bd7f4a11797..e8fcc680463 100644 --- a/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_dual_exponential.py +++ b/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_dual_exponential.py @@ -52,23 +52,11 @@ def __init__( isyn_exc2: ModelParameter, isyn_inh: ModelParameter): r""" :param tau_syn_E: :math:`\tau^{syn}_{e_1}` - :type tau_syn_E: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param tau_syn_E2: :math:`\tau^{syn}_{e_2}` - :type tau_syn_E2: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param tau_syn_I: :math:`\tau^{syn}_i` - :type tau_syn_I: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param isyn_exc: :math:`I^{syn}_{e_1}` - :type isyn_exc: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param isyn_exc2: :math:`I^{syn}_{e_2}` - :type isyn_exc2: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param isyn_inh: :math:`I^{syn}_i` - :type isyn_inh: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function """ super().__init__( [Struct([ @@ -127,8 +115,6 @@ def tau_syn_E(self) -> ModelParameter: # pylint: disable=invalid-name """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__tau_syn_E @@ -137,8 +123,6 @@ def tau_syn_E2(self) -> ModelParameter: # pylint: disable=invalid-name """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__tau_syn_E2 @@ -147,8 +131,6 @@ def tau_syn_I(self) -> ModelParameter: # pylint: disable=invalid-name """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__tau_syn_I @@ -156,8 +138,6 @@ def tau_syn_I(self) -> ModelParameter: def isyn_exc(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__isyn_exc @@ -165,8 +145,6 @@ def isyn_exc(self) -> ModelParameter: def isyn_inh(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__isyn_inh @@ -174,7 +152,5 @@ def isyn_inh(self) -> ModelParameter: def isyn_exc2(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__isyn_exc2 diff --git a/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_exponential.py b/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_exponential.py index 5ba81e61007..926e8389b83 100644 --- a/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_exponential.py +++ b/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_exponential.py @@ -46,17 +46,9 @@ def __init__(self, tau_syn_E: ModelParameter, tau_syn_I: ModelParameter, isyn_exc: ModelParameter, isyn_inh: ModelParameter): r""" :param tau_syn_E: :math:`\tau^{syn}_e` - :type tau_syn_E: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param tau_syn_I: :math:`\tau^{syn}_i` - :type tau_syn_I: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param isyn_exc: :math:`I^{syn}_e` - :type isyn_exc: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param isyn_inh: :math:`I^{syn}_i` - :type isyn_inh: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function """ super().__init__( [Struct([ @@ -106,8 +98,6 @@ def tau_syn_E(self) -> ModelParameter: # pylint: disable=invalid-name """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__tau_syn_E @@ -116,8 +106,6 @@ def tau_syn_I(self) -> ModelParameter: # pylint: disable=invalid-name """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__tau_syn_I @@ -125,8 +113,6 @@ def tau_syn_I(self) -> ModelParameter: def isyn_exc(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__isyn_exc @@ -134,7 +120,5 @@ def isyn_exc(self) -> ModelParameter: def isyn_inh(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__isyn_inh diff --git a/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_semd.py b/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_semd.py index 4f0c6ef769a..9678d9a674e 100644 --- a/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_semd.py +++ b/spynnaker/pyNN/models/neuron/synapse_types/synapse_type_semd.py @@ -62,32 +62,14 @@ def __init__( scaling_factor: ModelParameter): r""" :param tau_syn_E: :math:`\tau^{syn}_{e_1}` - :type tau_syn_E: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param tau_syn_E2: :math:`\tau^{syn}_{e_2}` - :type tau_syn_E2: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param tau_syn_I: :math:`\tau^{syn}_i` - :type tau_syn_I: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param isyn_exc: :math:`I^{syn}_{e_1}` - :type isyn_exc: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param isyn_exc2: :math:`I^{syn}_{e_2}` - :type isyn_exc2: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param isyn_inh: :math:`I^{syn}_i` - :type isyn_inh: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param multiplicator: - :type multiplicator: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param exc2_old: - :type exc2_old: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param scaling_factor: - :type scaling_factor: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function """ super().__init__( [Struct([ @@ -155,8 +137,6 @@ def get_synapse_targets(self) -> Tuple[str, ...]: def tau_syn_E(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ # pylint: disable=invalid-name return self.__tau_syn_E @@ -165,8 +145,6 @@ def tau_syn_E(self) -> ModelParameter: def tau_syn_E2(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ # pylint: disable=invalid-name return self.__tau_syn_E2 @@ -175,8 +153,6 @@ def tau_syn_E2(self) -> ModelParameter: def tau_syn_I(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ # pylint: disable=invalid-name return self.__tau_syn_I @@ -185,8 +161,6 @@ def tau_syn_I(self) -> ModelParameter: def isyn_exc(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__isyn_exc @@ -194,8 +168,6 @@ def isyn_exc(self) -> ModelParameter: def isyn_inh(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__isyn_inh @@ -203,8 +175,6 @@ def isyn_inh(self) -> ModelParameter: def isyn_exc2(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__isyn_exc2 @@ -212,8 +182,6 @@ def isyn_exc2(self) -> ModelParameter: def multiplicator(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__multiplicator @@ -221,8 +189,6 @@ def multiplicator(self) -> ModelParameter: def exc2_old(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__exc2_old @@ -230,7 +196,5 @@ def exc2_old(self) -> ModelParameter: def scaling_factor(self) -> ModelParameter: """ Value as passed into the init. - - :rtype: ModelParameter """ return self.__scaling_factor diff --git a/spynnaker/pyNN/models/neuron/synaptic_matrices.py b/spynnaker/pyNN/models/neuron/synaptic_matrices.py index 92e2819303b..eea943567fb 100644 --- a/spynnaker/pyNN/models/neuron/synaptic_matrices.py +++ b/spynnaker/pyNN/models/neuron/synaptic_matrices.py @@ -178,10 +178,10 @@ def __init__( regions: SynapseRegions, max_atoms_per_core: int, weight_scales: WeightScales, all_syn_block_sz: int): """ - :param ~pacman.model.graphs.application.ApplicationVertex app_vertex: - :param SynapseRegions regions: The synapse regions to use - :param int max_atoms_per_core: - :param int all_syn_block_sz: + :param app_vertex: + :param regions: The synapse regions to use + :param max_atoms_per_core: + :param all_syn_block_sz: """ self.__app_vertex = app_vertex self.__regions = regions @@ -215,8 +215,6 @@ def __init__( def max_gen_data(self) -> int: """ The maximum amount of data to be generated for the synapses. - - :rtype: int """ return self.__max_gen_data @@ -224,8 +222,6 @@ def max_gen_data(self) -> int: def bit_field_size(self) -> int: """ The size of the bit field data. - - :rtype: int """ return self.__bit_field_size @@ -236,8 +232,6 @@ def host_generated_block_addr(self) -> int: written by the on-host synaptic generation, i.e. the start of the space that can be overwritten provided the synapse expander is run again. - - :rtype: int """ return self.__host_generated_block_addr @@ -247,8 +241,6 @@ def on_chip_generated_matrix_size(self) -> int: The size of the space used by the generated matrix, i.e. the space that can be overwritten provided the synapse expander is run again. - - :rtype: int """ return (self.__on_chip_generated_block_addr - self.__host_generated_block_addr) @@ -353,11 +345,11 @@ def write_synaptic_data( """ Write the synaptic data for all incoming projections. - :param ~data_specification.DataSpecificationGenerator spec: + :param spec: The spec to write to - :param ~pacman.model.graphs.common.Slice post_vertex_slice: + :param post_vertex_slice: The slice of the post-vertex the matrix is for - :param SynapseRegionReferences references: + :param references: Regions which are referenced; each region which is not referenced can be `None`. """ @@ -396,9 +388,7 @@ def __write_synapse_expander_data_spec( """ Write the data spec for the synapse expander. - :param ~.DataSpecificationGenerator spec: - The specification to write to - :param list(GeneratorData) generator_data: The data to be written + :param spec: The specification to write to """ if self.__generated_data is None: if connection_builder_ref is not None: @@ -453,11 +443,10 @@ def __get_app_key_and_mask( """ Get a key and mask for an incoming application vertex as a whole. - :param RoutingInfo r_info: The routing information for the vertex - :param int n_stages: The number of delay stages - :param PopulationApplicationVertex pre_vertex: The pre-vertex - :param str partition_id: The partition identifier - :rtype: AppKeyInfo + :param r_info: The routing information for the vertex + :param n_stages: The number of delay stages + :param pre_vertex: The pre-vertex + :param partition_id: The partition identifier """ if isinstance(pre_vertex, ApplicationVirtualVertex): mask_size = 0 @@ -483,9 +472,9 @@ def __app_key_and_mask( """ Get a key and mask for an incoming application vertex as a whole. - :param ProjectionApplicationEdge app_edge: + :param app_edge: The application edge to get the key and mask of - :param SynapseInformation s_info: + :param s_info: The synapse information of the projection """ routing_info = SpynnakerDataView.get_routing_infos() @@ -502,9 +491,9 @@ def __delay_app_key_and_mask( Get a key and mask for a whole incoming delayed application vertex, or return `None` if no delay edge exists. - :param ProjectionApplicationEdge app_edge: + :param app_edge: The application edge to get the key and mask of - :param SynapseInformation s_info: + :param s_info: The synapse information of the projection """ delay_edge = app_edge.delay_edge @@ -527,15 +516,14 @@ def get_connections_from_machine( """ Get the synaptic connections from the machine. - :param ~pacman.model.placements.Placement placement: + :param placement: Where the vertices are on the machine - :param ProjectionApplicationEdge app_edge: + :param app_edge: The application edge of the projection - :param SynapseInformation synapse_info: + :param synapse_info: The synapse information of the projection :return: A list of arrays of connections, each with dtype :py:const:`~.NUMPY_CONNECTORS_DTYPE` - :rtype: list(~numpy.ndarray) """ if is_sdram_poisson_source(app_edge): return cast(SpikeSourcePoissonVertex, app_edge.pre_vertex)\ @@ -548,7 +536,7 @@ def read_generated_connection_holders(self, placement: Placement) -> None: Fill in any pre-run connection holders for data which is generated on the machine, after it has been generated. - :param ~pacman.model.placements.Placement placement: + :param placement: where the data is to be read from """ for matrix in self.__on_machine_matrices: @@ -558,8 +546,6 @@ def read_generated_connection_holders(self, placement: Placement) -> None: def gen_on_machine(self) -> bool: """ Whether any matrices need to be generated on the machine. - - :rtype: bool """ return self.__gen_on_machine @@ -568,9 +554,9 @@ def get_index(self, app_edge: ProjectionApplicationEdge, """ Get the index of an incoming projection in the population table. - :param ProjectionApplicationEdge app_edge: + :param app_edge: The application edge of the projection - :param SynapseInformation synapse_info: + :param synapse_info: The synapse information of the projection """ matrix = self.__matrices[app_edge, synapse_info] @@ -581,8 +567,7 @@ def get_download_regions( """ Get the regions that need to be downloaded. - :param ~pacman.model.placements.Placement placement: - The placement of the vertex + :param placement: The placement of the vertex :return: The index, the start address and the size of the regions """ diff --git a/spynnaker/pyNN/models/neuron/synaptic_matrix_app.py b/spynnaker/pyNN/models/neuron/synaptic_matrix_app.py index f89724a3584..be46e619b9f 100644 --- a/spynnaker/pyNN/models/neuron/synaptic_matrix_app.py +++ b/spynnaker/pyNN/models/neuron/synaptic_matrix_app.py @@ -93,18 +93,18 @@ def __init__( delay_app_key_info: Optional[AppKeyInfo], weight_scales: WeightScales): """ - :param SynapseInformation synapse_info: + :param synapse_info: The projection synapse information - :param ProjectionApplicationEdge app_edge: + :param app_edge: The projection application edge - :param int n_synapse_types: The number of synapse types accepted - :param int synaptic_matrix_region: + :param n_synapse_types: The number of synapse types accepted + :param synaptic_matrix_region: The region where synaptic matrices are stored - :param int all_syn_block_sz: + :param all_syn_block_sz: The space available for all synaptic matrices on the core - :param AppKeyInfo app_key_info: + :param app_key_info: Application-level routing key information for undelayed vertices - :param AppKeyInfo delay_app_key_info: + :param delay_app_key_info: Application-level routing key information for delayed vertices :param weight_scales: Weight scale for each synapse edge @@ -144,8 +144,6 @@ def __init__( def gen_size(self) -> int: """ Size of a block. - - :rtype: int """ max_row_length = max( self.__max_row_info.undelayed_max_bytes, @@ -159,11 +157,9 @@ def reserve_matrices( """ Allocate the master pop table entries for the blocks. - :param int block_addr: Where the allocation can start from - :param MasterPopTableAsBinarySearch pop_table: - The master population table + :param block_addr: Where the allocation can start from + :param pop_table: The master population table :return: Where the next allocation can start from - :rtype: int """ block_addr = self.__reserve_app_matrix(block_addr, pop_table) block_addr = self.__reserve_delay_app_matrix(block_addr, pop_table) @@ -175,12 +171,11 @@ def __reserve_app_matrix( """ Reserve space for the matrix in the master pop table. - :param int block_addr: + :param block_addr: The address in the synaptic matrix region to start writing at - :param MasterPopTableAsBinarySearch pop_table: + :param pop_table: The master population table :return: The updated block address - :rtype: int """ # If there is no routing info, don't write anything if self.__app_key_info is None: @@ -212,12 +207,11 @@ def __reserve_delay_app_matrix( """ Reserve space in the master pop table for a delayed matrix. - :param int block_addr: + :param block_addr: The address in the synaptic matrix region to start writing at - :param MasterPopTableAsBinarySearch pop_table: + :param pop_table: The master population table :return: The updated block address - :rtype: int """ # If there is no routing info, don't write anything if self.__delay_app_key_info is None: @@ -250,11 +244,9 @@ def __next_addr(self, block_addr: int, size: int) -> int: """ Get the next address after a block, checking it is in range. - :param int block_addr: The address of the start of the block - :param int size: The size of the block in bytes - :param int max_addr: The maximum allowed address + :param block_addr: The address of the start of the block + :param size: The size of the block in bytes :return: The updated address - :rtype: int :raises ValueError: If the updated address is out of range """ next_addr = block_addr + size @@ -271,12 +263,11 @@ def append_matrix( """ Append a synaptic matrix from be written from host. - :param ~pacman.model.graphs.common.Slice post_vertex_slice: + :param post_vertex_slice: The slice of the post-vertex the matrix is for - :param list data_to_write: List to append the data to write to - :param int block_addr: The amount of data written so far + :param data_to_write: List to append the data to write to + :param block_addr: The amount of data written so far :return: The amount of data written after this data has been written - :rtype: int """ row_data, delay_row_data = self.__get_row_data(post_vertex_slice) self.__update_connection_holders( @@ -312,7 +303,6 @@ def __get_row_data( Generate the row data for a synaptic matrix from the description. :return: The data and the delayed data - :rtype: tuple(~numpy.ndarray or None, ~numpy.ndarray or None) """ # Get the actual connections post_slices =\ @@ -351,10 +341,8 @@ def __update_connection_holders( """ Fill in connections in the connection holders as they are created. - :param ~numpy.ndarray data: The row data created - :param ~numpy.ndarray delayed_data: The delayed row data created - :param ~pacman.model.graphs.machine.MachineVertex m_vertex: - The machine edge the connections are for + :param data: The row data created + :param delayed_data: The delayed row data created """ post_splitter = self.__app_edge.post_vertex.splitter post_vertex_max_delay_ticks = post_splitter.max_support_delay() @@ -371,7 +359,6 @@ def get_generator_data(self) -> GeneratorData: Prepare to write a matrix using an on-chip generator. :return: The data to generate with - :rtype: GeneratorData """ max_pre_atoms_per_core = min( self.__app_edge.pre_vertex.n_atoms, @@ -385,7 +372,7 @@ def read_generated_connection_holders(self, placement: Placement) -> None: """ Read any pre-run connection holders after data has been generated. - :param ~pacman.model.placements.Placement placement: + :param placement: Where the matrix is on the machine """ if self.__synapse_info.pre_run_connection_holders: @@ -399,11 +386,10 @@ def get_connections(self, placement: Placement) -> List[NDArray]: """ Read connections from an address on the machine. - :param ~pacman.model.placements.Placement placement: + :param placement: Where the matrix is on the machine :return: A list of arrays of connections, each with dtype :py:const:`~.NUMPY_CONNECTORS_DTYPE` - :rtype: list(~numpy.ndarray) """ connections = list() @@ -454,11 +440,10 @@ def __get_block( """ Get a block of data for undelayed synapses. - :param Placement placement: Where the matrix is on the machine - :param int synapses_address: + :param placement: Where the matrix is on the machine + :param synapses_address: The base address of the synaptic matrix region :return: The raw data from the synaptic matrix - :rtype: bytes """ assert self.__syn_mat_offset is not None address = self.__syn_mat_offset + synapses_address @@ -470,12 +455,11 @@ def __get_delayed_block( """ Get a block of data for delayed synapses. - :param ~pacman.model.placements.Placement placement: + :param placement: Where the matrix is on the machine - :param int synapses_address: + :param synapses_address: The base address of the synaptic matrix region :return: The raw data from the delayed synaptic matrix - :rtype: bytes """ assert self.__delay_syn_mat_offset is not None address = self.__delay_syn_mat_offset + synapses_address @@ -485,10 +469,6 @@ def __get_delayed_block( def get_index(self) -> int: """ Get the index in the master population table of the matrix. - - :param ~pacman.model.graphs.machine.MachineVertex m_vertex: - The source machine vertex - :rtype: int """ if self.__index is None: raise RuntimeError("master pop table space not yet reserved") @@ -501,9 +481,9 @@ def get_download_regions( Get the data regions that should be downloaded when the simulation pauses. - :param ~pacman.model.placements.Placement placement: + :param placement: The placement of the vertex - :param int start_index: + :param start_index: The index to use for the first region to download :return: A list of tuples of (index, address, size) to download diff --git a/spynnaker/pyNN/models/neuron/threshold_types/threshold_type_fixed_prob.py b/spynnaker/pyNN/models/neuron/threshold_types/threshold_type_fixed_prob.py index 8cf4a5af966..dae0d414a8f 100644 --- a/spynnaker/pyNN/models/neuron/threshold_types/threshold_type_fixed_prob.py +++ b/spynnaker/pyNN/models/neuron/threshold_types/threshold_type_fixed_prob.py @@ -45,11 +45,7 @@ def __init__(self, v_thresh: ModelParameter, p_thresh: ModelParameter, """ :param v_thresh: :math:`V_{thresh}` - :type v_thresh: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param p_thresh: :math:`P_{thresh}` - :type p_thresh: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param seed: Random number generator seed """ super().__init__( diff --git a/spynnaker/pyNN/models/neuron/threshold_types/threshold_type_maass_stochastic.py b/spynnaker/pyNN/models/neuron/threshold_types/threshold_type_maass_stochastic.py index 464eefb24e0..fa6f8043f0a 100644 --- a/spynnaker/pyNN/models/neuron/threshold_types/threshold_type_maass_stochastic.py +++ b/spynnaker/pyNN/models/neuron/threshold_types/threshold_type_maass_stochastic.py @@ -47,14 +47,8 @@ def __init__(self, du_th: ModelParameter, tau_th: ModelParameter, v_thresh: ModelParameter): r""" :param du_th: :math:`du_{thresh}` - :type du_th: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param tau_th: :math:`\tau_{thresh}` - :type tau_th: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function :param v_thresh: :math:`V_{thresh}` - :type v_thresh: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function """ super().__init__( [Struct([ diff --git a/spynnaker/pyNN/models/neuron/threshold_types/threshold_type_static.py b/spynnaker/pyNN/models/neuron/threshold_types/threshold_type_static.py index b3d550d5a97..45056799741 100644 --- a/spynnaker/pyNN/models/neuron/threshold_types/threshold_type_static.py +++ b/spynnaker/pyNN/models/neuron/threshold_types/threshold_type_static.py @@ -34,8 +34,6 @@ class ThresholdTypeStatic(AbstractThresholdType): def __init__(self, v_thresh: ModelParameter): """ :param v_thresh: :math:`V_{thresh}` - :type v_thresh: float or iterable(float) or - ~spynnaker.pyNN.RandomDistribution or (mapping) function """ super().__init__( [Struct([(DataType.S1615, V_THRESH)])], diff --git a/spynnaker/pyNN/models/populations/assembly.py b/spynnaker/pyNN/models/populations/assembly.py index 5e5e6224355..dd9dfc0da11 100644 --- a/spynnaker/pyNN/models/populations/assembly.py +++ b/spynnaker/pyNN/models/populations/assembly.py @@ -21,7 +21,5 @@ class Assembly(pynn_common.Assembly): where all the neurons are of the same type. :param populations: the populations or views to form the assembly out of - :type populations: ~spynnaker.pyNN.models.populations.Population or - ~spynnaker.pyNN.models.populations.PopulationView :param kwargs: may contain `label` (a string describing the assembly) """ diff --git a/spynnaker/pyNN/models/populations/population.py b/spynnaker/pyNN/models/populations/population.py index ed309b44a0a..766cfe117ed 100644 --- a/spynnaker/pyNN/models/populations/population.py +++ b/spynnaker/pyNN/models/populations/population.py @@ -852,7 +852,6 @@ def __init__(self, vertex: PopulationApplicationVertex): def vertex(self) -> PopulationApplicationVertex: """ The vertex passed into the init. - :return: """ return self.__vertex diff --git a/spynnaker/pyNN/models/populations/population_view.py b/spynnaker/pyNN/models/populations/population_view.py index aae40a35c7a..ae3e35e2788 100644 --- a/spynnaker/pyNN/models/populations/population_view.py +++ b/spynnaker/pyNN/models/populations/population_view.py @@ -84,8 +84,6 @@ def __init__( selector: Selector, label: Optional[str] = None): """ :param parent: the population or view to make the view from - :param vertex: The actual underlying vertex - :param recorder: The recorder of the Population :param selector: a slice or numpy mask array. The mask array should either be a Boolean array (ideally) of the same size as the parent, @@ -99,9 +97,7 @@ def __init__( PopulationView(p, slice(2, 5, 2)) will all create the same view. - :type selector: None or slice or int or list(bool) or list(int) or - ~numpy.ndarray(bool) or ~numpy.ndarray(int) - :param str label: A label for the view + :param label: A label for the view """ self.__parent = parent sized = AbstractSized(parent.size) diff --git a/spynnaker/pyNN/models/recorder.py b/spynnaker/pyNN/models/recorder.py index 8c6883f094b..3122a386bae 100644 --- a/spynnaker/pyNN/models/recorder.py +++ b/spynnaker/pyNN/models/recorder.py @@ -85,7 +85,7 @@ def record( :param to_file: a file to automatically record to (optional). :py:meth:`write_data` will be automatically called when `sim.end()` is called. - :param int sampling_interval: a value in milliseconds, and an integer + :param sampling_interval: a value in milliseconds, and an integer multiple of the simulation timestep. :param indexes: The indexes of neurons to record from. This is non-standard PyNN and equivalent to creating a view with diff --git a/spynnaker/pyNN/models/spike_source/spike_source_array.py b/spynnaker/pyNN/models/spike_source/spike_source_array.py index 62276048413..eb19bfd5c3f 100644 --- a/spynnaker/pyNN/models/spike_source/spike_source_array.py +++ b/spynnaker/pyNN/models/spike_source/spike_source_array.py @@ -40,9 +40,7 @@ def create_vertex( n_colour_bits: Optional[int] = None) -> SpikeSourceArrayVertex: """ :param splitter: - :type splitter: - ~pacman.model.partitioner_splitters.AbstractSplitterCommon or None - :param int n_colour_bits: + :param n_colour_bits: """ if neurons_per_core is None: neurons_per_core = \ diff --git a/spynnaker/pyNN/models/spike_source/spike_source_array_vertex.py b/spynnaker/pyNN/models/spike_source/spike_source_array_vertex.py index 5fa95da9421..69eb8618942 100644 --- a/spynnaker/pyNN/models/spike_source/spike_source_array_vertex.py +++ b/spynnaker/pyNN/models/spike_source/spike_source_array_vertex.py @@ -215,7 +215,7 @@ def _to_early_spikes_single_list(self, spike_times: _SingleList) -> None: Logs a warning for the first one found - :param list(int) spike_times: + :param spike_times: """ current_time = SpynnakerDataView.get_current_run_time_ms() for spike_time in spike_times: @@ -233,7 +233,7 @@ def _check_spikes_double_list(self, spike_times: _DoubleList) -> None: Logs a warning for the first one found - :param iterable(int) spike_times: + :param spike_times: """ current_time = SpynnakerDataView.get_current_run_time_ms() for neuron_id in range(0, self.n_atoms): diff --git a/spynnaker/pyNN/models/spike_source/spike_source_from_file.py b/spynnaker/pyNN/models/spike_source/spike_source_from_file.py index 349d8554027..78303f686a2 100644 --- a/spynnaker/pyNN/models/spike_source/spike_source_from_file.py +++ b/spynnaker/pyNN/models/spike_source/spike_source_from_file.py @@ -44,8 +44,6 @@ def __init__( def spike_times(self) -> NDArray[numpy.integer]: """ The spike times read from the file. - - :rtype: ndarray """ # type guaranteed by init return cast(NDArray[numpy.integer], self._spike_times) diff --git a/spynnaker/pyNN/models/spike_source/spike_source_poisson.py b/spynnaker/pyNN/models/spike_source/spike_source_poisson.py index 1ca85ea629b..ffe60449b5b 100644 --- a/spynnaker/pyNN/models/spike_source/spike_source_poisson.py +++ b/spynnaker/pyNN/models/spike_source/spike_source_poisson.py @@ -57,12 +57,10 @@ def create_vertex( neurons_per_core: Optional[Union[int, Tuple[int, ...]]] = None, n_colour_bits: Optional[int] = None) -> SpikeSourcePoissonVertex: """ - :param float seed: - :param float max_rate: + :param seed: + :param max_rate: :param splitter: - :type splitter: - ~pacman.model.partitioner_splitters.AbstractSplitterCommon or None - :param int n_colour_bits: + :param n_colour_bits: """ if neurons_per_core is None: neurons_per_core = \ diff --git a/spynnaker/pyNN/models/spike_source/spike_source_poisson_machine_vertex.py b/spynnaker/pyNN/models/spike_source/spike_source_poisson_machine_vertex.py index 198104b3db6..8cbd9aa6b3c 100644 --- a/spynnaker/pyNN/models/spike_source/spike_source_poisson_machine_vertex.py +++ b/spynnaker/pyNN/models/spike_source/spike_source_poisson_machine_vertex.py @@ -95,8 +95,7 @@ def get_params_bytes(n_atoms: int) -> int: """ Gets the size of the Poisson parameters in bytes. - :param int n_atoms: How many atoms to account for - :rtype: int + :param n_atoms: How many atoms to account for """ return (PARAMS_BASE_WORDS + n_atoms) * BYTES_PER_WORD @@ -105,9 +104,8 @@ def get_rates_bytes(n_atoms: int, n_rates: int) -> int: """ Gets the size of the Poisson rates in bytes. - :param int n_atoms: How many atoms to account for - :param int n_rates: How many rates to account for - :rtype: int + :param n_atoms: How many atoms to account for + :param n_rates: How many rates to account for """ return ((n_atoms * PARAMS_WORDS_PER_NEURON) + (n_rates * PARAMS_WORDS_PER_RATE)) * BYTES_PER_WORD @@ -117,9 +115,8 @@ def get_expander_rates_bytes(n_atoms: int, n_rates: int) -> int: """ Gets the size of the Poisson rates in bytes. - :param int n_atoms: How many atoms to account for - :param int n_rates: How many rates to account for - :rtype: int + :param n_atoms: How many atoms to account for + :param n_rates: How many rates to account for """ return ((n_atoms * EXPANDER_WORDS_PER_NEURON) + (n_rates * PARAMS_WORDS_PER_RATE) + @@ -130,8 +127,7 @@ def get_sdram_edge_params_bytes(vertex_slice: Slice) -> int: """ Gets the size of the Poisson SDRAM region in bytes. - :param ~pacman.model.graphs.common.Slice vertex_slice: - :rtype: int + :param vertex_slice: """ return SDRAM_EDGE_PARAMS_BASE_BYTES + ( vertex_slice.n_atoms * SDRAM_EDGE_PARAMS_BYTES_PER_WEIGHT) @@ -446,8 +442,7 @@ def _write_poisson_rates(self, spec: DataSpecificationBase) -> None: """ Generate Rate data for Poisson spike sources. - :param ~data_specification.DataSpecification spec: - the data specification writer + :param spec: the data specification writer """ spec.comment( f"\nWriting Rates for {self.vertex_slice.n_atoms} " @@ -492,8 +487,7 @@ def _write_poisson_parameters(self, spec: DataSpecificationBase) -> None: """ Generate Parameter data for Poisson spike sources. - :param ~data_specification.DataSpecification spec: - the data specification writer + :param spec: the data specification writer """ spec.comment( f"\nWriting parameters for {self.vertex_slice.n_atoms} " @@ -576,7 +570,7 @@ def read_parameters_from_machine(self, placement: Placement) -> None: """ Reads the poisson rates of the machine if they could have changed. - :param Placement placement: + :param placement: """ # It is only worth updating the rates when there is a control edge # that can change them @@ -614,8 +608,7 @@ def read_connections( """ Read the connections from the machine. - :param SynapseInformation synapse_info: - The synapse information being read + :param synapse_info: The synapse information being read :return: The connections read back """ size = self.vertex_slice.n_atoms * SDRAM_EDGE_PARAMS_BYTES_PER_WEIGHT diff --git a/spynnaker/pyNN/models/spike_source/spike_source_poisson_variable.py b/spynnaker/pyNN/models/spike_source/spike_source_poisson_variable.py index 690305829b4..e812ddaff76 100644 --- a/spynnaker/pyNN/models/spike_source/spike_source_poisson_variable.py +++ b/spynnaker/pyNN/models/spike_source/spike_source_poisson_variable.py @@ -57,10 +57,8 @@ def create_vertex( splitter: Optional[AbstractSplitterCommon] = None ) -> SpikeSourcePoissonVertex: """ - :param float seed: + :param seed: :param splitter: - :type splitter: - ~pacman.model.partitioner_splitters.AbstractSplitterCommon or None """ max_atoms = self.get_model_max_atoms_per_dimension_per_core() return SpikeSourcePoissonVertex( diff --git a/spynnaker/pyNN/models/spike_source/spike_source_poisson_vertex.py b/spynnaker/pyNN/models/spike_source/spike_source_poisson_vertex.py index 3b976743380..27c6ed9d7c1 100644 --- a/spynnaker/pyNN/models/spike_source/spike_source_poisson_vertex.py +++ b/spynnaker/pyNN/models/spike_source/spike_source_poisson_vertex.py @@ -128,8 +128,6 @@ def is_iterable(value: Values) -> TypeGuard[ Union[Sequence[float], NDArray[numpy.floating]]]: """ Check that the Value is iterable. - - :type value: float, iter(float) or RandomDistribution """ return hasattr(value, "__iter__") @@ -179,22 +177,20 @@ def __init__( splitter: Optional[AbstractSplitterCommon] = None, n_colour_bits: Optional[int] = None): """ - :param int n_neurons: - :param str label: - :param float seed: - :param int max_atoms_per_core: - :param ~spynnaker.pyNN.models.spike_source.SpikeSourcePoisson model: - :param float rate: - :param int start: - :param int duration: - :param iterable(float) rates: - :param iterable(int) starts: - :param iterable(int) durations: - :param float max_rate: + :param n_neurons: + :param label: + :param seed: + :param max_atoms_per_core: + :param model: + :param rate: + :param start: + :param duration: + :param rates: + :param starts: + :param durations: + :param max_rate: :param splitter: - :type splitter: - ~pacman.model.partitioner_splitters.AbstractSplitterCommon or None - :param int n_colour_bits: + :param n_colour_bits: """ super().__init__(label, max_atoms_per_core, splitter) @@ -325,8 +321,6 @@ def set_structure(self, structure: BaseStructure) -> None: def rates(self) -> RangedList[NDArray[numpy.floating]]: """ Get the rates. - - :rtype: ~spinn_utilities.ranged.RangedList """ # UGH! Mypy has been defeated! return cast(Any, self.__data["rates"]) @@ -335,7 +329,7 @@ def add_outgoing_projection(self, projection: Projection) -> None: """ Add an outgoing projection from this vertex. - :param Projection projection: The projection to add + :param projection: The projection to add """ self.__outgoing_projections.append(projection) @@ -343,8 +337,6 @@ def add_outgoing_projection(self, projection: Projection) -> None: def outgoing_projections(self) -> Sequence[Projection]: """ The projections outgoing from this vertex. - - :rtype: list(Projection) """ return self.__outgoing_projections @@ -352,8 +344,6 @@ def outgoing_projections(self) -> Sequence[Projection]: def n_profile_samples(self) -> int: """ The n_profile_samples read from the config - - :rtype: int """ return self.__n_profile_samples @@ -361,8 +351,6 @@ def n_profile_samples(self) -> int: def time_to_spike(self) -> RangedList: """ The "time_to_spike range list. - - :rtype: RangedList """ return self.__data["time_to_spike"] @@ -503,7 +491,6 @@ def max_spikes_per_ts(self) -> float: Compute the maximum spike rate. :return: The maximum number of spikes per simulation timestep. - :rtype: float """ ts_per_second = SpynnakerDataView.get_simulation_time_step_per_s() if float(self.__max_rate) / ts_per_second < SLOW_RATE_PER_TICK_CUTOFF: @@ -518,8 +505,7 @@ def max_spikes_per_ts(self) -> float: def get_recording_sdram_usage(self, vertex_slice: Slice) -> AbstractSDRAM: """ - :param ~pacman.model.graphs.common.Slice vertex_slice: - :rtype: ~pacman.model.resources.AbstractSDRAM + :param vertex_slice: """ variable_sdram = self.__spike_recorder.get_sdram_usage_in_bytes( vertex_slice.n_atoms, self.max_spikes_per_ts()) @@ -529,9 +515,6 @@ def get_recording_sdram_usage(self, vertex_slice: Slice) -> AbstractSDRAM: @overrides(LegacyPartitionerAPI.get_sdram_used_by_atoms) def get_sdram_used_by_atoms(self, vertex_slice: Slice) -> AbstractSDRAM: - """ - :param ~pacman.model.graphs.common.Slice vertex_slice: - """ poisson_params_sz = get_params_bytes(vertex_slice.n_atoms) poisson_rates_sz = get_rates_bytes( vertex_slice.n_atoms, vertex_slice.n_atoms * self.__max_n_rates) @@ -574,8 +557,6 @@ def create_machine_vertex( def max_rate(self) -> float: """ The highest rate or 0 if no rate set. - - :rtype: float """ return float(self.__max_rate) @@ -583,8 +564,6 @@ def max_rate(self) -> float: def max_n_rates(self) -> int: """ the long length of any rates list. - - :rtype: int """ return self.__max_n_rates @@ -592,8 +571,6 @@ def max_n_rates(self) -> int: def seed(self) -> Optional[int]: """ The seed set if any. - - :rtype: int or None """ return self.__seed @@ -611,8 +588,7 @@ def kiss_seed(self, vertex_slice: Slice) -> Tuple[int, ...]: random number generator or seed to a random number generator are suitable for use as a mars 64 kiss seed. - :param Slice vertex_slice: - :type: tuple(int) + :param vertex_slice: """ if vertex_slice not in self.__kiss_seed: self.__kiss_seed[vertex_slice] = create_mars_kiss_seeds(self.__rng) @@ -623,9 +599,8 @@ def update_kiss_seed( """ Updates a KISS seed from the machine. - :param ~pacman.model.graphs.common.Slice vertex_slice: - the vertex slice to update seed of - :param list(int) seed: the seed + :param vertex_slice: the vertex slice to update seed of + :param seed: the seed """ self.__kiss_seed[vertex_slice] = tuple(seed) @@ -652,8 +627,6 @@ def describe( If template is `None`, then a dictionary containing the template context will be returned. - - :rtype: dict(str, ...) """ parameters = self.get_parameter_values(self.__model.default_parameters) @@ -668,7 +641,7 @@ def set_live_poisson_control_edge(self, edge: ApplicationEdge) -> None: """ Sets the poisson generator. - :param ApplicationEdge edge: + :param edge: :raises ValueError: if already set """ if self.__incoming_control_edge is not None: @@ -680,8 +653,6 @@ def set_live_poisson_control_edge(self, edge: ApplicationEdge) -> None: def incoming_control_edge(self) -> Optional[ApplicationEdge]: """ The live poisson control edge/ generator is set - - :rtype: ApplicationEdg or None """ return self.__incoming_control_edge @@ -690,8 +661,6 @@ def data(self) -> RangeDictionary[ Union[NDArray[numpy.floating], NDArray[numpy.integer]]]: """ A dictionary holding all the data as ranges - - :rtype: RangeDictionary """ return self.__data @@ -703,8 +672,7 @@ def read_connections( self, synapse_info: SynapseInformation) -> List[ConnectionsArray]: """ Read Poisson connections from the machine - :param SynapseInformation synapse_info: - The synapse information of the data being read + :param synapse_info: The synapse information of the data being read :return: The set of connections from all machine vertices """ connections = list() diff --git a/spynnaker/pyNN/models/utility_models/delays/delay_extension_machine_vertex.py b/spynnaker/pyNN/models/utility_models/delays/delay_extension_machine_vertex.py index 7b1fd3490f7..3c7a8541921 100644 --- a/spynnaker/pyNN/models/utility_models/delays/delay_extension_machine_vertex.py +++ b/spynnaker/pyNN/models/utility_models/delays/delay_extension_machine_vertex.py @@ -110,11 +110,9 @@ class _ExtraProvenanceDataEntries(IntEnum): def __init__(self, sdram: AbstractSDRAM, label: str, vertex_slice: Slice, app_vertex: Optional[ApplicationVertex] = None): """ - :param ~pacman.model.resources.AbstractSDRAM sdram: - The SDRAM required by the vertex - :param str label: The name of the vertex - :param ~pacman.model.graphs.common.Slice vertex_slice: - The slice of the vertex + :param sdram: The SDRAM required by the vertex + :param label: The name of the vertex + :param vertex_slice: The slice of the vertex :param app_vertex: The application vertex that caused this machine vertex to be created. If `None`, there is no such application vertex. @@ -318,8 +316,8 @@ def generate_data_specification(self, spec: DataSpecificationGenerator, def _write_setup_info( self, spec: DataSpecificationGenerator, binary_name: str) -> None: """ - :param ~data_specification.DataSpecificationGenerator spec: - :param str binary_name: the binary name + :param spec: + :param binary_name: the binary name """ # Write this to the system region (to be picked up by the simulation): spec.switch_write_focus(self._DelayExtensionRegions.SYSTEM) @@ -332,11 +330,11 @@ def write_delay_parameters( """ Generate Delay Parameter data. - :param ~data_specification.DataSpecificationGenerator spec: - :param ~pacman.model.graphs.common.Slice vertex_slice: + :param spec: + :param vertex_slice: :param key: - :param int incoming_key: - :param int incoming_mask: + :param incoming_key: + :param incoming_mask: """ # Write spec with commands to construct required delay region: spec.comment( diff --git a/spynnaker/pyNN/models/utility_models/delays/delay_extension_vertex.py b/spynnaker/pyNN/models/utility_models/delays/delay_extension_vertex.py index e2d0959dd78..041ad7bf963 100644 --- a/spynnaker/pyNN/models/utility_models/delays/delay_extension_vertex.py +++ b/spynnaker/pyNN/models/utility_models/delays/delay_extension_vertex.py @@ -56,12 +56,10 @@ def __init__( label: str = "DelayExtension"): """ :param partition: The partition that this delay is supporting - :type partition: - ~pacman.model.graphs.application.ApplicationEdgePartition - :param int delay_per_stage: the delay per stage - :param int n_delay_stages: the (initial) number of delay stages needed - :param int n_colour_bits: the number of bits for event colouring - :param str label: the vertex label + :param delay_per_stage: the delay per stage + :param n_delay_stages: the (initial) number of delay stages needed + :param n_colour_bits: the number of bits for event colouring + :param label: the vertex label """ super().__init__( label, POP_TABLE_MAX_ROW_LENGTH, splitter=None) @@ -81,8 +79,6 @@ def __init__( def n_atoms(self) -> int: """ The number of atoms in this vertex. - - :rtype: int """ return self.__partition.pre_vertex.n_atoms @@ -110,8 +106,7 @@ def get_max_delay_ticks_supported(delay_ticks_at_post_vertex: int) -> int: """ Get the max ticks the combination of delay and post vertex can handle. - :param int delay_ticks_at_post_vertex: - :rtype: int + :param delay_ticks_at_post_vertex: """ return DelayExtensionVertex.MAX_SLOTS * delay_ticks_at_post_vertex @@ -125,8 +120,8 @@ def set_new_n_delay_stages_and_delay_per_stage( """ Sets the delays per stages. Verifies delay per stage is unchanged. - :param int n_delay_stages: - :param int delay_per_stage: + :param n_delay_stages: + :param delay_per_stage: """ if delay_per_stage != self.__delay_per_stage: raise DelayExtensionException( @@ -149,8 +144,6 @@ def delay_per_stage(self) -> int: def source_vertex(self) -> ApplicationVertex: """ The pre vertex of the delayed partition. - - :rtype: ApplicationVertex """ return self.__partition.pre_vertex @@ -171,7 +164,7 @@ def add_outgoing_edge(self, edge: DelayedApplicationEdge) -> None: """ Add an outgoing edge to the delay extension. - :param DelayedApplicationEdge edge: The edge to add + :param edge: The edge to add """ self.__outgoing_edges.append(edge) diff --git a/spynnaker/pyNN/models/utility_models/spike_injector/spike_injector.py b/spynnaker/pyNN/models/utility_models/spike_injector/spike_injector.py index 6aa9e60e93c..f7c78fc21cf 100644 --- a/spynnaker/pyNN/models/utility_models/spike_injector/spike_injector.py +++ b/spynnaker/pyNN/models/utility_models/spike_injector/spike_injector.py @@ -42,12 +42,10 @@ def create_vertex( splitter: Optional[AbstractSplitterCommon] = None) \ -> SpikeInjectorVertex: """ - :param int port: - :param int virtual_key: - :param bool reserve_reverse_ip_tag: + :param port: + :param virtual_key: + :param reserve_reverse_ip_tag: :param splitter: - :type splitter: - ~pacman.model.partitioner_splitters.AbstractSplitterCommon or None """ max_atoms_per_core = self.get_model_max_atoms_per_dimension_per_core() return SpikeInjectorVertex( diff --git a/spynnaker/pyNN/protocols/munich_io_ethernet_protocol.py b/spynnaker/pyNN/protocols/munich_io_ethernet_protocol.py index c202da237b3..21ee7a61eea 100644 --- a/spynnaker/pyNN/protocols/munich_io_ethernet_protocol.py +++ b/spynnaker/pyNN/protocols/munich_io_ethernet_protocol.py @@ -42,8 +42,6 @@ def __init__(self) -> None: def enable_retina() -> bytes: """ Command to enable the retina. - - :rtype: bytes """ return b"E+\n" @@ -51,8 +49,6 @@ def enable_retina() -> bytes: def disable_retina() -> bytes: """ Command to disable the retina. - - :rtype: bytes """ return b"E-\n" @@ -61,8 +57,7 @@ def set_retina_transmission(event_format: int) -> bytes: """ Command to set the retina transmission. - :param int event_format: - :rtype: bytes + :param event_format: """ return f"!E{event_format}\n".encode("ascii") @@ -70,8 +65,6 @@ def set_retina_transmission(event_format: int) -> bytes: def disable_motor() -> bytes: """ Command to disable the motor. - - :rtype: bytes """ return b"!M-\n" @@ -79,8 +72,6 @@ def disable_motor() -> bytes: def enable_motor() -> bytes: """ Command to enable the motor. - - :rtype: bytes """ return b"!M+\n" @@ -91,8 +82,7 @@ def motor_0_permanent_velocity(velocity: int) -> bytes: The value will be restricted to be between -100 and 100. - :param int velocity: - :rtype: bytes + :param velocity: """ return f"!MV0={_clamp(-100, velocity, 100)}\n".encode("ascii") @@ -103,8 +93,7 @@ def motor_1_permanent_velocity(velocity: int) -> bytes: The value will be restricted to be between -100 and 100. - :param int velocity: - :rtype: bytes + :param velocity: """ return f"!MV1={_clamp(-100, velocity, 100)}\n".encode("ascii") @@ -115,8 +104,7 @@ def motor_0_leaky_velocity(velocity: int) -> bytes: The value will be restricted to be between -100 and 100. - :param int velocity: - :rtype: bytes + :param velocity: """ return f"!MVD0={_clamp(-100, velocity, 100)}\n".encode("ascii") @@ -127,8 +115,7 @@ def motor_1_leaky_velocity(velocity: int) -> bytes: The value will be restricted to be between -100 and 100. - :param int velocity: - :rtype: bytes + :param velocity: """ return f"!MVD1={_clamp(-100, velocity, 100)}\n".encode("ascii") @@ -137,8 +124,7 @@ def led_total_period(total_period: int) -> bytes: """ Command to set the led total time - :param int total_period: - :rtype: bytes + :param total_period: """ return f"!PC={total_period}\n".encode("ascii") @@ -147,8 +133,7 @@ def led_front_active_time(active_time: int) -> bytes: """ Command to set the led front time - :param int active_time: - :rtype: bytes + :param active_time: """ return f"!PC1={active_time}\n".encode("ascii") @@ -157,8 +142,7 @@ def led_back_active_time(active_time: int) -> bytes: """ Command to set the led back time - :param int active_time: - :rtype: bytes + :param active_time: """ return f"!PC0={active_time}\n".encode("ascii") @@ -167,8 +151,7 @@ def led_frequency(frequency: Union[int, float]) -> bytes: """ Command to set the led times based on frequency - :param float frequency: - :rtype: bytes + :param frequency: """ active_time = _active_time_for_frequency(frequency) at2 = active_time // 2 @@ -179,8 +162,7 @@ def speaker_frequency(frequency: Union[int, float]) -> bytes: """ Command to set the speaker times based on frequency. - :param float frequency: - :rtype: bytes + :param frequency: """ active_time = _active_time_for_frequency(frequency) return f"!PB={active_time}\n!PB0={active_time // 2}\n".encode("ascii") @@ -190,8 +172,7 @@ def speaker_total_period(total_period: int) -> bytes: """ Command to set the speaker total time. - :param int total_period: - :rtype: bytes + :param total_period: """ return f"!PB={total_period}\n".encode("ascii") @@ -200,8 +181,7 @@ def speaker_active_time(active_time: int) -> bytes: """ Command to set the speaker active time. - :param int active_time: - :rtype: bytes + :param active_time: """ return f"!PB0={active_time}\n".encode("ascii") @@ -210,8 +190,7 @@ def laser_frequency(frequency: Union[int, float]) -> bytes: """ Command to set the laser periods based on the frequency. - :param float frequency: - :rtype: bytes + :param frequency: """ active_time = _active_time_for_frequency(frequency) return f"!PA={active_time}\n!PA0={active_time // 2}\n".encode("ascii") @@ -221,8 +200,7 @@ def laser_total_period(total_period: int) -> bytes: """ Command to set the laser total period - :param int total_period: - :rtype: bytes + :param total_period: """ return f"!PA={total_period}\n".encode("ascii") @@ -231,7 +209,6 @@ def laser_active_time(active_time: int) -> bytes: """ Command to set the laser active time - :param int active_time: - :rtype: bytes + :param active_time: """ return f"!PA0={active_time}\n".encode("ascii") diff --git a/spynnaker/pyNN/protocols/munich_io_spinnaker_link_protocol.py b/spynnaker/pyNN/protocols/munich_io_spinnaker_link_protocol.py index 536821cdb0d..bcf05366b63 100644 --- a/spynnaker/pyNN/protocols/munich_io_spinnaker_link_protocol.py +++ b/spynnaker/pyNN/protocols/munich_io_spinnaker_link_protocol.py @@ -49,8 +49,7 @@ def get_munich_i(key: int) -> int: """ Get the instruction field from the key. - :param int key: - :rtype: int + :param key: """ return key & _I_MASK @@ -73,8 +72,7 @@ def get_retina_i(key: int) -> int: """ Get the key with the UART mask. - :param int key: - :rtype: int + :param key: """ return key & RETINA_WITHOUT_UART_MASK @@ -83,8 +81,7 @@ def get_push_bot_laser_led_speaker_frequency_i(key: int) -> int: """ Get the instruction field from the key with the I mask. - :param int key: - :rtype: int + :param key: """ return get_munich_i(key) @@ -92,9 +89,6 @@ def get_push_bot_laser_led_speaker_frequency_i(key: int) -> int: def get_push_bot_motor_i(key: int) -> int: """ Gets the key without the universal asynchronous receiver/transmitter mask. - - :param int payload: - :rtype: int """ return key & PUSH_BOT_MOTOR_WITHOUT_UART_MASK @@ -118,8 +112,7 @@ def GET_RETINA_KEY_VALUE(payload: int) -> int: """ Gets the payload with the retina key mask and offset. - :param int payload: - :rtype: int + :param payload: """ return (payload & _PAYLOAD_RETINA_KEY_MASK) >> _PAYLOAD_RETINA_KEY_OFFSET @@ -129,8 +122,7 @@ def GET_RETINA_PAYLOAD_VALUE(payload: int) -> int: """ Gets the payload with the retina payload mask and offset. - :param int payload: - :rtype: int + :param payload: """ return ( (payload & _PAYLOAD_RETINA_PAYLOAD_MASK) >> @@ -287,8 +279,6 @@ def __init__(self, ident: int, pixels: int, bits_per_coordinate: int): def ident(self) -> int: """ Gets the identification passed into the init. - - :rtype: int """ return self.__ident @@ -296,8 +286,6 @@ def ident(self) -> int: def n_neurons(self) -> int: """ Gets the number or neurons passed into the init. - - :rtype: int """ return 2 * (self.__pixels ** 2) @@ -305,8 +293,6 @@ def n_neurons(self) -> int: def pixels(self) -> int: """ Get the pixels passed into the init. - - :rtype: int """ return self.__pixels @@ -314,8 +300,6 @@ def pixels(self) -> int: def bits_per_coordinate(self) -> int: """ Gets the bits per coordinate passed into the init. - - :rtype: int """ return self.__bits_per_coordinate @@ -339,8 +323,6 @@ def __init__(self, ident: int, n_payload_bytes: int): def ident(self) -> int: """ Gets the indent passed into the init. - - :rtype: int """ return self.__ident @@ -348,8 +330,6 @@ def ident(self) -> int: def n_payload_bytes(self) -> int: """ Gets the n_payload_bytes passed into the init. - - :rtype: int """ return self.__n_payload_bytes @@ -387,11 +367,9 @@ class MunichIoSpiNNakerLinkProtocol(object): def __init__(self, mode: MUNICH_MODES, instance_key: Optional[int] = None, uart_id: int = 0): """ - :param ~spynnaker.pyNN.protocols.MUNICH_MODES mode: - The mode of operation of the protocol + :param mode: The mode of operation of the protocol :param instance_key: The optional instance key to use - :type instance_key: int or None - :param int uart_id: The ID of the UART when needed + :param uart_id: The ID of the UART when needed """ self.__mode = mode @@ -410,23 +388,21 @@ def __init__(self, mode: MUNICH_MODES, instance_key: Optional[int] = None, @property def mode(self) -> MUNICH_MODES: """ - :rtype: ~spynnaker.pyNN.protocols.MUNICH_MODES + spynnaker.pyNN.protocols.MUNICH_MODES """ return self.__mode @property def uart_id(self) -> int: """ - :rtype: int + The ID of the UART when needed """ return self.__uart_id @property def instance_key(self) -> int: """ - The key of this instance of the protocol. - - :rtype: int + The instance key to use """ return self.__instance_key @@ -450,11 +426,9 @@ def configure_master_key(self, new_key: int, """ Get command to configure master key. - :param int new_key: + :param new_key: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(CONFIGURE_MASTER_KEY), payload=new_key, time=time) @@ -465,8 +439,6 @@ def set_mode(self, time: Optional[int] = None) -> MultiCastCommand: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ MunichIoSpiNNakerLinkProtocol.__sent_mode_command = True return MultiCastCommand( @@ -476,8 +448,6 @@ def set_mode(self, time: Optional[int] = None) -> MultiCastCommand: def set_retina_key_key(self) -> int: """ Get key to set retina key. - - :rtype: int """ return self._get_key( ACTIVE_RETINA_EVENT_STREAMING_SET_KEY, RETINA_UART_SHIFT) @@ -487,11 +457,9 @@ def set_retina_key(self, new_key: int, """ Get command to set retina key. - :param int new_key: + :param new_key: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self.set_retina_key_key, payload=new_key, time=time) @@ -500,8 +468,6 @@ def set_retina_key(self, new_key: int, def disable_retina_key(self) -> int: """ Get key to disable the retina. - - :rtype: int """ return self._get_key(DISABLE_RETINA_EVENT_STREAMING, RETINA_UART_SHIFT) @@ -511,8 +477,6 @@ def disable_retina(self, time: Optional[int] = None) -> MultiCastCommand: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand(self.disable_retina_key, time=time) @@ -523,8 +487,6 @@ def master_slave_use_internal_counter( :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(MASTER_SLAVE_KEY, RETINA_UART_SHIFT), @@ -537,8 +499,6 @@ def master_slave_set_slave( :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(MASTER_SLAVE_KEY, RETINA_UART_SHIFT), @@ -551,8 +511,6 @@ def master_slave_set_master_clock_not_started( :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(MASTER_SLAVE_KEY, RETINA_UART_SHIFT), @@ -566,8 +524,6 @@ def master_slave_set_master_clock_active( :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(MASTER_SLAVE_KEY, RETINA_UART_SHIFT), @@ -579,12 +535,10 @@ def bias_values(self, bias_id: int, bias_value: int, """ Get command to bias level. - :param int bias_id: - :param int bias_value: + :param bias_id: + :param bias_value: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(BIAS_KEY, RETINA_UART_SHIFT), @@ -596,8 +550,6 @@ def reset_retina(self, time: Optional[int] = None) -> MultiCastCommand: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(RESET_RETINA_KEY, RETINA_UART_SHIFT), time=time) @@ -608,11 +560,9 @@ def turn_off_sensor_reporting( """ Get command to turn off sensor reporting. - :param int sensor_id: + :param sensor_id: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(SENSOR_REPORTING_OFF_KEY), @@ -623,11 +573,9 @@ def poll_sensors_once(self, sensor_id: int, """ Get command to sensor once. - :param int sensor_id: + :param sensor_id: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(POLL_SENSORS_ONCE_KEY), @@ -639,11 +587,9 @@ def poll_individual_sensor_continuously( """ Get command to sensor continuously. - :param int sensor_id: + :param sensor_id: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(POLL_SENSORS_CONTINUOUSLY_KEY), @@ -655,11 +601,6 @@ def poll_individual_sensor_continuously( def enable_disable_motor_key(self) -> int: """ Get key to disable motor. - - :param time: The time within the simulation at which to send the - command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return self._get_key(ENABLE_DISABLE_MOTOR_KEY, RETINA_UART_SHIFT) @@ -670,8 +611,6 @@ def generic_motor_enable( :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self.enable_disable_motor_key, payload=1, time=time) @@ -683,8 +622,6 @@ def generic_motor_disable( :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self.enable_disable_motor_key, payload=0, time=time) @@ -695,11 +632,9 @@ def generic_motor_total_period( """ Get command to set motor total period. - :param int time_in_ms: + :param time_in_ms: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(MOTOR_RUN_FOR_PERIOD_KEY, RETINA_UART_SHIFT), @@ -711,11 +646,9 @@ def generic_motor0_raw_output_permanent( """ Get command to set generic motor 0 raw output permanently. - :param int pwm_signal: + :param pwm_signal: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(MOTOR_0_RAW_PERM_KEY, RETINA_UART_SHIFT), @@ -727,11 +660,9 @@ def generic_motor1_raw_output_permanent( """ Get command to set generic motor 1 raw output permanently. - :param int pwm_signal: + :param pwm_signal: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(MOTOR_1_RAW_PERM_KEY, RETINA_UART_SHIFT), @@ -743,11 +674,9 @@ def generic_motor0_raw_output_leak_to_0( """ Get command to set generic motor 0 raw output leak to 0. - :param int pwm_signal: + :param pwm_signal: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(MOTOR_0_RAW_LEAK_KEY, RETINA_UART_SHIFT), @@ -759,11 +688,9 @@ def generic_motor1_raw_output_leak_to_0( """ Get command to set generic motor 1 raw output leak to 0. - :param int pwm_signal: + :param pwm_signal: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(MOTOR_1_RAW_LEAK_KEY, RETINA_UART_SHIFT), @@ -775,11 +702,9 @@ def pwm_pin_output_timer_a_duration( """ Get command to set a output timer duration. - :param int timer_period: + :param timer_period: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(MOTOR_TIMER_A_TOTAL_PERIOD_KEY, RETINA_UART_SHIFT), @@ -791,11 +716,9 @@ def pwm_pin_output_timer_b_duration( """ Get command to set b output timer duration. - :param int timer_period: + :param timer_period: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(MOTOR_TIMER_B_TOTAL_PERIOD_KEY, RETINA_UART_SHIFT), @@ -807,11 +730,9 @@ def pwm_pin_output_timer_c_duration( """ Get command to set c output timer duration. - :param int timer_period: + :param timer_period: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(MOTOR_TIMER_C_TOTAL_PERIOD_KEY, RETINA_UART_SHIFT), @@ -823,11 +744,9 @@ def pwm_pin_output_timer_a_channel_0_ratio( """ Get command to set a channel 0 output timer. - :param int timer_period: + :param timer_period: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key( @@ -840,11 +759,9 @@ def pwm_pin_output_timer_a_channel_1_ratio( """ Get command to set a channel 1 output timer. - :param int timer_period: + :param timer_period: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key( @@ -857,11 +774,9 @@ def pwm_pin_output_timer_b_channel_0_ratio( """ Get command to set b channel 0 output timer. - :param int timer_period: + :param timer_period: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key( @@ -874,11 +789,9 @@ def pwm_pin_output_timer_b_channel_1_ratio( """ Get command to set b channel 1 output timer. - :param int timer_period: + :param timer_period: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key( @@ -891,11 +804,9 @@ def pwm_pin_output_timer_c_channel_0_ratio( """ Get command to set c channel 0 output timer. - :param int timer_period: + :param timer_period: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key( @@ -908,11 +819,9 @@ def pwm_pin_output_timer_c_channel_1_ratio( """ Get command to set c channel 1 output timer. - :param int timer_period: + :param timer_period: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key( @@ -926,8 +835,6 @@ def query_state_of_io_lines( :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(QUERY_STATES_LINES_KEY), time=time) @@ -938,11 +845,9 @@ def set_output_pattern_for_payload( """ Get command to set output pattern for payload. - :param int payload: + :param payload: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(SET_OUTPUT_PATTERN_KEY), payload=payload, time=time) @@ -953,11 +858,9 @@ def add_payload_logic_to_current_output( """ Get command to add payload logic to current output. - :param int payload: + :param payload: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(ADD_PAYLOAD_TO_CURRENT_OUTPUT_KEY), @@ -969,11 +872,9 @@ def remove_payload_logic_to_current_output( """ Get command to remove payload logic to current output. - :param int payload: + :param payload: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(REMOVE_PAYLOAD_TO_CURRENT_OUTPUT_KEY), @@ -985,11 +886,9 @@ def set_payload_pins_to_high_impedance( """ Get command to set the payload pins to high impedance. - :param int payload: + :param payload: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand """ return MultiCastCommand( self._get_key(SET_PAYLOAD_TO_HIGH_IMPEDANCE_KEY), @@ -1005,8 +904,6 @@ def _check_for_pushbot_mode(self) -> None: def push_bot_laser_config_total_period_key(self) -> int: """ Gets the key to set the laser total period. - - :rtype: int """ return self._get_key( PUSH_BOT_LASER_CONFIG_TOTAL_PERIOD, RETINA_UART_SHIFT) @@ -1017,11 +914,9 @@ def push_bot_laser_config_total_period( """ Get command to set the laser total period. - :param int total period: + :param total_period: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand :raises ConfigurationException: If the mode is not PUSH_BOT """ self._check_for_pushbot_mode() @@ -1033,8 +928,6 @@ def push_bot_laser_config_total_period( def push_bot_laser_config_active_time_key(self) -> int: """ Gets the key to set the laser active time. - - :rtype: int """ return self._get_key( PUSH_BOT_LASER_CONFIG_ACTIVE_TIME, RETINA_UART_SHIFT) @@ -1045,11 +938,8 @@ def push_bot_laser_config_active_time( """ Get command to set the laser active time. - :param int frequency: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand :raises ConfigurationException: If the mode is not PUSH_BOT """ self._check_for_pushbot_mode() @@ -1061,8 +951,6 @@ def push_bot_laser_config_active_time( def push_bot_laser_set_frequency_key(self) -> int: """ Gets the key to set the frequency. - - :rtype: int """ return self._get_key( PUSH_BOT_LASER_FREQUENCY, @@ -1074,11 +962,9 @@ def push_bot_laser_set_frequency( """ Get command to set the frequency - :param int frequency: + :param frequency: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand :raises ConfigurationException: If the mode is not PUSH_BOT """ self._check_for_pushbot_mode() @@ -1090,8 +976,6 @@ def push_bot_laser_set_frequency( def push_bot_speaker_config_total_period_key(self) -> int: """ Gets the key to set the speaker total period. - - :rtype: int """ return self._get_key( PUSH_BOT_SPEAKER_CONFIG_TOTAL_PERIOD, RETINA_UART_SHIFT) @@ -1102,11 +986,9 @@ def push_bot_speaker_config_total_period( """ Get command to set the speaker total period. - :param int total_period: + :param total_period: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand :raises ConfigurationException: If the mode is not PUSH_BOT """ self._check_for_pushbot_mode() @@ -1118,8 +1000,6 @@ def push_bot_speaker_config_total_period( def push_bot_speaker_config_active_time_key(self) -> int: """ Gets the key to set the speaker active time. - - :rtype: int """ return self._get_key( PUSH_BOT_SPEAKER_CONFIG_ACTIVE_TIME, RETINA_UART_SHIFT) @@ -1130,11 +1010,9 @@ def push_bot_speaker_config_active_time( """ Get command to set the speaker active time. - :param int active_time: + :param active_time: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand :raises ConfigurationException: If the mode is not PUSH_BOT """ self._check_for_pushbot_mode() @@ -1146,8 +1024,6 @@ def push_bot_speaker_config_active_time( def push_bot_speaker_set_tone_key(self) -> int: """ Gets the key to set the tone. - - :rtype: int """ return self._get_key( PUSH_BOT_SPEAKER_TONE_BEEP, @@ -1159,11 +1035,9 @@ def push_bot_speaker_set_tone( """ Get command to set the tone. - :param int frequency: + :param frequency: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand :raises ConfigurationException: If the mode is not PUSH_BOT """ self._check_for_pushbot_mode() @@ -1175,8 +1049,6 @@ def push_bot_speaker_set_tone( def push_bot_speaker_set_melody_key(self) -> int: """ Gets the key to set the melody. - - :rtype: int """ return self._get_key( PUSH_BOT_SPEAKER_TONE_MELODY, @@ -1188,11 +1060,9 @@ def push_bot_speaker_set_melody( """ Get command to set the melody. - :param int melody: + :param melody: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand :raises ConfigurationException: If the mode is not PUSH_BOT """ self._check_for_pushbot_mode() @@ -1204,8 +1074,6 @@ def push_bot_speaker_set_melody( def push_bot_led_total_period_key(self) -> int: """ Gets the key to set the total led period. - - :rtype: int """ return self._get_key( PUSH_BOT_LED_CONFIG_TOTAL_PERIOD, RETINA_UART_SHIFT) @@ -1216,11 +1084,8 @@ def push_bot_led_total_period( """ Get command to set the total led period. - :param int active_time: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand :raises ConfigurationException: If the mode is not PUSH_BOT """ self._check_for_pushbot_mode() @@ -1232,8 +1097,6 @@ def push_bot_led_total_period( def push_bot_led_back_active_time_key(self) -> int: """ Gets the key to set the back led active time. - - :rtype: int """ return self._get_key( PUSH_BOT_LED_BACK_CONFIG_ACTIVE_TIME, RETINA_UART_SHIFT) @@ -1244,11 +1107,9 @@ def push_bot_led_back_active_time( """ Get command to set the back led active time. - :param int active_time: + :param active_time: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand :raises ConfigurationException: If the mode is not PUSH_BOT """ self._check_for_pushbot_mode() @@ -1260,8 +1121,6 @@ def push_bot_led_back_active_time( def push_bot_led_front_active_time_key(self) -> int: """ Gets the key to set the front led active time. - - :rtype: int """ return self._get_key( PUSH_BOT_LED_FRONT_CONFIG_ACTIVE_TIME, RETINA_UART_SHIFT) @@ -1272,11 +1131,9 @@ def push_bot_led_front_active_time( """ Get command to set the front led active time. - :param int active_time: + :param active_time: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand :raises ConfigurationException: If the mode is not PUSH_BOT """ self._check_for_pushbot_mode() @@ -1288,8 +1145,6 @@ def push_bot_led_front_active_time( def push_bot_led_set_frequency_key(self) -> int: """ Gets the key to set the led frequency. - - :rtype: int """ return self._get_key( PUSH_BOT_LED_FREQUENCY, @@ -1301,11 +1156,9 @@ def push_bot_led_set_frequency( """ Get command to set the led frequency - :param int frequency: + :param frequency: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand :raises ConfigurationException: If the mode is not PUSH_BOT """ self._check_for_pushbot_mode() @@ -1317,8 +1170,6 @@ def push_bot_led_set_frequency( def push_bot_motor_0_permanent_key(self) -> int: """ Gets the key for the change motor 0 permanently. - - :rtype: int """ return self._get_key( PUSH_BOT_MOTOR_0_PERMANENT_VELOCITY, PUSH_BOT_MOTOR_UART_SHIFT) @@ -1329,11 +1180,9 @@ def push_bot_motor_0_permanent( """ Get command to change motor 0 permanently. - :param int velocity: + :param velocity: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand :raises ConfigurationException: If the mode is not PUSH_BOT """ self._check_for_pushbot_mode() @@ -1345,8 +1194,6 @@ def push_bot_motor_0_permanent( def push_bot_motor_1_permanent_key(self) -> int: """ Gets the key for the change motor 1 permanently. - - :rtype: int """ return self._get_key( PUSH_BOT_MOTOR_1_PERMANENT_VELOCITY, PUSH_BOT_MOTOR_UART_SHIFT) @@ -1357,11 +1204,9 @@ def push_bot_motor_1_permanent( """ Get command to change motor 1 permanently. - :param int velocity: + :param velocity: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand :raises ConfigurationException: If the mode is not PUSH_BOT """ self._check_for_pushbot_mode() @@ -1373,8 +1218,6 @@ def push_bot_motor_1_permanent( def push_bot_motor_0_leaking_towards_zero_key(self) -> int: """ Gets the key for the change motor 0 towards zero. - - :rtype: int """ return self._get_key( PUSH_BOT_MOTOR_0_LEAKY_VELOCITY, PUSH_BOT_MOTOR_UART_SHIFT) @@ -1385,11 +1228,9 @@ def push_bot_motor_0_leaking_towards_zero( """ Get command to change motor 0 towards zero. - :param int velocity: + :param velocity: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand :raises ConfigurationException: If the mode is not PUSH_BOT """ self._check_for_pushbot_mode() @@ -1401,8 +1242,6 @@ def push_bot_motor_0_leaking_towards_zero( def push_bot_motor_1_leaking_towards_zero_key(self) -> int: """ Gets the key for the change motor 1 towards zero. - - :rtype: int """ return self._get_key( PUSH_BOT_MOTOR_1_LEAKY_VELOCITY, PUSH_BOT_MOTOR_UART_SHIFT) @@ -1413,11 +1252,9 @@ def push_bot_motor_1_leaking_towards_zero( """ Get command to change motor 1 towards zero. - :param int velocity: + :param velocity: :param time: The time within the simulation at which to send the command, or ``None`` if this is not a timed command - :type time: int or None - :rtype: MultiCastCommand :raises ConfigurationException: If the mode is not PUSH_BOT """ self._check_for_pushbot_mode() @@ -1429,8 +1266,7 @@ def sensor_transmission_key(self, sensor_id: int) -> int: """ Get the transmission key to this sensor id. - :param int sensor_id: - :rtype: int + :param sensor_id: """ return ((sensor_id << _SENSOR_OUTGOING_OFFSET_TO_D) | (self.__uart_id << _SENSOR_OUTGOING_OFFSET_TO_I)) @@ -1439,8 +1275,6 @@ def sensor_transmission_key(self, sensor_id: int) -> int: def set_retina_transmission_key(self) -> int: """ Get the key to set the retina_transmission. - - :rtype: int """ return self._get_key( ACTIVE_RETINA_EVENT_STREAMING_KEYS_CONFIGURATION, @@ -1456,11 +1290,8 @@ def set_retina_transmission( :param retina_key: the new key for the retina :param retina_payload: the new payload for the set retina key command packet - :type retina_payload: RetinaPayload or None :param time: when to transmit this packet - :type time: int or float or None :return: the command to send - :rtype: ~spinn_front_end_common.utility_models.MultiCastCommand """ retina_key_id = retina_key.ident if retina_key is not None else 0 diff --git a/spynnaker/pyNN/utilities/bit_field_utilities.py b/spynnaker/pyNN/utilities/bit_field_utilities.py index a847f12a870..42d36f703db 100644 --- a/spynnaker/pyNN/utilities/bit_field_utilities.py +++ b/spynnaker/pyNN/utilities/bit_field_utilities.py @@ -64,9 +64,7 @@ def _unique_edges(projections: Iterable[Projection]) -> Iterable[ """ Get the unique application edges of a collection of projections. - :param iterable(~spynnaker.pyNN.models.projection.Projection) projections: - The projections to examine. - :rtype: iterable(tuple(ProjectionApplicationEdge, str)) + :param projections: The projections to examine. """ seen_edges = set() for proj in projections: @@ -87,10 +85,7 @@ def get_sdram_for_bit_field_region( :param incoming_projections: The projections that target the vertex in question - :type incoming_projections: - iterable(~spynnaker.pyNN.models.projection.Projection) :return: the estimated number of bytes used by the bit field region - :rtype: int """ sdram = FILTER_HEADER_WORDS * BYTES_PER_WORD for in_edge, _part_id in _unique_edges(incoming_projections): @@ -110,10 +105,7 @@ def get_sdram_for_keys(incoming_projections: Iterable[Projection]) -> int: :param incoming_projections: The projections that target the vertex in question - :type incoming_projections: - iterable(~spynnaker.pyNN.models.projection.Projection) :return: SDRAM needed - :rtype: int """ # basic sdram sdram = 0 @@ -131,9 +123,6 @@ def get_bitfield_key_map_data( :param incoming_projections: The projections to generate bitfields for - :type incoming_projections: - iterable(~spynnaker.pyNN.models.projection.Projection) - :rtype: ~numpy.ndarray """ # Gather the source vertices that target this core routing_infos = SpynnakerDataView.get_routing_infos() @@ -167,11 +156,10 @@ def write_bitfield_init_data( """ Writes the initialisation data needed for the bitfield generator. - :param ~data_specification.DataSpecificationGenerator spec: - data specification writer - :param int bit_field_region: the region ID for the bit-field filters - :param int n_bit_field_bytes: the size of the region - :param int bit_field_region_ref: The reference to the region + :param spec: data specification writer + :param bit_field_region: the region ID for the bit-field filters + :param n_bit_field_bytes: the size of the region + :param bit_field_region_ref: The reference to the region """ # reserve the final destination for the bitfields spec.reserve_memory_region( diff --git a/spynnaker/pyNN/utilities/data_population.py b/spynnaker/pyNN/utilities/data_population.py index 5a377ae7c8e..fe1f86721f2 100644 --- a/spynnaker/pyNN/utilities/data_population.py +++ b/spynnaker/pyNN/utilities/data_population.py @@ -204,7 +204,7 @@ def index_to_id(self, index: Union[int, Iterable[int]] def __getitem__(self, index_or_slice: Selector) -> DataPopulation: """ - :param selector: a slice or numpy mask array. + :param index_or_slice: a slice or numpy mask array. The mask array should either be a Boolean array (ideally) of the same size as the parent, or an integer array containing cell indices, @@ -217,8 +217,6 @@ def __getitem__(self, index_or_slice: Selector) -> DataPopulation: PopulationView(p, slice(2, 5, 2)) will all create the same view. - :type selector: None or slice or int or list(bool) or list(int) or - ~numpy.ndarray(bool) or ~numpy.ndarray(int) :param index_or_slice: :return: """ diff --git a/spynnaker/pyNN/utilities/neo_buffer_database.py b/spynnaker/pyNN/utilities/neo_buffer_database.py index 63e08ca25fa..fd30f0b0e6d 100644 --- a/spynnaker/pyNN/utilities/neo_buffer_database.py +++ b/spynnaker/pyNN/utilities/neo_buffer_database.py @@ -100,8 +100,7 @@ def __init__(self, database_file: Optional[str] = None, The name of a file that contains (or will contain) an SQLite database holding the data. If omitted the default location will be used. - :type database_file: None or str - :param bool read_only: + :param read_only: By default the database is read-only if given a database file. This allows to override that (mainly for clear) """ @@ -179,7 +178,6 @@ def __get_segment_info(self) -> Tuple[int, datetime, float, float, str]: :return: segment number, record time, last run time recorded, simulator timestep in ms, simulator name - :rtype: tuple(int, ~datetime.datetime, float, float, str) :raises \ ~spinn_front_end_common.utilities.exceptions.ConfigurationException: If the recording metadata not setup correctly @@ -209,7 +207,6 @@ def __get_simulation_time_step_ms(self) -> float: The value that would be/have been returned by SpynnakerDataView.get_simulation_time_step_ms() - :rtype: float :return: The timestep """ for row in self.cursor().execute( @@ -230,15 +227,14 @@ def __get_population_id( For speed does not verify the additional fields if a record already exists. - :param str pop_label: The label for the population of interest + :param pop_label: 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 - :param ~spynnaker.pyNN.models.populations.Population population: - the population to record for + :param population: the population to record for :return: The ID """ for row in self.cursor().execute( @@ -271,24 +267,21 @@ def __get_recording_id( For speed does not verify the additional fields if a record already exists. - :param str pop_label: The label for the population of interest + :param pop_label: 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 - :param str variable: - :param ~spynnaker.pyNN.models.populations.Population population: - the population to record for - :param sampling_interval: + :param variable: + :param population: the population to record for + :param sampling_interval_ms: The simulation time in milliseconds between sampling. Typically the sampling rate * simulation_timestep_ms - :type sampling_interval_ms: float or None - :type data_type: DataType or None - :param BufferDataType buffered_type: - :param str units: - :param int n_colour_bits: + :param buffered_type: + :param units: + :param n_colour_bits: :return: The ID """ for row in self.cursor().execute( @@ -319,7 +312,7 @@ def has_population_metadata(self, pop_label: str) -> bool: """ Check if there is Metadata for the population with this label - :param str pop_label: The label for the population of interest + :param pop_label: The label for the population of interest .. note:: This is actually the label of the Application Vertex. @@ -340,7 +333,7 @@ def get_population_metadata(self, pop_label: str) -> Tuple[int, int, str]: """ Gets the metadata for the population with this label - :param str pop_label: The label for the population of interest + :param pop_label: The label for the population of interest .. note:: This is actually the label of the Application Vertex. @@ -348,7 +341,6 @@ def get_population_metadata(self, pop_label: str) -> Tuple[int, int, str]: duplicate values :return: population size, first ID and description - :rtype: (int, int, str) :raises \ ~spinn_front_end_common.utilities.exceptions.ConfigurationException: If the recording metadata not setup correctly @@ -375,7 +367,6 @@ def get_recording_populations(self) -> Tuple[str, ...]: duplicate values :return: List of population labels - :rtype: list(str) """ results = [] for row in self.cursor().execute( @@ -397,7 +388,7 @@ def get_population(self, pop_label: str) -> DataPopulation: As each database only includes data for one run (with resets creating another database) the structure is relatively simple. - :param str pop_label: The label for the population of interest + :param pop_label: The label for the population of interest .. note:: This is actually the label of the Application Vertex. @@ -405,7 +396,6 @@ def get_population(self, pop_label: str) -> DataPopulation: duplicate values :return: An Object which acts like a Population for getting neo data - :rtype: DataPopulation """ # delayed import due to circular dependencies # pylint: disable=import-outside-toplevel @@ -419,7 +409,7 @@ def get_recording_variables(self, pop_label: str) -> Tuple[str, ...]: Or, to be exact, list of the names of variables with metadata so likely to be recording. - :param str pop_label: The label for the population of interest + :param pop_label: The label for the population of interest .. note:: This is actually the label of the Application Vertex. @@ -444,16 +434,15 @@ def find_units(self, pop_label: str, variable: str) -> Optional[str]: Gets the metadata ID for this population and recording label combination. - :param str pop_label: The label for the population of interest + :param pop_label: 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 - :param str variable: + :param variable: :return: data_type, sampling_interval_ms, units - :rtype: Optional[str] :raises \ ~spinn_front_end_common.utilities.exceptions.ConfigurationException: If the recording metadata not setup correctly @@ -473,19 +462,17 @@ def __get_recording_metadata( Gets the metadata id for this population and recording label combination. - :param str pop_label: The label for the population of interest + :param pop_label: 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 - :param str variable: + :param variable: :return: id, data_type, buffered_type, t_start, sampling_interval_ms, pop_size, units, n_colour_bits - :rtype: - tuple(int, DataType, BufferedDataType, float, float, int, str, int) :raises \ ~spinn_front_end_common.utilities.exceptions.ConfigurationException: If the recording metadata not setup correctly @@ -515,11 +502,10 @@ def __get_recording_metadata( def __get_region_metadata(self, rec_id: int) -> Iterable[Tuple[ int, Optional[NDArray[integer]], Slice, Optional[bool], int, int]]: """ - :param int rec_id: + :param rec_id: :return: region_id, neurons, vertex_slice, selective_recording, base_key, index - :rtype: iterable(tuple(int, ~numpy.ndarray, Slice, bool, int, int)) """ index = 0 # Need to put the rows in a list to get them to persist. @@ -552,12 +538,12 @@ def __get_spikes_by_region( """ Adds spike data for this region to the lists. - :param int region_id: Region data came from - :param array(int) neurons: mapping of local ID to global ID - :param float simulation_time_step_ms: - :param bool selective_recording: flag to say if - :param list(float) spike_times: List to add spike times to - :param list(int) spike_ids: List to add spike IDs to + :param region_id: Region data came from + :param neurons: mapping of local ID to global ID + :param simulation_time_step_ms: + :param selective_recording: flag to say if + :param spike_times: List to add spike times to + :param spike_ids: List to add spike IDs to """ neurons_recording = len(neurons) if neurons_recording == 0: @@ -596,9 +582,8 @@ def __get_neuron_spikes(self, rec_id: int) -> Tuple[ """ Gets the spikes for this population/recording ID. - :param int rec_id: + :param rec_id: :return: numpy array of spike IDs and spike times, all IDs recording - :rtype: tuple(~numpy.ndarray, list(int)) """ spike_times: List[float] = [] spike_ids: List[int] = [] @@ -624,14 +609,13 @@ def __get_eieio_spike_by_region( """ Adds spike data for this region to the list. - :param int region_id: Region data came from - :param float simulation_time_step_ms: - :param int base_key: - :param ~pacman.model.graphs.common.Slice vertex_slice: - :param int n_colour_bits: + :param region_id: Region data came from + :param simulation_time_step_ms: + :param base_key: + :param vertex_slice: + :param n_colour_bits: :param results: Where to add spike data to :return: all recording indexes spikes or not - :rtype: list(int) """ spike_data = self._read_recording(region_id) @@ -673,10 +657,7 @@ def __get_eieio_spikes( """ Gets the spikes for this population/recording ID. - :param int rec_id: - :param int n_colour_bits: :return: numpy array of spike IDs and spike times, all IDs recording - :rtype: tuple(~numpy.ndarray, list(int)) """ simulation_time_step_ms = self.__get_simulation_time_step_ms() results: List[NDArray] = [] @@ -704,11 +685,11 @@ def __get_multi_spikes_by_region( """ Adds spike data for this region to the lists. - :param int region_id: Region data came from - :param ~numpy.ndarray neurons: - :param float simulation_time_step_ms: - :param list(float) spike_times: List to add spike times to - :param list(int) spike_ids: List to add spike IDs to + :param region_id: Region data came from + :param neurons: + :param simulation_time_step_ms: + :param spike_times: List to add spike times to + :param spike_ids: List to add spike IDs to """ raw_data = self._read_recording(region_id) @@ -739,9 +720,8 @@ def __get_multi_spikes(self, rec_id: int) -> Tuple[ """ Gets the spikes for this population/recording ID. - :param int rec_id: + :param rec_id: :return: numpy array of spike IDs and spike times, all IDs recording - :rtype: tuple(~numpy.ndarray, list(int)) """ spike_times_l: List[NDArray[floating]] = [] spike_ids_l: List[NDArray[integer]] = [] @@ -774,9 +754,8 @@ def __combine_indexes( """ :param view_indexes: :param data_indexes: - :param str variable: + :param variable: :return: indices - :rtype: list """ # keep just the view indexes in the data data_set = set(data_indexes) @@ -796,15 +775,14 @@ def __get_spikes( """ Gets the data as a Numpy array for one population and variable. - :param int rec_id: - :param list(int) view_indexes: + :param rec_id: + :param view_indexes: :param buffer_type: - :param int n_colour_bits: - :param str variable: + :param n_colour_bits: + :param variable: :raises \ ~spinn_front_end_common.utilities.exceptions.ConfigurationException: If the recording metadata not setup correctly - :rtype: tuple(~numpy.ndarray, list(int)) """ if buffer_type == BufferDataType.NEURON_SPIKES: spikes, data_indexes = self.__get_neuron_spikes(rec_id) @@ -834,11 +812,10 @@ def __get_matrix_data_by_region( """ Extracts data for this region. - :param int region_id: Region data came from - :param array(int) neurons: mapping of local ID to global ID - :param DataType data_type: type of data to extract + :param region_id: Region data came from + :param neurons: mapping of local ID to global ID + :param data_type: type of data to extract :return: times, data - :rtype: tuple(~numpy.ndarray, ~numpy.ndarray) """ # for buffering output info is taken form the buffer manager record_raw = self._read_recording(region_id) @@ -869,15 +846,13 @@ def __get_matrix_data( """ Gets the matrix data for this population/recording ID. - :param int rec_id: - :param DataType data_type: type of data to extract + :param rec_id: + :param data_type: type of data to extract :param view_indexes: The indexes for which data should be returned. Or `None` for all - :type view_indexes: list(int) or None - :param int pop_size: - :param str variable: + :param pop_size: + :param variable: :return: numpy array of the data, neurons - :rtype: tuple(~numpy.ndarray, ~numpy.ndarray) """ signal_array: Optional[NDArray[floating]] = None pop_times: Optional[NDArray[floating]] = None @@ -934,13 +909,12 @@ def __get_rewires_by_region( """ Extracts rewires data for this region and adds it to the lists. - :param int region_id: Region data came from - :param ~pacman.model.graphs.common.Slice vertex_slice: - slice of this region - :param list(int) rewire_values: - :param list(int) rewire_postids: - :param list(int) rewire_preids: - :param list(int) rewire_times: + :param region_id: Region data came from + :param vertex_slice: slice of this region + :param rewire_values: + :param rewire_postids: + :param rewire_preids: + :param rewire_times: """ record_raw = self._read_recording(region_id) if len(record_raw) < 1: @@ -973,9 +947,8 @@ def __get_rewires(self, rec_id: int, """ Extracts rewires data for this region. - :param int rec_id: + :param rec_id: :return: (rewire_values, rewire_postids, rewire_preids, rewire_times) - :rtype: ~numpy.ndarray(tuple(int, int, int, int)) """ rewire_times: List[int] = [] rewire_values: List[int] = [] @@ -1006,16 +979,14 @@ def __get_recorded_pynn7( """ Get recorded data in PyNN 0.7 format. Must not be spikes. - :param int rec_id: - :param DataType data_type: type of data to extract - :param float sampling_interval_ms: - :param bool as_matrix: + :param rec_id: + :param data_type: type of data to extract + :param sampling_interval_ms: + :param as_matrix: :param view_indexes: The indexes for which data should be returned. Or `None` for all - :type view_indexes: list(int) or None - :param int pop_size: - :param str variable: - :rtype: ~numpy.ndarray + :param pop_size: + :param variable: """ data, indexes = self.__get_matrix_data( rec_id, data_type, view_indexes, pop_size, variable) @@ -1041,15 +1012,12 @@ def spinnaker_get_data( SsPyNNaker specific method for getting data as a numpy array, instead of the Neo-based object - :param str pop_label: label for the Population + :param pop_label: label for the Population :param variable: Single variable name. - :type variable: str or list(str) :param as_matrix: If set True the data is returned as a 2d matrix :param view_indexes: The indexes for which data should be returned. If ``None``, all data (view_index = data_indexes) - :type view_indexes: None or iter(int) :return: array of the data - :rtype: ~numpy.ndarray :raises ConfigurationException: If variable is a list of a length other than 1 """ @@ -1086,11 +1054,9 @@ def get_spike_counts( """ Gets the spike counts for the population with this label. - :param str pop_label: label for the Population + :param pop_label: label for the Population :param view_indexes: If supplied indexes to retrieve. - :type view_indexes: None or iter(int) :return: dict of index to count - :rtype: dict(int, int) """ # called to trigger the virtual data warning if applicable self.__get_segment_info() @@ -1180,18 +1146,17 @@ def __read_and_csv_data( """ Reads the data for one variable and adds it to the CSV file. - :param str pop_label: The label for the population of interest + :param pop_label: 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 - :param str variable: - :param ~csv.writer csv_writer: Open CSV writer to write to + :param variable: + :param csv_writer: Open CSV writer to write to :param view_indexes: - :type view_indexes: None, ~numpy.array or list(int) - :param float t_stop: + :param t_stop: :param allow_missing: Flag to say if data for missing variable should raise an exception """ @@ -1234,20 +1199,14 @@ def __read_and_csv_data( def get_empty_block(self, pop_label: str, annotations: Annotations) -> Optional[neo.Block]: """ - :param str pop_label: The label for the population of interest + :param pop_label: 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 - :param variables: - One or more variable names or `None` for all available - :type variables: str, list(str) or None - :param view_indexes: List of neurons IDs to include or `None` for all - :type view_indexes: None or list(int) :param annotations: annotations to put on the neo block - :type annotations: None or dict(str, ...) :return: The Neo block :raises \ ~spinn_front_end_common.utilities.exceptions.ConfigurationException: @@ -1271,7 +1230,7 @@ def get_full_block( Creates a block with metadata and data for this segment. Any previous segments will be empty. - :param str pop_label: The label for the population of interest + :param pop_label: The label for the population of interest .. note:: This is actually the label of the Application Vertex. @@ -1280,13 +1239,9 @@ def get_full_block( :param variables: One or more variable names or `None` for all available - :type variables: str, list(str) or None :param view_indexes: List of neurons IDs to include or `None` for all - :type view_indexes: None or list(int) :param annotations: annotations to put on the neo block - :type annotations: None or dict(str, ...) :return: The Neo block - :rtype: ~neo.core.Block """ block = self.get_empty_block(pop_label, annotations) self.add_segment(block, pop_label, variables, view_indexes, @@ -1299,8 +1254,8 @@ def csv_segment( """ Writes the data including metadata to a CSV file. - :param str csv_file: Path to file to write block metadata to - :param str pop_label: The label for the population of interest + :param csv_file: Path to file to write block metadata to + :param pop_label: The label for the population of interest .. note:: This is actually the label of the Application Vertex. @@ -1309,9 +1264,7 @@ def csv_segment( :param variables: One or more variable names or `None` for all available - :type variables: str, list(str) or None :param view_indexes: List of neurons IDs to include or `None` for all - :type view_indexes: None or list(int) :raises \ ~spinn_front_end_common.utilities.exceptions.ConfigurationException: If the recording metadata not setup correctly @@ -1338,8 +1291,8 @@ def csv_block_metadata( Writes the data including metadata to a CSV file. Overwrites any previous data in the file. - :param str csv_file: Path to file to write block metadata to - :param str pop_label: The label for the population of interest + :param csv_file: Path to file to write block metadata to + :param pop_label: The label for the population of interest .. note:: This is actually the label of the Application Vertex. @@ -1347,7 +1300,6 @@ def csv_block_metadata( duplicate values :param annotations: annotations to put on the neo block - :type annotations: None or dict(str, ...) :raises \ ~spinn_front_end_common.utilities.exceptions.ConfigurationException: If the recording metadata not setup correctly @@ -1419,14 +1371,14 @@ def clear_data(self, pop_label: str, variables: Names) -> None: .. note::: The database must be writable for this to work! - :param str pop_label: The label for the population of interest + :param pop_label: 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 - :param list(str) variables: names of variable to get data for + :param variables: names of variable to get data for """ t_start = SpynnakerDataView.get_current_run_time_ms() variables = self.__clean_variables(variables, pop_label) @@ -1527,8 +1479,7 @@ def array_to_string(indexes: Collection[int]) -> str: IDs are comma separated, except when a series of IDs is sequential then the start:end is used. - :param list(int) indexes: - :rtype: str + :param indexes: """ if indexes is None or len(indexes) == 0: return "" @@ -1562,8 +1513,7 @@ def string_to_array(cls, string: str) -> List[int]: Converts a string into a list of integers. Assumes the string was created by :py:meth:`array_to_string` - :param str string: - :rtype: list(int) + :param string: """ if not string: return [] diff --git a/spynnaker/pyNN/utilities/neo_compare.py b/spynnaker/pyNN/utilities/neo_compare.py index d7d306f1053..3bcd95f7938 100644 --- a/spynnaker/pyNN/utilities/neo_compare.py +++ b/spynnaker/pyNN/utilities/neo_compare.py @@ -21,9 +21,9 @@ def compare_spiketrain(spiketrain1: SpikeTrain, spiketrain2: SpikeTrain, *, """ Checks two spike trains have the exact same data. - :param ~neo.core.SpikeTrain spiketrain1: first spike train - :param ~neo.core.SpikeTrain spiketrain2: second spike train - :param bool same_length: Flag to indicate if the same length of data is + :param spiketrain1: first spike train + :param spiketrain2: second spike train + :param same_length: 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. @@ -51,15 +51,15 @@ def compare_spiketrains( """ Check two Lists of spike trains have the exact same data. - :param list(~neo.core.SpikeTrain) spiketrains1: + :param spiketrains1: First list of spike trains to compare - :param list(~neo.core.SpikeTrain) spiketrains2: + :param spiketrains2: Second list of spike trains to compare - :param bool same_data: Flag to indicate if the same type of data is held, + :param same_data: 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 - :param bool same_length: Flag to indicate if the same length of data is + :param same_length: 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. @@ -80,11 +80,11 @@ def compare_analogsignal(as1: AnalogSignal, as2: AnalogSignal, *, """ Compares two analog signal objects to see if they are the same. - :param ~neo.core.AnalogSignal as1: + :param as1: first analog signal holding list of individual analog signal objects - :param ~neo.core.AnalogSignal as2: + :param as2: second analog signal holding list of individual analog signal objects - :param bool same_length: Flag to indicate if the same length of data is + :param same_length: 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. @@ -140,12 +140,12 @@ def compare_segments( seg1: Segment, seg2: Segment, *, same_data: bool = True, same_length: bool = True) -> None: """ - :param ~neo.core.Segment seg1: First Segment to check - :param ~neo.core.Segment seg2: Second Segment to check - :param bool same_data: Flag to indicate if the same type of data is held, + :param seg1: First Segment to check + :param seg2: Second Segment to check + :param same_data: 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 - :param bool same_length: Flag to indicate if the same length of data is + :param same_length: 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. @@ -179,14 +179,14 @@ def compare_blocks( """ Compares two neo Blocks to see if they hold the same data. - :param ~neo.core.Block neo1: First block to check - :param ~neo.core.Block neo2: Second block to check - :param bool same_runs: Flag to signal if blocks are the same length. + :param neo1: First block to check + :param neo2: Second block to check + :param same_runs: Flag to signal if blocks are the same length. If False extra segments in the larger block are ignored - :param bool same_data: Flag to indicate if the same type of data is held, + :param same_data: 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 - :param bool same_length: Flag to indicate if the same length of data is + :param same_length: 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. diff --git a/spynnaker/pyNN/utilities/neo_convertor.py b/spynnaker/pyNN/utilities/neo_convertor.py index fee3afceacf..830e37382e6 100644 --- a/spynnaker/pyNN/utilities/neo_convertor.py +++ b/spynnaker/pyNN/utilities/neo_convertor.py @@ -29,10 +29,9 @@ def convert_analog_signal( """ Converts part of a NEO object into told spynnaker7 format. - :param ~neo.core.AnalogSignal signal_array: Extended Quantities object - :param quantities.unitquantity.UnitTime time_unit: + :param signal_array: Extended Quantities object + :param time_unit: Data time unit for time index - :rtype: ~numpy.ndarray """ ids = signal_array.annotations["channel_names"] xs = range(len(ids)) @@ -50,11 +49,10 @@ def convert_data(data: Block, name: str, run: int = 0) -> NDArray: """ Converts the data into a numpy array in the format ID, time, value. - :param ~neo.core.Block data: Data as returned by a getData() call - :param str name: Name of the data to be extracted. + :param data: Data as returned by a getData() call + :param name: Name of the data to be extracted. Same values as used in getData() - :param int run: Zero based index of the run to extract data for - :rtype: ~numpy.ndarray + :param run: Zero based index of the run to extract data for """ if len(data.segments) <= run: raise ValueError( @@ -75,13 +73,11 @@ def convert_data_list(data: Block, name: str, Converts the data into a list of numpy arrays in the format ID, time, value. - :param ~neo.core.Block data: Data as returned by a getData() call - :param str name: Name of the data to be extracted. + :param data: Data as returned by a getData() call + :param name: Name of the data to be extracted. Same values as used in getData() :param runs: List of Zero based index of the run to extract data for. Or `None` to extract all runs - :type runs: list(int) or None - :rtype: list(~numpy.ndarray) """ if runs is None: runs = range(len(data.segments)) @@ -96,11 +92,9 @@ def convert_v_list( Converts the voltage into a list numpy array one per segment (all runs) in the format ID, time, value. - :param ~neo.core.Block data: The data to convert; it must have V data in it + :param data: The data to convert; it must have V data in it :param runs: List of Zero based index of the run to extract data for. Or `None` to extract all runs - :type runs: list(int) or None - :rtype: list(~numpy.ndarray) """ return convert_data_list(data, "v", runs=runs) @@ -111,12 +105,10 @@ def convert_gsyn_exc_list( Converts the gsyn_exc into a list numpy array one per segment (all runs) in the format ID, time, value. - :param ~neo.core.Block data: + :param data: The data to convert; it must have Gsyn_exc data in it :param runs: List of Zero based index of the run to extract data for. Or `None` to extract all runs - :type runs: list(int) or None - :rtype: list(~numpy.ndarray) """ return convert_data_list(data, "gsyn_exc", runs=runs) @@ -127,12 +119,10 @@ def convert_gsyn_inh_list( Converts the gsyn_inh into a list numpy array one per segment (all runs) in the format ID, time, value. - :param ~neo.core.Block data: + :param data: The data to convert; it must have Gsyn_inh data in it :param runs: List of Zero based index of the run to extract data for. Or `None` to extract all runs - :type runs: list(int) or None - :rtype: list(~numpy.ndarray) """ return convert_data_list(data, "gsyn_inh", runs=runs) @@ -144,9 +134,8 @@ def convert_gsyn(gsyn_exc: Block, gsyn_inh: Block) -> NDArray: .. note:: It is acceptable for both neo parameters to be the same object - :param ~neo.core.Block gsyn_exc: neo with gsyn_exc data - :param ~neo.core.Block gsyn_inh: neo with gsyn_exc data - :rtype: ~numpy.ndarray + :param gsyn_exc: neo with gsyn_exc data + :param gsyn_inh: neo with gsyn_exc data """ exc = gsyn_exc.segments[0].filter(name='gsyn_exc')[0] inh = gsyn_inh.segments[0].filter(name='gsyn_inh')[0] @@ -177,8 +166,7 @@ def convert_spiketrains(spiketrains: List[SpikeTrain]) -> NDArray: """ Converts a list of spiketrains into spynnaker7 format. - :param list(~neo.core.SpikeTrain) spiketrains: List of SpikeTrains - :rtype: ~numpy.ndarray + :param spiketrains: List of SpikeTrains """ if len(spiketrains) == 0: return np.empty(shape=(0, 2)) @@ -194,9 +182,8 @@ def convert_spikes(neo: Block, run: int = 0) -> NDArray: """ Extracts the spikes for run one from a Neo Object. - :param ~neo.core.Block neo: neo Object including Spike Data - :param int run: Zero based index of the run to extract data for - :rtype: ~numpy.ndarray + :param neo: neo Object including Spike Data + :param run: Zero based index of the run to extract data for """ if len(neo.segments) <= run: raise ValueError( @@ -209,9 +196,8 @@ def count_spiketrains(spiketrains: SpikeTrain) -> int: """ Help function to count the number of spikes in a list of spiketrains. - :param list(~neo.core.SpikeTrain) spiketrains: List of SpikeTrains + :param spiketrains: List of SpikeTrains :return: Total number of spikes in all the spiketrains - :rtype: int """ return sum(map(len, spiketrains)) @@ -222,7 +208,7 @@ def count_spikes(neo: Block) -> int: Only counts run 0 - :param ~neo.core.Block neo: Neo Object which has spikes in it + :param neo: Neo Object which has spikes in it :return: The number of spikes in the first segment """ return count_spiketrains(neo.segments[0].spiketrains) diff --git a/spynnaker/pyNN/utilities/neo_csv.py b/spynnaker/pyNN/utilities/neo_csv.py index 73304ff34e1..75c2490f8b8 100644 --- a/spynnaker/pyNN/utilities/neo_csv.py +++ b/spynnaker/pyNN/utilities/neo_csv.py @@ -74,13 +74,13 @@ def _csv_variable_metdata( """ Writes the metadata for a variable to CSV - :param ~csv.writer csv_writer: Open CSV writer to write to - :param str variable_type: - :param str variable: - :param float t_start: - :param float t_stop: - :param float sampling_interval_ms: - :param str units: + :param csv_writer: Open CSV writer to write to + :param variable_type: + :param variable: + :param t_start: + :param t_stop: + :param sampling_interval_ms: + :param units: """ csv_writer.writerow([variable_type, variable]) csv_writer.writerow([self._T_START, t_start * ms]) @@ -98,9 +98,8 @@ def __quantify(self, as_str: str) -> Quantity: The String should be a float, a space and a Quantities label - :param str as_str: String representation of a quantity. + :param as_str: String representation of a quantity. :return: A Quantities object - :rtype: ~quantities.Quantity """ parts = as_str.split(" ") return Quantity(float(parts[0]), units=parts[1]) @@ -113,10 +112,8 @@ def __read_variable_metadata(self, csv_reader: CSVReader) -> Tuple[ A block is a number of rows each of exactly 2 values followed by an empty row - :param ~csv.reader csv_reader: Open CSV writer to read from + :param csv_reader: Open CSV writer to read from :return: t_start, t_stop, sampling_period, units - :rtype: tuple(~quantities.Quantity, ~quantities.Quantity, - ~quantities.Quantity, str) """ metadata = self.__read_metadata(csv_reader) return ( @@ -133,9 +130,8 @@ def __read_signal_array(self, csv_reader: CSVReader) -> NDArray[float64]: All rows must have the same length. The assumption is that all values in the block represent floats. - :param ~csv.writer csv_writer: Open CSV writer to read from + :param csv_reader: Open CSV reader to read from :return: Numpy signal array of floats - :rtype: ~numpy.array """ rows = [] row = next(csv_reader) @@ -158,8 +154,8 @@ def __csv_indexes(self, indexes: NDArray[integer], no data below. This happens when the data is an empty array such as no spikes or rewires happened or the run was for time 0 - :param ~csv.writer csv_writer: Open CSV writer to write to - :param list(int) indexes: + :param csv_writer: Open CSV writer to write to + :param indexes: """ if len(indexes) > 0: csv_writer.writerow(indexes) @@ -170,9 +166,8 @@ def __read_indexes(self, csv_reader: CSVReader) -> NDArray[integer]: """ Reads the index or NO_INTERSECTION string from the CSV - :param ~csv.writer csv_writer: Open CSV writer to read from + :param csv_reader: Open CSVreader to read from :return: list of indexes - :rtype: list(int) """ row = next(csv_reader) assert len(row) > 0 @@ -188,19 +183,12 @@ def _insert_spike_data( """ Creates the SpikeTrains and inserts then into the segment - :param str pop_label: 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 - - :param list(int) view_indexes: - :param Segment segment: - :param ~numpy.ndarray spikes: - :param float t_start: - :param float t_stop: - :param ~quantities.Quantity sampling_rate: Rate a neuron is recorded + :param view_indexes: + :param segment: + :param spikes: + :param t_start: + :param t_stop: + :param sampling_rate: Rate a neuron is recorded """ block = segment.block first_id = block.annotations[self._FIRST_ID] @@ -226,9 +214,9 @@ def _csv_spike_data(self, csv_writer: CSVWriter, spikes: NDArray, """ Writes the spikes to the CSV file. - :param ~csv.writer csv_writer: Open CSV writer to write to - :param ~numpy.ndarray spikes: - :param list(int) indexes: The indexes for which there could be data + :param csv_writer: Open CSV writer to write to + :param spikes: + :param indexes: The indexes for which there could be data """ self.__csv_indexes(indexes, csv_writer) csv_writer.writerows(spikes) @@ -239,9 +227,9 @@ def __read_spike_data(self, csv_reader: CSVReader, segment: Segment, """ Reads spikes from the CSV file and add SpikeTrains to the segment. - :param ~csv.reader csv_reader: Open CSV writer to read from - :param Segment segment: - :param str variable: Name of the variable being read + :param csv_reader: Open CSV writer to read from + :param segment: + :param variable: Name of the variable being read """ try: t_start, t_stop, sampling_period, _ = \ @@ -263,14 +251,12 @@ def _insert_matrix_data( """ Adds a data item that is an analog signal to a neo segment. - :param str variable: the variable name - :param ~neo.core.Segment segment: Segment to add data to - :param ~numpy.ndarray signal_array: the raw signal data - :param list(int) indexes: The indexes for the data - :type t_start: float or int - :param ~quantities.Quantity sampling_rate: Rate a neuron is recorded + :param variable: the variable name + :param segment: Segment to add data to + :param signal_array: the raw signal data + :param indexes: The indexes for the data + :param sampling_rate: Rate a neuron is recorded :param units: the units of the recorded value - :type units: quantities.quantity.Quantity or str """ block = segment.block @@ -297,9 +283,9 @@ def _csv_matrix_data( """ Writes data to a CSV file. - :param ~csv.writer csv_writer: Open CSV writer to write to - :param ~numpy.ndarray signal_array: the raw signal data - :param list(int) indexes: The indexes for the data + :param csv_writer: Open CSV writer to write to + :param signal_array: the raw signal data + :param indexes: The indexes for the data """ self.__csv_indexes(indexes, csv_writer) csv_writer.writerows(signal_array) @@ -310,9 +296,9 @@ def __read_matrix_data(self, csv_reader: CSVReader, segment: Segment, """ Reads matrix data and adds it to the segment. - :param ~csv.reader csv_reader: Open CSV writer to read from - :param Segment segment: - :param str variable: + :param csv_reader: Open CSV writer to read from + :param segment: + :param variable: """ t_start, _, sampling_period, units = \ self.__read_variable_metadata(csv_reader) @@ -330,10 +316,10 @@ def _insert_formation_events( """ Adds formation data to a neo segment. - :param ~neo.core.Segment segment: Segment to add data to - :param str variable: the variable name - :param list[~quantities.Quantity] formation_times: - :param list[str] formation_labels: + :param segment: Segment to add data to + :param variable: the variable name + :param formation_times: + :param formation_labels: """ formation_event_array = Event( times=formation_times, @@ -351,10 +337,10 @@ def _insert_elimination_events( """ Adds elimination data to a neo segment. - :param ~neo.core.Segment segment: Segment to add data to - :param str variable: the variable name - :param list[~quantities.Quantity] elimination_times: - :param list[str] elimination_labels: + :param segment: Segment to add data to + :param variable: the variable name + :param elimination_times: + :param elimination_labels: """ elimination_event_array = Event( times=elimination_times, @@ -370,9 +356,9 @@ def _insert_neo_rewirings(self, segment: Segment, event_array: NDArray, """ Adds data that represent rewire events to a neo segment. - :param ~neo.core.Segment segment: Segment to add data to - :param ~numpy.ndarray event_array: the raw "event" data - :param str variable: the variable name + :param segment: Segment to add data to + :param event_array: the raw "event" data + :param variable: the variable name """ formation_times: List[Quantity] = [] formation_labels: List[str] = [] @@ -400,8 +386,8 @@ def _csv_rewirings( """ Adds data that represent rewires events to a CSV file. - :param ~csv.writer csv_writer: Open CSV writer to write to - :param ~numpy.ndarray event_array: the raw "event" data + :param csv_writer: Open CSV writer to write to + :param event_array: the raw "event" data """ formation: List[Tuple[Quantity, str]] = [] elimination: List[Tuple[Quantity, str]] = [] @@ -429,9 +415,8 @@ def __read_times_and_labels(self, csv_reader: CSVReader) -> Tuple[ """ Reads formation or elimination data from the CSV file. - :param ~csv.reader csv_reader: Open CSV writer to read from + :param csv_reader: Open CSV writer to read from :return: A list of times and a list of labels - :rtype: tuple(list[~quantities.Quantity], list[str]) """ times: List[Quantity] = [] labels: List[str] = [] @@ -448,9 +433,9 @@ def __read_rewirings(self, csv_reader: CSVReader, segment: Segment, """ Reads rewiring data from a CSV file and adds it to the segment. - :param ~csv.reader csv_reader: Open CSV writer to read from - :param ~neo.core.Segment segment: Segment to add data to - :param str variable: + :param csv_reader: Open CSV writer to read from + :param segment: Segment to add data to + :param variable: """ self.__read_metadata(csv_reader) row = next(csv_reader) @@ -470,10 +455,6 @@ def _insert_empty_segment(self, block: Block, segment_number: int, Creates an empty segment and adds it to the block. Unless other insert methods are called the segment will hold no data. - - :param ~neo.core.Block block: - :param int segment_number: - :param datetime rec_datetime: """ segment = Segment( name=f"segment{segment_number}", @@ -500,9 +481,9 @@ def _csv_segment_metadata(self, csv_writer: CSVWriter, segment_number: int, Unless other CSV methods are called the CSV will hold no data. - :param ~csv.writer csv_writer: Open CSV writer to write to - :param int segment_number: - :param ~datetime.datetime rec_datetime: + :param csv_writer: Open CSV writer to write to + :param segment_number: + :param rec_datetime: """ csv_writer.writerow([self._SEGMENT_NUMBER, segment_number]) csv_writer.writerow([self._REC_DATETIME, rec_datetime]) @@ -515,9 +496,9 @@ def __read_segment(self, csv_reader: CSVReader, block: Block, Unless other read methods are called the segment will hold no data - :param ~csv.reader csv_reader: Open CSV writer to read from - :param ~neo.core.Block block: - :param str segment_number_st: + :param csv_reader: Open CSV writer to read from + :param block: + :param segment_number_st: """ row = next(csv_reader) assert (row[0] == self._REC_DATETIME) @@ -539,15 +520,7 @@ def _insert_empty_block( Does not actually "insert" the block anywhere. The insert name is aligned with other methods to create a full block - :param str pop_label: - :param str description: - :param int size: - :param int first_id: - :param float dt: - :param str simulator: - :param dict annotations: :return: a block with just metadata - :rtype: ~neo.core.Block """ block = Block() block.name = pop_label @@ -571,14 +544,13 @@ def _csv_block_metadata( pop_size: int, first_id: int, description: str, annotations: Annotations) -> None: """ - :param ~csv.writer csv_writer: Open CSV writer to write to - :param str pop_label: - :param float t_stop: - :param int pop_size: - :param int first_id: - :param str description: + :param csv_writer: Open CSV writer to write to + :param pop_label: + :param t_stop: + :param pop_size: + :param first_id: + :param description: :param annotations: annotations to put on the neo block - :type annotations: None or dict(str, ...) """ csv_writer.writerow([self._POPULATION, pop_label]) csv_writer.writerow([self._DESCRIPTION, f'"{description}"']) @@ -598,9 +570,8 @@ def __read_empty_block(self, csv_reader: CSVReader) -> Block: """ Reads block metadata and uses it to create an empty block. - :param ~csv.reader csv_reader: Open CSV writer to read from + :param csv_reader: Open CSV writer to read from :return: empty block - :rtype: ~neo.core.Block """ metadata = self.__read_metadata(csv_reader) return self._insert_empty_block( @@ -619,9 +590,8 @@ def __read_metadata(self, csv_reader: CSVReader) -> Dict[str, str]: A metadata block is zero or more lines of two columns followed by an empty line. the first column will be the keys the second the data - :param ~csv.reader csv_reader: Open CSV writer to read from + :param csv_reader: Open CSV writer to read from :return: a dict of the keys to unformatted values - :rtype: dict(str, str) """ metadata: Dict[str, str] = {} row = next(csv_reader) @@ -635,9 +605,8 @@ def read_csv(self, csv_file: str) -> Block: """ Reads a whole CSV file and creates a block with data. - :param str csv_file: Path of file to read + :param csv_file: Path of file to read :return: a block with all the data in the CSV file. - :rtype: ~neo.core.Block """ with open(csv_file, newline='', encoding="utf-8") as csvfile: csv_reader = csv.reader(csvfile, delimiter=',', quotechar='"') diff --git a/spynnaker/pyNN/utilities/running_stats.py b/spynnaker/pyNN/utilities/running_stats.py index 7612ae27c85..3fc662e2f87 100644 --- a/spynnaker/pyNN/utilities/running_stats.py +++ b/spynnaker/pyNN/utilities/running_stats.py @@ -33,7 +33,6 @@ def add_item(self, x: Union[int, float]) -> None: Adds an item to the running statistics. :param x: The item to add - :type x: int or float """ old_n_items = self.__n_items self.__n_items += 1 @@ -49,9 +48,9 @@ def add_items(self, mean: float, variance: float, n_items: int) -> None: """ Add a bunch of items (via their statistics). - :param float mean: The mean of the items to add. - :param float variance: The variance of the items to add. - :param int n_items: The number of items represented. + :param mean: The mean of the items to add. + :param variance: The variance of the items to add. + :param n_items: The number of items represented. """ if n_items > 0: new_n_items = self.__n_items + n_items @@ -72,8 +71,6 @@ def add_items(self, mean: float, variance: float, n_items: int) -> None: def n_items(self) -> int: """ The number of items seen. - - :rtype: int """ return self.__n_items @@ -81,8 +78,6 @@ def n_items(self) -> int: def mean(self) -> float: """ The mean of the items seen. - - :rtype: float """ return self.__mean @@ -90,8 +85,6 @@ def mean(self) -> float: def variance(self) -> float: """ The variance of the items seen. - - :rtype: float """ if self.__n_items <= 1: return 0.0 @@ -101,7 +94,5 @@ def variance(self) -> float: def standard_deviation(self) -> float: """ The population standard deviation of the items seen. - - :rtype: float """ return math.sqrt(self.variance) diff --git a/spynnaker/pyNN/utilities/struct.py b/spynnaker/pyNN/utilities/struct.py index 0209ce22c05..f4e0851228a 100644 --- a/spynnaker/pyNN/utilities/struct.py +++ b/spynnaker/pyNN/utilities/struct.py @@ -70,12 +70,10 @@ def __init__( :param fields: The types and names of the fields, ordered as they appear in the structure. - :type fields: list(~data_specification.enums.DataType, str) - :param StructRepeat repeat_type: How the structure repeats + :param repeat_type: How the structure repeats :param default_values: Dict of field name -> value to use when values doesn't contain the field - :type default_values: dict(str, int or float) or None """ self.__fields = fields self.__repeat_type = repeat_type @@ -86,8 +84,6 @@ def fields(self) -> Sequence[Tuple[DataType, str]]: """ The types and names of the fields, ordered as they appear in the structure. - - :rtype: list(~data_specification.enums.DataType, str) """ return self.__fields @@ -95,8 +91,6 @@ def fields(self) -> Sequence[Tuple[DataType, str]]: def repeat_type(self) -> StructRepeat: """ How the structure repeats. - - :rtype: StructRepeat """ return self.__repeat_type @@ -104,8 +98,6 @@ def repeat_type(self) -> StructRepeat: def numpy_dtype(self) -> numpy.dtype: """ The numpy data type of the structure. - - :rtype: ~numpy.dtype """ return numpy.dtype( [(name, numpy.dtype(data_type.struct_encoding)) @@ -117,8 +109,7 @@ def get_size_in_whole_words(self, array_size: int = 1) -> int: Get the size of the structure in whole words in an array of given size (default 1 item). - :param int array_size: The number of elements in an array of structures - :rtype: int + :param array_size: The number of elements in an array of structures """ datatype = self.numpy_dtype size_in_bytes = array_size * datatype.itemsize @@ -130,12 +121,9 @@ def get_data(self, values: ValueMap, Get a numpy array of uint32 of data for the given values. :param values: The values to fill in the data with - :type values: dict(str, int or float or AbstractList) :param vertex_slice: The vertex slice to get the data for, or `None` if the structure is global. - :type vertex_slice: Slice or None - :rtype: ~numpy.ndarray(dtype="uint32") """ n_items = 1 if vertex_slice is None: @@ -215,14 +203,11 @@ def get_generator_data( """ Get a numpy array of uint32 of data to generate the given values. - :param ~dict-like values: - The values to fill in the data with + :param values: The values to fill in the data with :param vertex_slice: 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! - :type vertex_slice: Slice or None - :rtype: ~numpy.ndarray(dtype="uint32") """ # Define n_repeats, which is either the total number of neurons # or a flag to indicate that the data repeats for each neuron @@ -345,8 +330,6 @@ def __gen_data_for_slice( def is_generatable(self) -> bool: """ Whether the data inside could be generated on machine. - - :rtype: bool """ return all(type_has_generator(data_type) for data_type, _name in self.__fields) @@ -358,17 +341,9 @@ def read_data( Read a byte string of data and write to values. :param data: The data to be read - :type data: bytes or bytearray - :param ~spinn_utilities.ranged.RangeDictionary values: - The values to update with the read data - :param int data_offset: + :param values: The values to update with the read data + :param data_offset: Index of the byte at the start of the valid data. - :param int offset: - The first index into values to write to. - :param array_size: - The number of structure copies to read, or `None` if this is a - non-repeating structure. - :type array_size: int or None """ n_items = 1 ids: NDArray[integer] = numpy.zeros([0], dtype=uint32) diff --git a/spynnaker/pyNN/utilities/utility_calls.py b/spynnaker/pyNN/utilities/utility_calls.py index 3470ffa9854..7cfc721d958 100644 --- a/spynnaker/pyNN/utilities/utility_calls.py +++ b/spynnaker/pyNN/utilities/utility_calls.py @@ -78,7 +78,7 @@ def check_directory_exists_and_create_if_not(filename: str) -> None: """ Create a parent directory for a file if it doesn't exist. - :param str filename: The file whose parent directory is to be created + :param filename: The file whose parent directory is to be created """ directory = os.path.dirname(filename) if directory != "" and not os.path.exists(directory): @@ -92,11 +92,8 @@ def convert_param_to_numpy( Convert parameters into numpy arrays. :param param: the param to convert - :type param: ~pyNN.random.RandomDistribution or int or float or list(int) - or list(float) or ~numpy.ndarray - :param int no_atoms: the number of atoms available for conversion of param + :param no_atoms: the number of atoms available for conversion of param :return: the converted param as an array of floats - :rtype: ~numpy.ndarray(float) """ # Deal with random distributions by generating values if isinstance(param, RandomDistribution): @@ -126,10 +123,8 @@ def convert_to(value: float, data_type: DataType) -> uint32: Convert a value to a given data type. :param value: The value to convert - :param ~data_specification.enums.DataType data_type: - The data type to convert to + :param data_type: The data type to convert to :return: The converted data as a numpy data type - :rtype: numpy.uint32 """ return numpy.round(data_type.encode_as_int(value)).astype( data_type.struct_encoding) @@ -143,16 +138,13 @@ def read_in_data_from_file(