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

Document using NEURON_HOME #194

Merged
merged 2 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion source/Userdocs/IzhikevichNetworkExample.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions source/Userdocs/MultiCompartmentOLMexample.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions source/Userdocs/Software/Tools/NEURON.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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>`.
Loading