Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STDP synapse and IAF neuron generation for the compartmental feature [WIP] #1103

Open
wants to merge 393 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
393 commits
Select commit Hold shift + click to select a range
a969e40
removed wrongfully added files
Apr 27, 2022
cd4fddf
replace old code resolving model name
Apr 27, 2022
4d87856
add get_syn_idx to cm_compartmentcurrents template
WillemWybo Apr 27, 2022
3d28553
run NEST builder for compartmental models
Apr 27, 2022
36848e4
Merge remote-tracking branch 'origin/maint/updated-jinja-templates' i…
Apr 27, 2022
4a9620e
fix C++ syntax error in template
Apr 27, 2022
94d1572
fix C++ syntax error in template
Apr 27, 2022
1f42cee
fix cm_main and cm_tree templates, issues in cm_compartmentcurrents()
WillemWybo Apr 29, 2022
5899fba
Merge remote-tracking branch 'origin/maint/updated-jinja-templates' i…
Apr 30, 2022
fc4729a
Merge remote-tracking branch 'pnbabu/rename_calibrate' into maint/upd…
May 3, 2022
14f2d43
Merge remote-tracking branch 'upstream/master' into maint/updated-jin…
May 3, 2022
1d56710
fix code generation for compartmental models
May 3, 2022
b7a425d
Merge pull request #2 from clinssen/maint/updated-jinja-templates_fix
WillemWybo May 4, 2022
1c8bfd5
fix code generation for compartmental models
May 4, 2022
c5020c1
merge local_variables_reference_converter_fix and convert recordables…
WillemWybo May 4, 2022
eeb3de9
working compartmental test
WillemWybo May 4, 2022
6695762
remove cm_main prefix from model name
WillemWybo May 4, 2022
e722e5c
set synapse propagators in pre_run_hook, not in f_numstep
WillemWybo May 4, 2022
b4d00ad
change template filename in template generation script
WillemWybo May 4, 2022
32f49fc
cleanup compartmental model test
WillemWybo May 4, 2022
59e15fe
update copyright headers
WillemWybo Jun 16, 2022
c19390e
add copyright headers second try
WillemWybo Jun 16, 2022
1815a0b
codecheck copyright header try 3
WillemWybo Jun 16, 2022
7cb3ad8
codecheck copyright headers try 4
WillemWybo Jun 16, 2022
8c59d9b
correct code style issues
WillemWybo Jun 16, 2022
750d0da
Merge remote-tracking branch 'upstream/master' into maint/updated-jin…
Jun 23, 2022
b14be96
fix file permissions
Jun 23, 2022
d89e1e2
fix file permissions
Jun 23, 2022
c610f59
move template files to new directory layout
Jun 23, 2022
cdd9ac5
Merge pull request #4 from clinssen/maint/updated-jinja-templates_fix
WillemWybo Jun 29, 2022
2252c27
fix code style issues with autopep8
WillemWybo Jun 29, 2022
8af8201
fix code style issues with autopep8 aggressive
WillemWybo Jun 29, 2022
734f17b
fix codestyle issues with autopep8 aggressive second round
WillemWybo Jun 29, 2022
cf3a744
final code style issue, hopefully
WillemWybo Jun 29, 2022
2226954
fix pycodestyle
Jul 8, 2022
822db5e
Merge branch 'master' of https://github.com/nest/nestml into maint/up…
WillemWybo Jul 12, 2022
98c8253
Merge remote-tracking branch 'upstream/master' into maint/updated-jin…
Jul 13, 2022
25e39e8
fix incorrect merge with upstream
Jul 13, 2022
c86c851
Merge branch 'maint/updated-jinja-templates_fix' into maint/updated-j…
WillemWybo Jul 13, 2022
a0acc38
print statements in compartmental_model_test.py for debugging workflo…
WillemWybo Jul 14, 2022
ae77058
print statements in compartmental_model_test.py for debugging workflo…
WillemWybo Jul 14, 2022
fa5777d
add automatic NEST version detection and update CI
Jul 27, 2022
023cbd5
fix setup.py not copying compartmental model templates to install dir…
WillemWybo Aug 3, 2022
34b7c03
fix paths in compartmental model test
WillemWybo Aug 3, 2022
4f87f16
add additional template directories to setup.py
WillemWybo Aug 3, 2022
c31cbd0
minor codestyle fixes
WillemWybo Aug 3, 2022
f44eda8
fix compartmental model test style issue
WillemWybo Aug 3, 2022
277c51e
fix compartmental model test style issue
WillemWybo Aug 3, 2022
a45359c
fix compartmental model test style issue
WillemWybo Aug 3, 2022
92ec449
add NEST2 compatibility to nest_logarithmic_function_test
Aug 3, 2022
537493e
fix CI and tests after adding automatic NEST version check
Aug 5, 2022
4936d33
move tests that use the NEST code generator to integration tests subd…
Aug 6, 2022
78c8fb7
move tests that use the NEST code generator to integration tests subd…
Aug 6, 2022
b28f4b3
fix NEST2/NEST3 compatibility in tests
Aug 7, 2022
9cfdaa8
add LD_LIBRARY_PATH for NEST2
Aug 7, 2022
e0f9559
fix NEST2/NEST3 compatibility in tests
Aug 7, 2022
72c3678
Merge remote-tracking branch 'clinssen/nest_versions_compat' into nes…
Aug 7, 2022
f155e86
fix NEST2/NEST3 compatibility in tests
Aug 7, 2022
68c5ce6
fix NEST2/NEST3 compatibility in tests
Aug 7, 2022
3d062f3
fix NEST2/NEST3 compatibility in tests
Aug 8, 2022
56bcca1
fix CI and tests after adding automatic NEST version check
Aug 8, 2022
f104621
fix CI and tests after adding automatic NEST version check
Aug 8, 2022
79bfbe7
run Jupyter notebooks only on master branch
Aug 9, 2022
fab802c
add NEST 3.3 to CI
Aug 9, 2022
24c0d78
improve NEST version detection and compatibility
Aug 9, 2022
5f783aa
improve NEST version detection and compatibility
Aug 9, 2022
8e42a63
Merge remote-tracking branch 'origin/master' into nest_versions_compat
Aug 9, 2022
891e67b
do not use bare except
Aug 9, 2022
5f54d17
run NEST version detection in a separate process
Aug 10, 2022
3550eb4
fix syntax in GitHub actions workflow file
Aug 10, 2022
c00c6f6
fix syntax in GitHub actions workflow file
Aug 10, 2022
4993cf2
remove cron comment from GitHub Actions workflow file
Aug 15, 2022
0db4ef0
Merge remote-tracking branch 'clinssen/nest_versions_compat' into mai…
Aug 16, 2022
a155b33
Merge remote-tracking branch 'upstream/master' into maint/updated-jin…
Aug 16, 2022
33c5908
update compartmental model templates for NEST 3.3 and NEST-master com…
Aug 16, 2022
9d9a98d
Merge remote-tracking branch 'upstream/master' into maint/updated-jin…
Sep 14, 2022
9f8d76f
Merge pull request #7 from clinssen/maint/updated-jinja-templates_fix
WillemWybo Sep 14, 2022
3f7bae6
compartmental model debugging in progress
WillemWybo Sep 14, 2022
fe3fe3e
merge of upstream
WillemWybo Sep 14, 2022
edb524f
attempted fix for variable-not-found error
WillemWybo Sep 14, 2022
c099d33
fix codecheck style issues
WillemWybo Sep 14, 2022
4fbecf7
fix bug naming clash with nest built-in classess for ion channels and…
WillemWybo Sep 14, 2022
0301084
fix NEST version detection
Sep 15, 2022
a98ace9
remove multiprocessing version of call to _detect_nest_version from c…
WillemWybo Sep 15, 2022
f6d79bf
cleanup of compartmental_model_test
WillemWybo Sep 15, 2022
50ebfd4
code style issues
WillemWybo Sep 15, 2022
a3a606f
Merge remote-tracking branch 'upstream/master' into cm-post-printers
Dec 22, 2022
c7f9449
fix compartmental models code generation after printers refactor
Dec 29, 2022
75bd389
Merge pull request #8 from clinssen/cm-post-printers
WillemWybo Jan 3, 2023
9948547
std
ScipioAI Jan 4, 2023
296b98f
std
ScipioAI Jan 12, 2023
7b420f5
std
ScipioAI Jan 16, 2023
6dbf3a2
std
ScipioAI Jan 16, 2023
9bc3d1a
std
ScipioAI Jan 16, 2023
0cccbb6
Shifted synapse ode processing from nest_code_generator.py to syns_pr…
LeanderEwert Feb 2, 2023
867799b
Added gathering of specifically synapse related odes and functions. n…
LeanderEwert Feb 9, 2023
222e83c
Added performance optimization feature, checking key parameters being…
LeanderEwert Feb 14, 2023
0d5dcee
Decorator syntax added to inline functions and mechanism differentiat…
LeanderEwert Feb 28, 2023
cb3ee7a
Decorator syntax added to inline functions and mechanism differentiat…
LeanderEwert Mar 7, 2023
0624ec2
Merge remote-tracking branch 'nest-upstream/master' into origin/Leand…
LeanderEwert Mar 9, 2023
c45ac08
added decorators to odes in parser
LeanderEwert Mar 9, 2023
f9e5269
changed filepermissions and some fixed post merge problems.
LeanderEwert Mar 15, 2023
08e14ae
some fixes on concentration mechanism info collection.
LeanderEwert Apr 11, 2023
6f8bde8
fixed mechanism processing inheritance concept.
LeanderEwert Apr 12, 2023
0767a5c
First working state of concentration mechanism.
LeanderEwert Apr 18, 2023
b9cc318
All mechanism-types now integrated into the generalized collection sy…
LeanderEwert May 10, 2023
089b28f
Some commenting
LeanderEwert May 10, 2023
99b158a
Issue fixed: No longer multiple identical dependency entries collecte…
LeanderEwert May 12, 2023
cdf6929
-Jinja Templates cleaned up.
LeanderEwert May 19, 2023
9964898
-legacy code removed
LeanderEwert May 20, 2023
941e03c
- added info dictionaries to the logger.
LeanderEwert May 24, 2023
2b8c3d4
-some commenting added
LeanderEwert May 24, 2023
5aaf824
Merge remote-tracking branch 'nest-upstream/master' into origin/Leand…
LeanderEwert May 24, 2023
1bc4109
Merge remote-tracking branch 'nest-upstream/master' into origin/Leand…
LeanderEwert May 24, 2023
c8c5c12
resolved issues after merging
LeanderEwert May 24, 2023
985012e
Merge remote-tracking branch 'origin/origin/LeanderEwert' into origin…
LeanderEwert May 24, 2023
bbe041d
key-zero parameter search for concentrations.
LeanderEwert Jun 13, 2023
5eddd73
copyright-headers added.
LeanderEwert Jun 13, 2023
59a4019
cd_default.nestml fixed and gitignore changes reverted
LeanderEwert Jun 14, 2023
49f9361
reverted check_co_co parameter names in cases of renaming from node t…
LeanderEwert Jun 15, 2023
209d9fd
New neuroncurrent files added that will contain arrays of states, par…
LeanderEwert Jun 21, 2023
d1ad9e7
Deleted an unneccessary outcommented code-line which the check skript…
LeanderEwert Jun 21, 2023
bd0f5a8
Started to implement the vectorisation of the step function inner loo…
LeanderEwert Jul 7, 2023
f2665d6
Implementation of NeuronCurrents ongoing.
LeanderEwert Aug 23, 2023
4405829
Fixed codestyle errors.
LeanderEwert Aug 27, 2023
268c945
Merge remote-tracking branch 'nest-upstream/master' into origin/Leand…
LeanderEwert Aug 28, 2023
d9d23e0
Merge with master.
LeanderEwert Aug 28, 2023
b8eeb8f
Review comment adjustments.
LeanderEwert Aug 30, 2023
d77c8fc
First full vector implementation. ( untested )
LeanderEwert Sep 6, 2023
110fda5
First full vector implementation. (generated code not compiling yet)
LeanderEwert Sep 18, 2023
37ecc78
Style fixes
LeanderEwert Sep 19, 2023
b596b3e
Merge remote-tracking branch 'upstream/master' into origin/LeanderEwert
Sep 19, 2023
c604042
add compartmental models check to separate CI stage
Sep 19, 2023
593ca09
add compartmental models feature
Sep 19, 2023
bc16888
Update pynestml/cocos/co_co_cm_channel_model.py
clinssen Sep 19, 2023
8d40517
Update pynestml/cocos/co_co_cm_synapse_model.py
clinssen Sep 19, 2023
671c81e
Update pynestml/cocos/co_co_cm_concentration_model.py
clinssen Sep 19, 2023
e847153
add compartmental models check to separate CI stage
Sep 19, 2023
6266fa2
Merge remote-tracking branch 'LeanderEwert/origin/LeanderEwert' into …
Sep 19, 2023
df41f88
Fix nest typedefs
pnbabu Sep 19, 2023
84bd195
Merge remote-tracking branch 'LeanderEwert/origin/LeanderEwert' into …
pnbabu Sep 19, 2023
66271bd
Small description for collect_additional_base_infos function
LeanderEwert Sep 19, 2023
317a92a
Merge remote-tracking branch 'origin/origin/LeanderEwert' into origin…
LeanderEwert Sep 19, 2023
a4fe44f
add compartmental models feature
Sep 19, 2023
8f489b2
Merge remote-tracking branch 'LeanderEwert/origin/LeanderEwert' into …
Sep 19, 2023
d79bb40
add compartmental models feature
Sep 19, 2023
a3abd10
add compartmental models feature
Sep 19, 2023
bb2d828
add compartmental models feature
Sep 19, 2023
f4e2e02
add compartmental models feature
Sep 19, 2023
130cbb5
Clean up templates
pnbabu Sep 19, 2023
c2b7611
Fix filename in copyright header
pnbabu Sep 19, 2023
a66fb42
add compartmental models feature
Sep 19, 2023
d6d5a3b
Merge remote-tracking branch 'origin/origin/LeanderEwert' into origin…
Sep 19, 2023
9cc9be6
Completed compartmental doc.
LeanderEwert Sep 20, 2023
b454bfe
Completed compartmental doc. (fix)
LeanderEwert Sep 20, 2023
46e795a
Completed compartmental doc. (fix)
LeanderEwert Sep 20, 2023
edc4310
Completed compartmental doc. (fix)
LeanderEwert Sep 20, 2023
fa813e8
Completed compartmental doc. (fix)
LeanderEwert Sep 20, 2023
546420b
add compartmental models feature
Sep 21, 2023
6a1998d
Merge remote-tracking branch 'origin/origin/LeanderEwert' into origin…
Sep 21, 2023
bb8c343
Merge remote-tracking branch 'upstream/master' into origin/LeanderEwert
Sep 26, 2023
8f93ef1
Merge remote-tracking branch 'LeanderEwert/origin/LeanderEwert' into …
Sep 26, 2023
be660a9
fix templates path
Sep 26, 2023
de0609f
fix templates path
Sep 26, 2023
15d4f10
Merge remote-tracking branch 'upstream/master' into origin/LeanderEwert
Sep 27, 2023
83821b9
update Python version on CI
Sep 27, 2023
45a21e8
add compartmental models feature
Sep 27, 2023
1b8c5c4
fixing compile errors
LeanderEwert Sep 27, 2023
68a310a
add compartmental models feature
Sep 27, 2023
53d27cc
compiling without warnings. error: undefined symbol.
LeanderEwert Oct 4, 2023
6639e5a
corrected compartmental directives path in setup.py.
LeanderEwert Oct 10, 2023
2bf108c
Merge branch 'nest-upstream-master' into origin/LeanderEwert
LeanderEwert Oct 10, 2023
8c0c556
fixed generation issue when no synapses are defined in a model.
LeanderEwert Oct 11, 2023
007dd1a
Merge branch 'origin/LeanderEwert' into origin/LeanderEwert_vectoriza…
LeanderEwert Oct 11, 2023
db842ba
post merge with LeanderEwert
LeanderEwert Oct 11, 2023
b2e34d2
corrected directives path.
LeanderEwert Oct 12, 2023
42fc198
fixed public syntax.
LeanderEwert Oct 17, 2023
4a25ec3
undefined symbol resolved
LeanderEwert Oct 18, 2023
4ac65f8
current fail
LeanderEwert Oct 19, 2023
22b366d
running simulation but no channel activity
LeanderEwert Oct 23, 2023
386d95d
channels working
LeanderEwert Oct 25, 2023
5c0f23e
vectorization working on all mechanisms
LeanderEwert Oct 25, 2023
c210a5d
buffer size bug on spike receive
LeanderEwert Nov 6, 2023
0e39dc0
multiple synapses working.
LeanderEwert Nov 7, 2023
c2d4cdb
First working general vectorization.
LeanderEwert Jan 15, 2024
b4a9f02
First working version of the continuous input mechanism. Old continuo…
LeanderEwert Jan 24, 2024
5810177
Big Performance improvements mostly due to map to vector type-change.
LeanderEwert Feb 7, 2024
032c630
Added vectorized directives_cpp templates.
LeanderEwert Feb 19, 2024
4dc48dd
Some cleanup pre-merge, ability to record non-existing states as perm…
LeanderEwert Mar 5, 2024
59a2adb
Merge remote-tracking branch 'nest-upstream/master' into origin/Leand…
LeanderEwert Mar 5, 2024
0a5f04c
copy-right header fix.
LeanderEwert Mar 5, 2024
74b6dda
codestyle fix.
LeanderEwert Mar 5, 2024
1b85a61
fixed concmech_model_test.
LeanderEwert Mar 5, 2024
b6cb9d8
Syntax changed so that continuous inputs don't have to be provided wi…
LeanderEwert Mar 22, 2024
003fb47
Passive vectorization and unittest implemented.
LeanderEwert Apr 2, 2024
e58556b
fix copyright header
LeanderEwert Apr 3, 2024
2e293e8
codestyle fixes.
LeanderEwert Apr 3, 2024
d65eadd
codestyle fixes.
LeanderEwert Apr 3, 2024
f7ccefa
fixing I_stim continuous input syntax in test models.
LeanderEwert Apr 3, 2024
0c3c9ae
first step towards implicit euler, voltage recording problem
WillemWybo Apr 4, 2024
a9695db
fix bug where compartment voltage readout pointers were not
WillemWybo Apr 4, 2024
e7456bb
remove debug code from test
WillemWybo Apr 4, 2024
369e849
merge readout voltage fix
WillemWybo Apr 4, 2024
fd6feb0
cleanup of no longer used variables
WillemWybo Apr 4, 2024
f8e1766
increase margin in test to make it pass, a more precise version will …
WillemWybo Apr 4, 2024
b897b09
additional vectorisations
WillemWybo Apr 4, 2024
7bedd4a
rename construct_matrix_element() more appropriately and cleanup
WillemWybo Apr 4, 2024
67db6ca
extended concentration test.
LeanderEwert Apr 11, 2024
ce8b900
Revert "Syntax changed so that continuous inputs don't have to be pro…
LeanderEwert Apr 11, 2024
2e4634e
Merge pull request #1 from WillemWybo/implicit_euler
LeanderEwert Apr 11, 2024
8217d1f
common subexpression elimination implemented. Sadly no change in mode…
LeanderEwert Apr 18, 2024
630f329
SIMD loops merged
LeanderEwert Apr 23, 2024
85670d5
disabled common subexpression elimination.
LeanderEwert Apr 29, 2024
8320e07
python initialization extended to ODE vars.
LeanderEwert Apr 30, 2024
ae29f05
Independent v_comp initialization added.
LeanderEwert Apr 30, 2024
06a6d52
new initialization test.
LeanderEwert Apr 30, 2024
0883772
std::exp replaced with fastexp ieee exp approximation function.
LeanderEwert May 29, 2024
5b0de06
fastexp as codegen option.
LeanderEwert May 29, 2024
f82f3bc
fastexp as codegen option.
LeanderEwert May 29, 2024
45c3d75
compartmental stdp WIP
LeanderEwert Jun 13, 2024
917c716
Merge remote-tracking branch 'nest-upstream/master' into origin/Leand…
LeanderEwert Jun 13, 2024
ec7f3ff
copyright header fix.
LeanderEwert Jun 13, 2024
0dc482c
codestyle fixes
LeanderEwert Jun 19, 2024
8274a69
fixed ASTNeuron instance to new ASTModel
LeanderEwert Jun 19, 2024
3ad676d
further post-merge fixes
LeanderEwert Jun 19, 2024
e833364
codestyle fix.
LeanderEwert Jun 24, 2024
55ed6bc
tests fixed (continuous input types corrected)
LeanderEwert Jun 24, 2024
22b648f
compartmental test fix. Adjusted tolerance for numerical comparison a…
LeanderEwert Jun 25, 2024
1976809
ieee.h cleanup and external license included
LeanderEwert Jun 25, 2024
ecf57ec
added license for the modification of the ieee.h.
LeanderEwert Jun 25, 2024
162258d
added license for the modification of the ieee.h.
LeanderEwert Jun 25, 2024
7491882
point synapse and cm neuron generation pipeline combined
LeanderEwert Jul 2, 2024
3012090
test experiments.
LeanderEwert Jul 5, 2024
7972a3f
concmech model test fix. (disabled fastexp)
LeanderEwert Jul 8, 2024
95614c4
fastexp removed and vectorized cpp_directive jinja templates removed.
LeanderEwert Jul 11, 2024
65ab437
resolved all comments but the printer modification.
LeanderEwert Jul 15, 2024
6bc7f3b
removed debugging output from compartmental test and fixed copyright …
LeanderEwert Jul 15, 2024
1b9ef48
new vector printing [WIP]
LeanderEwert Jul 17, 2024
8eda623
new vector printing [WIP], and documentation
LeanderEwert Jul 18, 2024
80fc827
returned to the previous vector printing method >>for now<<. Fixed so…
LeanderEwert Jul 19, 2024
47b567c
Fixed and enabled new vector variable printing.
LeanderEwert Jul 31, 2024
e1ec668
small fix to last commit.
LeanderEwert Jul 31, 2024
0b3ac31
WIP
LeanderEwert Aug 7, 2024
4f027a5
Merge branch 'origin/LeanderEwert_vectorization' into origin/LeanderE…
LeanderEwert Aug 7, 2024
fd7c4e5
code compiling test WIP
LeanderEwert Aug 13, 2024
04c8ac3
code compiling test WIP
LeanderEwert Aug 13, 2024
ffb6fa0
code compiling test WIP
LeanderEwert Aug 15, 2024
3a2309b
working on prototype for purely compartmental stdp.
LeanderEwert Aug 19, 2024
1ed3aa8
Synapse info extraction WIP.
LeanderEwert Aug 27, 2024
7009941
Information collection pipeline WIP
LeanderEwert Sep 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 37 additions & 4 deletions doc/running/running_nest_compartmental.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ As an example for a HH-type channel:

All of the currents within a compartment (marked by ``@mechanism::channel``) are added up within a compartment.

For a complete example, please see `cm_default.nestml <https://github.com/nest/nestml/blob/master/tests/nest_compartmental_tests/resources/concmech.nestml>`_ and its associated unit test, `compartmental_model_test.py <https://github.com/nest/nestml/blob/master/tests/nest_compartmental_tests/concmech_model_test.py>`_.
For a complete example, please see `cm_default.nestml <https://github.com/nest/nestml/blob/master/tests/nest_compartmental_tests/resources/concmech.nestml>`_ and its associated unit test, `test__compartmental_model.py <https://github.com/nest/nestml/blob/master/tests/nest_compartmental_tests/test__concmech_model.py>`_.


Concentration description
Expand Down Expand Up @@ -111,12 +111,14 @@ As an example a description of a calcium concentration model where we pretend th

The only difference here is that the equation that is marked with the ``@mechanism::concentration`` descriptor is not an inline equation but an ODE. This is because in case of the ion-channel what we want to simulate is the current which relies on the evolution of some state variables like gating variables in case of the HH-models, and the compartment voltage. The concentration though can be more simply described by an evolving state directly.

For a complete example, please see `concmech.nestml <https://github.com/nest/nestml/blob/master/tests/nest_compartmental_tests/resources/concmech.nestml>`_ and its associated unit test, `compartmental_model_test.py <https://github.com/nest/nestml/blob/master/tests/nest_compartmental_tests/concmech_model_test.py>`_.
For a complete example, please see `concmech.nestml <https://github.com/nest/nestml/blob/master/tests/nest_compartmental_tests/resources/concmech.nestml>`_ and its associated unit test, `test__concmech_model.py <https://github.com/nest/nestml/blob/master/tests/nest_compartmental_tests/test__concmech_model.py>`_.

Synapse description
-------------------

Here synapse models are based on convolutions over a buffer of incoming spikes. This means that the equation for the current-contribution must contain a convolve() call and a description of the kernel used for that convolution is needed. The descriptor for synapses is ``@mechanism::receptor``.
Here synapse models are based on convolutions over a buffer of incoming spikes. This means that the equation for the
current-contribution must contain a convolve() call and a description of the kernel used for that convolution is needed.
The descriptor for synapses is ``@mechanism::receptor``.

.. code-block:: nestml

Expand All @@ -133,13 +135,44 @@ Here synapse models are based on convolutions over a buffer of incoming spikes.
input:
<spike_name> <- spike

For a complete example, please see `concmech.nestml <https://github.com/nest/nestml/blob/master/tests/nest_compartmental_tests/resources/concmech.nestml>`_ and its associated unit test, `compartmental_model_test.py <https://github.com/nest/nestml/blob/master/tests/nest_compartmental_tests/concmech_model_test.py>`_.
For a complete example, please see `concmech.nestml <https://github.com/nest/nestml/blob/master/tests/nest_compartmental_tests/resources/concmech.nestml>`_ and its associated unit test, `test__concmech_model.py <https://github.com/nest/nestml/blob/master/tests/nest_compartmental_tests/test__concmech_model.py>`_.

Continuous input description
----------------------------

The continuous inputs are defined by an inline with the descriptor @mechanism::continuous_input. This inline needs to
include one input of type continuous and may include any states, parameters and functions.

.. code-block:: nestml

model <neuron_name>:
equations:
inline <current_equation_name> real = \
<some equation based on state variables, parameters, membrane potential and other equation names \
and MUST contain at least one reference to a continuous input port like <continuous_name>> \
@mechanism::continuous_input

input:
<continuous_name> real <- continuous

For a complete example, please see `continuous_test.nestml <https://github.com/nest/nestml/blob/master/tests/nest_compartmental_tests/resources/continuous_test.nestml>`_ and its associated unit test, `test__continuous_input.py <https://github.com/nest/nestml/blob/master/tests/nest_compartmental_tests/test__continuous_input.py>`_.

Mechanism interdependence
-------------------------

Above examples of explicit interdependence inbetween concentration and channel models where already described. Note that it is not necessary to describe the basic interaction inherent through the contribution to the overall current of the compartment. During a simulation step all currents of channels and synapses are added up and contribute to the change of the membrane potential (v_comp) in the next timestep. Thereby one must only express a dependence explicitly if the mechanism depends on the activity of a specific channel- or synapse-type amongst multiple in a given compartment or some concentration.

Technical Notes
---------------

We have put emphasis on delivering a good performance for neurons with high spacial complexity. We utilize vectorization
therefor you should compile nest with the OpenMP flag enabled. This of course can only be utilized if your hardware
supports simd instructions in that case you can expect a performance improvement of about 3/4 of the theoretical improvement.
Let's say you have an avx2 simd instruction set available you can expect about a 3 times performance improvement as long
as your neuron has enough compartments.
We vectorize the simulation steps of all instances of the same mechanism you have defined in
your nestml model, meaning that you will get a better complexity/performance ratio the more instances of the same
mechanism are used.

See also
--------
Expand Down
2 changes: 1 addition & 1 deletion extras/convert_cm_default_to_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_replacement_patterns():
# file names
'cm_default' : '{{neuronSpecificFileNamesCmSyns[\"main\"]}}',
'cm_tree' : '{{neuronSpecificFileNamesCmSyns[\"tree\"]}}',
'cm_compartmentcurrents': '{{neuronSpecificFileNamesCmSyns[\"compartmentcurrents\"]}}',
'cm_neuroncurrents': '{{neuronSpecificFileNamesCmSyns[\"neuroncurrents\"]}}',
# class names
'CompTree' : 'CompTree{{cm_unique_suffix}}',
'Compartment' : 'Compartment{{cm_unique_suffix}}',
Expand Down
36 changes: 36 additions & 0 deletions pynestml/cocos/co_co_cm_continuous_input_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
#
# co_co_cm_continuous_input_model.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# NEST 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 NEST. If not, see <http://www.gnu.org/licenses/>.

from pynestml.cocos.co_co import CoCo
from pynestml.meta_model.ast_model import ASTModel
from pynestml.utils.continuous_input_processing import ContinuousInputProcessing


class CoCoCmContinuousInputModel(CoCo):
@classmethod
def check_co_co(cls, neuron: ASTModel):
"""
Checks if this compartmental condition applies to the handed over neuron.
If yes, it checks the presence of expected functions and declarations.
:param neuron: a single neuron instance.
:type neuron: ast_neuron
"""
return ContinuousInputProcessing.check_co_co(neuron)
4 changes: 2 additions & 2 deletions pynestml/cocos/co_co_cm_synapse_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from pynestml.cocos.co_co import CoCo
from pynestml.meta_model.ast_model import ASTModel
from pynestml.utils.synapse_processing import SynapseProcessing
from pynestml.utils.receptor_processing import ReceptorProcessing


class CoCoCmSynapseModel(CoCo):
Expand All @@ -33,4 +33,4 @@ def check_co_co(cls, model: ASTModel):
If yes, it checks the presence of expected functions and declarations.
:param model: a single neuron instance.
"""
return SynapseProcessing.check_co_co(model)
return ReceptorProcessing.check_co_co(model)
22 changes: 21 additions & 1 deletion pynestml/cocos/co_co_v_comp_exists.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
from pynestml.utils.messages import Messages
from pynestml.utils.logger import Logger, LoggingLevel

import traceback


class CoCoVCompDefined(CoCo):
"""
Expand All @@ -48,10 +50,14 @@ def check_co_co(cls, neuron: ASTModel):
If True, checks are not as rigorous. Use False where possible.
"""
from pynestml.codegeneration.nest_compartmental_code_generator import NESTCompartmentalCodeGenerator
from pynestml.codegeneration.code_generator_utils import CodeGeneratorUtils

if not FrontendConfiguration.get_target_platform().upper() == 'NEST_COMPARTMENTAL':
return

if not isinstance(neuron, ASTModel):
return

enforced_variable_name = NESTCompartmentalCodeGenerator._default_options["compartmental_variable_name"]

state_blocks = neuron.get_state_blocks()
Expand All @@ -62,6 +68,18 @@ def check_co_co(cls, neuron: ASTModel):
if isinstance(state_blocks, ASTBlockWithVariables):
state_blocks = [state_blocks]

stack = traceback.extract_stack()
formatted = ''.join(traceback.format_list(stack))
print("Traceback: \n" + formatted)
print("Neuron name: " + neuron.name)
print("State names: ")
for state_block in state_blocks:
declarations = state_block.get_declarations()
for declaration in declarations:
variables = declaration.get_variables()
for variable in variables:
variable_name = variable.get_name().lower().strip()
print(variable_name)
for state_block in state_blocks:
declarations = state_block.get_declarations()
for declaration in declarations:
Expand All @@ -72,9 +90,11 @@ def check_co_co(cls, neuron: ASTModel):
return True

cls.log_error(neuron, state_blocks[0].get_source_position(), enforced_variable_name)
breakpoint()
return False

@classmethod
def log_error(cls, neuron: ASTModel, error_position, missing_variable_name):
code, message = Messages.get_v_comp_variable_value_missing(neuron.get_name(), missing_variable_name)
Logger.log_message(error_position=error_position, node=neuron, log_level=LoggingLevel.ERROR, code=code, message=message)
Logger.log_message(error_position=error_position, node=neuron, log_level=LoggingLevel.ERROR, code=code,
message=message)
4 changes: 3 additions & 1 deletion pynestml/cocos/co_cos_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from pynestml.cocos.co_co_inline_expression_not_assigned_to import CoCoInlineExpressionNotAssignedTo
from pynestml.cocos.co_co_input_port_not_assigned_to import CoCoInputPortNotAssignedTo
from pynestml.cocos.co_co_cm_channel_model import CoCoCmChannelModel
from pynestml.cocos.co_co_cm_continuous_input_model import CoCoCmContinuousInputModel
from pynestml.cocos.co_co_convolve_cond_correctly_built import CoCoConvolveCondCorrectlyBuilt
from pynestml.cocos.co_co_convolve_has_correct_parameter import CoCoConvolveHasCorrectParameter
from pynestml.cocos.co_co_input_port_not_assigned_to import CoCoInputPortNotAssignedTo
Expand Down Expand Up @@ -148,6 +149,7 @@ def check_compartmental_model(cls, neuron: ASTModel) -> None:
CoCoCmChannelModel.check_co_co(neuron)
CoCoCmConcentrationModel.check_co_co(neuron)
CoCoCmSynapseModel.check_co_co(neuron)
CoCoCmContinuousInputModel.check_co_co(neuron)

@classmethod
def check_inline_expressions_have_rhs(cls, model: ASTModel):
Expand Down Expand Up @@ -413,7 +415,7 @@ def post_symbol_table_builder_checks(cls, model: ASTModel, after_ast_rewrite: bo
cls.check_variables_defined_before_usage(model, after_ast_rewrite)
if FrontendConfiguration.get_target_platform().upper() == 'NEST_COMPARTMENTAL':
# XXX: TODO: refactor this out; define a ``cocos_from_target_name()`` in the frontend instead.
cls.check_v_comp_requirement(model)
# cls.check_v_comp_requirement(model)
cls.check_compartmental_model(model)
cls.check_inline_expressions_have_rhs(model)
cls.check_inline_has_max_one_lhs(model)
Expand Down
1 change: 1 addition & 0 deletions pynestml/codegeneration/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,5 @@ def set_options(self, options: Mapping[str, Any]) -> Mapping[str, Any]:
ret = super().set_options(options)
ret.pop("redirect_build_output", None)
ret.pop("build_output_dir", None)
ret.pop("fastexp", None)
return ret
1 change: 0 additions & 1 deletion pynestml/codegeneration/nest_code_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,6 @@ def _get_neuron_model_namespace(self, neuron: ASTModel) -> Dict:
:return: a map from name to functionality.
"""
namespace = self._get_model_namespace(neuron)

if "paired_synapse" in dir(neuron):
namespace["extra_on_emit_spike_stmts_from_synapse"] = neuron.extra_on_emit_spike_stmts_from_synapse
namespace["paired_synapse"] = neuron.paired_synapse.get_name()
Expand Down
Loading