diff --git a/source/Userdocs/IzhikevichNetworkExample.md b/source/Userdocs/IzhikevichNetworkExample.md index dabdcc2e..469c2533 100644 --- a/source/Userdocs/IzhikevichNetworkExample.md +++ b/source/Userdocs/IzhikevichNetworkExample.md @@ -12,7 +12,10 @@ We will create a small network of cells, simulate this network, and generate a p Spike times of neurons in 2 populations recorded from the simulation. ``` -The Python script used to create the model, simulate it, and generate this plot is below: +The Python script used to create the model, simulate it, and generate this plot is below. +Please note that this example uses the {ref}`NEURON <userdocs:neuron>` simulator to simulate the model. +Please ensure that the `NEURON_HOME` environment variable is correctly set as noted {ref}`here <userdocs:neuron:envvar>`. + ```{literalinclude} ./NML2_examples/izhikevich-network.py ---- language: python diff --git a/source/Userdocs/MultiCompartmentOLMexample.md b/source/Userdocs/MultiCompartmentOLMexample.md index c539cd1c..47c7a8e3 100644 --- a/source/Userdocs/MultiCompartmentOLMexample.md +++ b/source/Userdocs/MultiCompartmentOLMexample.md @@ -394,6 +394,9 @@ Level 10 network graph generated by pynml ``` ## Simulating the model +Please note that this example uses the {ref}`NEURON <userdocs:neuron>` simulator to simulate the model. +Please ensure that the `NEURON_HOME` environment variable is correctly set as noted {ref}`here <userdocs:neuron:envvar>`. + Now that we have declared and inspected our network model and all its components, we can proceed to simulate it. We do this in the `main` function: ```{literalinclude} ./NML2_examples/olm-example.py diff --git a/source/Userdocs/Software/Tools/NEURON.md b/source/Userdocs/Software/Tools/NEURON.md index 585267f0..87d1f705 100644 --- a/source/Userdocs/Software/Tools/NEURON.md +++ b/source/Userdocs/Software/Tools/NEURON.md @@ -5,6 +5,7 @@ [NEURON](http://www.neuron.yale.edu/neuron) is a widely used simulation environment and is one of the main target platforms for a standard facilitating exchange of neuronal models. +(userdocs:neuron:simulating)= ## Simulating NeuroML models in NEURON {ref}`jNeuroML <jneuroml>` or {ref}`pyNeuroML <pyNeuroML>` can be used to convert NeuroML2/LEMS models to NEURON. This involves pointing at a {ref}`LEMS Simulation file <userdocs:lemssimulation>` describing what to simulate, and using the `-neuron` option: @@ -32,6 +33,28 @@ from pyneuroml.pynml import run_lems_with_jneuroml_neuron run_lems_with_jneuroml_neuron(lems_file_name) ``` +(userdocs:neuron:envvar)= +## Setting the NEURON_HOME environment variable + +Since it is possible to install multiple versions of NEURON in different places, the NeuroML tools need to be told where the NEURON tools are. +To do this, they look at the `NEURON_HOME` environment variable. +This needs to hold the path to where the binary (`bin`) folder holding the NEURON tools such as `nrniv` are located. +On Linux like systems, one can use `which` to find these tools and set the variable: + +``` {code-block} bash +$ which nrniv +~/.local/share/virtualenvs/neuroml-311-dev/bin/nrniv + +$ export NEURON_HOME="~/.local/share/virtualenvs/neuroml-311-dev/" +``` + +One can combine these commands together also: + +``` {code-block} bash +$ export NEURON_HOME="$(dirname $(dirname $(which nrniv)))" +``` + +(userdocs:neuron:neuroconstruct)= ## Using neuroConstruct NEURON simulations can also be generated from NeuroML model components by {ref}`neuroConstruct <userdocs:supporting:apps:neuroconstruct>`, but most of this functionality is related to {ref}`NeuroML v1 <userdocs:neuromlv1>`.