From 817c66423a860eeb42c4b811acefcf4df889d811 Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Tue, 5 Nov 2024 13:27:28 +0000 Subject: [PATCH] small bit of documentation about accessing postsynaptic variables with delay --- pygenn/genn_model.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pygenn/genn_model.py b/pygenn/genn_model.py index d6229ac9a..f5009a4b9 100644 --- a/pygenn/genn_model.py +++ b/pygenn/genn_model.py @@ -1290,11 +1290,18 @@ def create_weight_update_model( where, once again, ``inc`` is the amount to add to the postsynaptic neuron's ``inSyn`` variable and ``delay`` is the length of the dendritic delay in timesteps. By implementing ``delay`` as a weight update model variable, heterogeneous synaptic delays can be implemented. - For an example, see WeightUpdateModels::StaticPulseDendriticDelay for a simple synapse update model with heterogeneous dendritic delays. + For an example, see :func:`.weight_update_models.StaticPulseDendriticDelay` for a simple synapse update model with heterogeneous dendritic delays. + These delays can also be used to provide delayed access to ``post_vars`` and ``post_neuron_var_refs`` using ``[]`` syntax. For example, - When using dendritic delays, the *maximum* dendritic delay for a synapse populations must be specified via the - :attr:`SynapseGroup.max_dendritic_delay_timesteps` property. One can also define synaptic effects that occur in the reverse direction, - i.e. terms that are added to a target variable in the _presynaptic_ neuron using the ``addToPre(inc)`` function. For example, + .. code-block:: python + + pre_spike_syn_code="variable -= postVar[delay];" + + where, ``variable`` is a per-synapse variable; ``postVar`` is either a postsynaptic variable or postsynaptic variable reference; + and ``delay`` is some sort of integer expression. When using dendritic delays, the *maximum* dendritic delay for a synapse populations + must be specified via the :attr:`SynapseGroup.max_dendritic_delay_timesteps` property. One can also define synaptic effects that + occur in the reverse direction, i.e. terms that are added to a target variable in the _presynaptic_ neuron using the ``addToPre(inc)`` function. + For example, .. code-block:: python