File: synapses.py_

package info (click to toggle)
brian 2.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,872 kB
  • sloc: python: 51,820; cpp: 2,033; makefile: 108; sh: 72
file content (21 lines) | stat: -rw-r--r-- 587 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{# USES_VARIABLES { _queue } #}
{% extends 'common_group.py_' %}

{% block maincode %}
_spiking_synapses = _queue.peek()

if len(_spiking_synapses):
    # scalar code
    {# Note that we don't write to scalar variables conditionally. The scalar code
       should therefore only include the calculation of scalar expressions
       that are used below for writing to a vector variable #}
    {{scalar_code|autoindent}}

    # vector code
    _idx = _spiking_synapses
    _vectorisation_idx = _idx
    {{vector_code|autoindent}}

# Advance the spike queue
_queue.advance()
{% endblock %}