Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into syn-delay
Browse files Browse the repository at this point in the history
  • Loading branch information
C.A.P. Linssen committed Sep 13, 2023
2 parents 5b25198 + 13d08a4 commit 5ccfdfd
Show file tree
Hide file tree
Showing 349 changed files with 9,412 additions and 12,628 deletions.
78 changes: 74 additions & 4 deletions .github/workflows/nestml-build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: NESTML compatibility check with older NEST versions
name: NESTML build

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

link_checker:
Expand Down Expand Up @@ -47,12 +51,79 @@ jobs:
run: |
python3 extras/codeanalysis/check_copyright_headers.py && python3 -m pycodestyle $GITHUB_WORKSPACE -v --ignore=E241,E501,E714,E713,E714,E252,W503 --exclude=$GITHUB_WORKSPACE/doc,$GITHUB_WORKSPACE/.git,$GITHUB_WORKSPACE/NESTML.egg-info,$GITHUB_WORKSPACE/pynestml/generated,$GITHUB_WORKSPACE/extras,$GITHUB_WORKSPACE/build,$GITHUB_WORKSPACE/.github
build_and_test_py_standalone:
needs: [static_checks]
runs-on: ubuntu-latest
steps:
# Checkout the repository contents
- name: Checkout NESTML code
uses: actions/checkout@v3

# Setup Python version
- name: Setup Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8

# Install dependencies
- name: Install apt dependencies
run: |
sudo apt-get update
sudo apt-get install libgsl0-dev libncurses5-dev pkg-config
sudo apt-get install python3-all-dev python3-matplotlib python3-numpy python3-scipy ipython3
# Install Python dependencies
- name: Python dependencies
run: |
python -m pip install --upgrade pip pytest jupyterlab matplotlib pycodestyle scipy
python -m pip install -r requirements.txt
# Install Java
- name: Install Java 11
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11.0.x'
java-package: jre

# Install Antlr4
- name: Install Antlr4
run: |
wget http://www.antlr.org/download/antlr-4.10-complete.jar
echo \#\!/bin/bash > antlr4
echo java -cp \"`pwd`/antlr-4.10-complete.jar:$CLASSPATH\" org.antlr.v4.Tool \"\$@\" >> antlr4
echo >> antlr4
chmod +x antlr4
echo PATH=$PATH:`pwd` >> $GITHUB_ENV
# Install NESTML
- name: Install NESTML
run: |
export PYTHONPATH=${{ env.PYTHONPATH }}:${{ env.NEST_INSTALL }}/lib/python3.8/site-packages
#echo PYTHONPATH=`pwd` >> $GITHUB_ENV
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
python setup.py install
- name: Generate Lexer and Parser using Antlr4
run: |
cd pynestml/grammars
./generate_lexer_parser
# Run integration tests
- name: Run integration tests
run: |
rc=0
for fn in $GITHUB_WORKSPACE/tests/python_standalone_tests/*.py; do
pytest -s -o log_cli=true -o log_cli_level="DEBUG" ${fn} || rc=1
done;
exit $rc
build_and_test:
needs: [static_checks]
runs-on: ubuntu-latest
strategy:
matrix:
nest_branch: ["v2.20.2", "v3.0", "v3.1", "v3.2", "v3.3", "v3.4", "master"]
nest_branch: ["v2.20.2", "v3.0", "v3.5", "master"]
fail-fast: false
steps:
# Checkout the repository contents
Expand All @@ -75,7 +146,7 @@ jobs:
# Install Python dependencies
- name: Python dependencies
run: |
python -m pip install --upgrade pip pytest jupyterlab matplotlib pycodestyle scipy
python -m pip install --upgrade pip pytest jupyterlab matplotlib pycodestyle scipy pandas
python -m pip install -r requirements.txt
# Install Java
Expand Down Expand Up @@ -124,7 +195,6 @@ jobs:
- name: Generate Lexer and Parser using Antlr4
run: |
find pynestml/generated -not -name __init__.py -a -not -name generated -delete
cd pynestml/grammars
./generate_lexer_parser
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![astropy](http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat)](http://www.astropy.org/) [![Build Status](https://travis-ci.org/nest/nestml.svg?branch=master)](https://travis-ci.org/nest/nestml)
[![astropy](http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat)](http://www.astropy.org/) [![NESTML build](https://github.com/nest/nestml/actions/workflows/nestml-build.yml/badge.svg)](https://github.com/nest/nestml/actions/)

# NESTML: The NEST Modelling Language

Expand Down Expand Up @@ -31,3 +31,11 @@ NESTML is free software: you can redistribute it and/or modify it under the term
NESTML is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with NESTML. If not, see <http://www.gnu.org/licenses/>.

## Acknowledgements

This software was initially supported by the JARA-HPC Seed Fund *NESTML - A modeling language for spiking neuron and synapse models for NEST* and the Initiative and Networking Fund of the Helmholtz Association and the Helmholtz Portfolio Theme *Simulation and Modeling for the Human Brain*.

This software was developed in part or in whole in the Human Brain Project, funded from the European Union's Horizon 2020 Framework Programme for Research and Innovation under Specific Grant Agreements No. 720270, No. 785907 and No. 945539 (Human Brain Project SGA1, SGA2 and SGA3).


95 changes: 2 additions & 93 deletions doc/models_library/aeif_cond_alpha.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ iaf_cond_alpha, aeif_cond_exp

Parameters
++++++++++



.. csv-table::
:header: "Name", "Physical unit", "Default value", "Description"
:widths: auto
Expand All @@ -72,7 +69,6 @@ Parameters




State variables
+++++++++++++++

Expand All @@ -92,105 +88,18 @@ Equations




.. math::
\frac{ dV_{m} } { dt }= \frac 1 { C_{m} } \left( { (-g_{L} \cdot (V_{bounded} - E_{L}) + I_{spike} - I_{syn,exc} - I_{syn,inh} - w + I_{e} + I_{stim}) } \right)
.. math::
\frac{ dw } { dt }= \frac 1 { \tau_{w} } \left( { (a \cdot (V_{bounded} - E_{L}) - w) } \right)
Source code
+++++++++++

.. code-block:: nestml
neuron aeif_cond_alpha:
state:
V_m mV = E_L # Membrane potential
w pA = 0pA # Spike-adaptation current
end
equations:
inline V_bounded mV = min(V_m,V_peak) # prevent exponential divergence
kernel g_inh = (e / tau_syn_inh) * t * exp(-t / tau_syn_inh)
kernel g_exc = (e / tau_syn_exc) * t * exp(-t / tau_syn_exc)
# Add inlines to simplify the equation definition of V_m
inline exp_arg real = (V_bounded - V_th) / Delta_T
inline I_spike pA = g_L * Delta_T * exp(exp_arg)
inline I_syn_exc pA = convolve(g_exc,exc_spikes) * (V_bounded - E_exc)
inline I_syn_inh pA = convolve(g_inh,inh_spikes) * (V_bounded - E_inh)
V_m'=(-g_L * (V_bounded - E_L) + I_spike - I_syn_exc - I_syn_inh - w + I_e + I_stim) / C_m
w'=(a * (V_bounded - E_L) - w) / tau_w
end
parameters:
# membrane parameters
C_m pF = 281.0pF # Membrane Capacitance
t_ref ms = 0.0ms # Refractory period
V_reset mV = -60.0mV # Reset Potential
g_L nS = 30.0nS # Leak Conductance
E_L mV = -70.6mV # Leak reversal Potential (aka resting potential)
# spike adaptation parameters
# spike adaptation parameters
a nS = 4nS # Subthreshold adaptation
b pA = 80.5pA # Spike-triggered adaptation
Delta_T mV = 2.0mV # Slope factor
tau_w ms = 144.0ms # Adaptation time constant
V_th mV = -50.4mV # Threshold Potential
V_peak mV = 0mV # Spike detection threshold
# synaptic parameters
# synaptic parameters
E_exc mV = 0mV # Excitatory reversal Potential
tau_syn_exc ms = 0.2ms # Synaptic Time Constant Excitatory Synapse
E_inh mV = -85.0mV # Inhibitory reversal Potential
tau_syn_inh ms = 2.0ms # Synaptic Time Constant for Inhibitory Synapse
# constant external input current
# constant external input current
I_e pA = 0pA
end
internals:
# Impulse to add to DG_EXC on spike arrival to evoke unit-amplitude conductance excursion
PSConInit_E nS/ms = nS * e / tau_syn_exc
# Impulse to add to DG_INH on spike arrival to evoke unit-amplitude conductance excursion
PSConInit_I nS/ms = nS * e / tau_syn_inh
# refractory time in steps
RefractoryCounts integer = steps(t_ref)
# counts number of tick during the refractory period
# counts number of tick during the refractory period
r integer
end
input:
inh_spikes nS <-inhibitory spike
exc_spikes nS <-excitatory spike
I_stim pA <-current
end
output: spike
update:
integrate_odes()
if r > 0: # refractory
r -= 1 # decrement refractory ticks count
V_m = V_reset # clamp potential
elif V_m >= V_peak:
r = RefractoryCounts
V_m = V_reset # clamp potential
w += b
emit_spike()
end
end
end
The model source code can be found in the NESTML models repository here: `aeif_cond_alpha <https://github.com/nest/nestml/tree/master/models/neurons/aeif_cond_alpha.nestml>`_.

Characterisation
++++++++++++++++
Expand All @@ -200,4 +109,4 @@ Characterisation

.. footer::

Generated at 2022-03-28 19:04:29.432312
Generated at 2023-08-22 14:29:44.564178
91 changes: 2 additions & 89 deletions doc/models_library/aeif_cond_exp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ iaf_cond_exp, aeif_cond_alpha

Parameters
++++++++++



.. csv-table::
:header: "Name", "Physical unit", "Default value", "Description"
:widths: auto
Expand All @@ -73,7 +70,6 @@ Parameters




State variables
+++++++++++++++

Expand All @@ -93,101 +89,18 @@ Equations




.. math::
\frac{ dV_{m} } { dt }= \frac 1 { C_{m} } \left( { (-g_{L} \cdot (V_{bounded} - E_{L}) + I_{spike} - I_{syn,exc} - I_{syn,inh} - w + I_{e} + I_{stim}) } \right)
.. math::
\frac{ dw } { dt }= \frac 1 { \tau_{w} } \left( { (a \cdot (V_{bounded} - E_{L}) - w) } \right)
Source code
+++++++++++

.. code-block:: nestml
neuron aeif_cond_exp:
state:
V_m mV = E_L # Membrane potential
w pA = 0pA # Spike-adaptation current
end
equations:
inline V_bounded mV = min(V_m,V_peak) # prevent exponential divergence
kernel g_inh = exp(-t / tau_syn_inh)
kernel g_exc = exp(-t / tau_syn_exc)
# Add inlines to simplify the equation definition of V_m
inline exp_arg real = (V_bounded - V_th) / Delta_T
inline I_spike pA = g_L * Delta_T * exp(exp_arg)
inline I_syn_exc pA = convolve(g_exc,exc_spikes) * (V_bounded - E_exc)
inline I_syn_inh pA = convolve(g_inh,inh_spikes) * (V_bounded - E_inh)
V_m'=(-g_L * (V_bounded - E_L) + I_spike - I_syn_exc - I_syn_inh - w + I_e + I_stim) / C_m
w'=(a * (V_bounded - E_L) - w) / tau_w
end
parameters:
# membrane parameters
C_m pF = 281.0pF # Membrane Capacitance
t_ref ms = 0.0ms # Refractory period
V_reset mV = -60.0mV # Reset Potential
g_L nS = 30.0nS # Leak Conductance
E_L mV = -70.6mV # Leak reversal Potential (aka resting potential)
# spike adaptation parameters
# spike adaptation parameters
a nS = 4nS # Subthreshold adaptation
b pA = 80.5pA # Spike-triggered adaptation
Delta_T mV = 2.0mV # Slope factor
tau_w ms = 144.0ms # Adaptation time constant
V_th mV = -50.4mV # Threshold Potential
V_peak mV = 0mV # Spike detection threshold
# synaptic parameters
# synaptic parameters
E_exc mV = 0mV # Excitatory reversal Potential
tau_syn_exc ms = 0.2ms # Synaptic Time Constant Excitatory Synapse
E_inh mV = -85.0mV # Inhibitory reversal Potential
tau_syn_inh ms = 2.0ms # Synaptic Time Constant for Inhibitory Synapse
# constant external input current
# constant external input current
I_e pA = 0pA
end
internals:
# refractory time in steps
RefractoryCounts integer = steps(t_ref)
# counts number of tick during the refractory period
# counts number of tick during the refractory period
r integer
end
input:
inh_spikes nS <-inhibitory spike
exc_spikes nS <-excitatory spike
I_stim pA <-current
end
output: spike
update:
integrate_odes()
if r > 0: # refractory
r -= 1 # decrement refractory ticks count
V_m = V_reset # clamp potential
elif V_m >= V_peak:
r = RefractoryCounts + 1
V_m = V_reset # clamp potential
w += b
emit_spike()
end
end
end
The model source code can be found in the NESTML models repository here: `aeif_cond_exp <https://github.com/nest/nestml/tree/master/models/neurons/aeif_cond_exp.nestml>`_.

Characterisation
++++++++++++++++
Expand All @@ -197,4 +110,4 @@ Characterisation

.. footer::

Generated at 2022-03-28 19:04:29.501988
Generated at 2023-08-22 14:29:44.513192
Loading

0 comments on commit 5ccfdfd

Please sign in to comment.