Skip to content

LINEAR NONLINEAR LAG nmodl examples#2037

Merged
nrnhines merged 15 commits into
masterfrom
hines/examples-nmodl
Nov 19, 2022
Merged

LINEAR NONLINEAR LAG nmodl examples#2037
nrnhines merged 15 commits into
masterfrom
hines/examples-nmodl

Conversation

@nrnhines

@nrnhines nrnhines commented Oct 24, 2022

Copy link
Copy Markdown
Member

LINEAR example is somewhat useful in that it implements a spine resistance between synapse and dendrite, but no spine capacitance. NONLINEAR and LAG examples don't have any realistic value but do illustrate the syntax.

@nrnhines nrnhines marked this pull request as draft October 24, 2022 15:17
@codecov-commenter

codecov-commenter commented Oct 24, 2022

Copy link
Copy Markdown

Codecov Report

Merging #2037 (9a4f017) into master (fac194c) will increase coverage by 0.28%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #2037      +/-   ##
==========================================
+ Coverage   48.96%   49.24%   +0.28%     
==========================================
  Files         520      520              
  Lines      115736   115736              
==========================================
+ Hits        56667    56994     +327     
+ Misses      59069    58742     -327     
Impacted Files Coverage Δ
src/ivoc/ivocrand.cpp 52.59% <0.00%> (ø)
src/oc/functabl.cpp 98.79% <ø> (+48.19%) ⬆️
src/nrnpython/nrnpy_hoc.cpp 69.47% <0.00%> (+0.15%) ⬆️
src/ivoc/ocmatrix.cpp 23.83% <0.00%> (+0.87%) ⬆️
src/nmodl/solve.cpp 71.04% <0.00%> (+4.07%) ⬆️
src/nmodl/parsact.cpp 87.84% <0.00%> (+4.17%) ⬆️
src/scopmath/getmem.c 67.44% <0.00%> (+13.95%) ⬆️
src/nmodl/simultan.cpp 84.78% <0.00%> (+14.67%) ⬆️
src/scopmath/newton.c 58.76% <0.00%> (+58.76%) ⬆️
... and 3 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@azure-pipelines

Copy link
Copy Markdown

✔️ e27da32 -> Azure artifacts URL

@azure-pipelines

Copy link
Copy Markdown

✔️ dd10bda -> Azure artifacts URL

@azure-pipelines

Copy link
Copy Markdown

✔️ 4c83468 -> Azure artifacts URL

@azure-pipelines

Copy link
Copy Markdown

✔️ ce25ac7 -> Azure artifacts URL

@nrnhines nrnhines marked this pull request as ready for review October 28, 2022 10:02
@azure-pipelines

Copy link
Copy Markdown

✔️ 064ab21 -> Azure artifacts URL

@nrnhines nrnhines changed the title LINEAR resistive spine LINEAR NONLINEAR LAG nmodl examples Nov 1, 2022
@azure-pipelines

Copy link
Copy Markdown

✔️ 1e7f326 -> Azure artifacts URL

@alexsavulescu alexsavulescu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nrnhines

nrnhines commented Nov 5, 2022

Copy link
Copy Markdown
Member Author

@alkino 9602b9b adds a FUNCTION_TABLE test to this PR.

@azure-pipelines

Copy link
Copy Markdown

✔️ 9602b9b -> Azure artifacts URL

@alkino

alkino commented Nov 7, 2022

Copy link
Copy Markdown
Member

Maybe we can add example for a constant function table, and one with only 1 arg, and 2 runtime hoc vectors?

@nrnhines

nrnhines commented Nov 7, 2022

Copy link
Copy Markdown
Member Author

Maybe we can add example for a constant function table, and one with only 1 arg, and 2 runtime hoc vectors?

I'll do that.

@bbpbuildbot

Copy link
Copy Markdown
Collaborator

@bbpbuildbot

Copy link
Copy Markdown
Collaborator

@azure-pipelines

Copy link
Copy Markdown

✔️ 4a66d11 -> Azure artifacts URL

Comment thread share/examples/nrniv/nmodl/cagkftab.py
Comment thread share/examples/nrniv/nmodl/cagkftab.py
@bbpbuildbot

Copy link
Copy Markdown
Collaborator

Logfiles from GitLab pipeline #83385 (:no_entry:) have been uploaded here!

Status and direct links:

@azure-pipelines

Copy link
Copy Markdown

✔️ a442c95 -> Azure artifacts URL

@bbpbuildbot

Copy link
Copy Markdown
Collaborator

Logfiles from GitLab pipeline #83588 (:no_entry:) have been uploaded here!

Status and direct links:

@azure-pipelines

Copy link
Copy Markdown

✔️ 9bfd8b0 -> Azure artifacts URL

@bbpbuildbot

Copy link
Copy Markdown
Collaborator

Logfiles from GitLab pipeline #84315 (:white_check_mark:) have been uploaded here!

Status and direct links:

@azure-pipelines

Copy link
Copy Markdown

✔️ 9a4f017 -> Azure artifacts URL

@iomaganaris iomaganaris left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Greatly appreciated PR with lots of examples and tests related to these NMODL features
I just have one suggestion. Maybe the expsynspine.ses could be turned into a python script so it's easier to convert it to a proper test tested using pytest?

@nrnhines

Copy link
Copy Markdown
Member Author

I just have one suggestion. Maybe the expsynspine.ses could be turned into a python script so it's easier to convert it to a proper test tested using pytest?

I can do that in the sense of replacing the last line in expysynspine.py with

h(r'''
// the contents of expsynspine.ses
''')

but I'm not sure that's what you mean. I.e is it beneficial to avoid extra files read by a test executed by pytest?
Also, until there is a way for pytest to execute a a bunch of test_foo.py files one at a time with separate invocations of a clean from neuron import h the test authors need to do extra work in cleaning up after each test, and if HOC variables are used, the HOC namespace gets more and more polluted. For now it seemed easiest to just run each mod test with a separate invocation of nrniv.

@iomaganaris

Copy link
Copy Markdown
Member

I just have one suggestion. Maybe the expsynspine.ses could be turned into a python script so it's easier to convert it to a proper test tested using pytest?

I can do that in the sense of replacing the last line in expysynspine.py with

h(r'''
// the contents of expsynspine.ses
''')

but I'm not sure that's what you mean. I.e is it beneficial to avoid extra files read by a test executed by pytest? Also, until there is a way for pytest to execute a a bunch of test_foo.py files one at a time with separate invocations of a clean from neuron import h the test authors need to do extra work in cleaning up after each test, and if HOC variables are used, the HOC namespace gets more and more polluted. For now it seemed easiest to just run each mod test with a separate invocation of nrniv.

I agree with what you said and I came across that before. What I meant was instead of the .ses file to run the same thing in python so that we can add asserts of certain values to check the the test is running correctly. If I understood correctly with just the .ses we can only check the the simulation is running without error, right?

@nrnhines

Copy link
Copy Markdown
Member Author

I agree with what you said and I came across that before. What I meant was instead of the .ses file to run the same thing in python so that we can add asserts of certain values to check the the test is running correctly. If I understood correctly with just the .ses we can only check the the simulation is running without error, right?

Ok. I don't think the ses file hurts in this case as it gives a visual indication of how things look. It will be no problem for
expsynspine.py to subsequently add a test_run() (although pytest is not used for any of the tests in this folder) to do its own run with a few judiciously chosen Vector.record and compare the SHA hash of those to a "standard".

@iomaganaris

Copy link
Copy Markdown
Member

Ok. I don't think the ses file hurts in this case as it gives a visual indication of how things look.

Yes, I agree.

(although pytest is not used for any of the tests in this folder)

I had the same impretion however I see that every python file in this directory gets tested when we run ctest and the NRN_ENABLE_TESTS=ON. For example check the output of ctest -R example_nmodl

@nrnhines

Copy link
Copy Markdown
Member Author

I had the same impretion however I see that every python file in this directory gets tested when we run ctest and the NRN_ENABLE_TESTS=ON. For example check the output of ctest -R example_nmodl

Correct, but they are not run with pytest. Each one is executed as python foo.pyand the exit value is checked.

@nrnhines nrnhines merged commit 27ae3e5 into master Nov 19, 2022
@nrnhines nrnhines deleted the hines/examples-nmodl branch November 19, 2022 19:46
@olupton olupton mentioned this pull request Nov 22, 2022
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants