Skip to content

Commit 801ce19

Browse files
ramcdougalrsakai10
andauthored
unified docs: one file for all languages (#3466)
* restructure toward unified docs * removed n. reference in HOC for ions and elsewhere * another n. fix * optimization, compilation options, and main progref link * C++ snippet in compilationoptions wasn't labeled as such * removed :hoc: * unified rxd docs, export no longer requires a special import Also some minor cleanups to export code * change all `:hoc:` to : * rst parsing is now tab-aware * doc handling fixes: whitespace, functions, tests * typo fix * h->n in HOC rxd example --------- Co-authored-by: Rie Sakai <riemy1689@gmail.com>
1 parent 199f14f commit 801ce19

378 files changed

Lines changed: 60147 additions & 67576 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ if(NRN_ENABLE_PYTHON)
952952
help_data_dat
953953
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/lib/python/neuron
954954
COMMAND ${NRN_DEFAULT_PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/docs/parse_rst.py
955-
${PROJECT_SOURCE_DIR}/docs/python ${PROJECT_BINARY_DIR}/lib/python/neuron/help_data.dat
955+
${PROJECT_SOURCE_DIR}/docs/progref ${PROJECT_BINARY_DIR}/lib/python/neuron/help_data.dat
956956
COMMENT "Generating help_data.dat"
957957
VERBATIM)
958958
add_dependencies(nrniv_lib help_data_dat)

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
# -- Project information -----------------------------------------------------
2626

2727
project = "NEURON"
28-
copyright = "2022, Duke, Yale and the Blue Brain Project"
28+
copyright = "2025, Duke, Yale and the Blue Brain Project"
2929
author = "Michael Hines"
3030

3131
# -- General configuration ---------------------------------------------------

docs/courses/artificial_cells_neuron.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ NEURON has four built-in point process classes which can be used to construct ar
1616
`NetStim <https://nrn.readthedocs.io/en/latest/python/modelspec/programmatic/mechanisms/mech.html?highlight=netstim#NetStim>`_ produces a user-specified train of one or more output events, and can also be triggered by input events
1717

1818
2.
19-
:hoc:class:`IntFire1`, which acts like a leaky integrator driven by delta function inputs. That is, the state variable m decays exponentially toward 0.
19+
:class:`IntFire1`, which acts like a leaky integrator driven by delta function inputs. That is, the state variable m decays exponentially toward 0.
2020
Arrival of an event with weight w causes an abrupt change in m.
2121
If m exceeds 1, an output event is generated and the cell enters a refractory period during which it ignores further inputs. At the end of the refractory period, m is reset to 0 and the cell becomes responsive to new inputs.
2222

2323
3.
24-
:hoc:class:`IntFire2`, a leaky integrator with time constant taum driven by a total current that is the sum of
24+
:class:`IntFire2`, a leaky integrator with time constant taum driven by a total current that is the sum of
2525

2626
{ a user-settable constant "bias" current }
2727

@@ -31,7 +31,7 @@ NEURON has four built-in point process classes which can be used to construct ar
3131

3232
Net synaptic current decays toward 0 with time constant taus, where taus > taum (synaptic current decays slowly compared to the rate at which "membrane potential" m equilibrates). When an input event with weight w arrives, the net synaptic current changes abruptly by the amount w.
3333

34-
4. :hoc:class:`IntFire4`, with fast excitation current (rises abruptly, decays exponentially) and slower alpha function like inhibition current that is integrated by even slower membrane.
34+
4. :class:`IntFire4`, with fast excitation current (rises abruptly, decays exponentially) and slower alpha function like inhibition current that is integrated by even slower membrane.
3535

3636
NEURON requires that all point processes be located in a section. To meet this (in this context, conceptually irrelevant) requirement, the Network Builder tool locates each point process of its instantiated artificial cells in the dummy section called ``acell_home_``
3737

docs/courses/bulletin_board_walkthrough.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ loads the cell's source code
6060
Instrumentation
6161
>>>>>>>>>>>>>>>
6262

63-
stimulus--attaches an :hoc:class:`IClamp` to ``soma(0.5)``
63+
stimulus--attaches an :class:`IClamp` to ``soma(0.5)``
6464

65-
data recording and analysis--uses a :hoc:class:`NetCon` to record the times at which spikes reach ``dend(1)``
65+
data recording and analysis--uses a :class:`NetCon` to record the times at which spikes reach ``dend(1)``
6666

6767
get_frequency(spvec) verifies that enough spikes have occurred, then calculates freq from the last NINVL=10 recorded ISIs.
6868

docs/courses/hoc_exercises.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ Must declare an object reference (=object variable) before making an object
195195

196196
Objref: manipulate references to objects, not the objects themselves
197197

198-
- often names are chosen that make it easy to remember what an object reference is to be used for (eg g for a :hoc:class:`Graph` or vec for a :hoc:class:`Vector`) but it's important to remember that these are just for convenience and that any object reference can be used to point to any kind of object
198+
- often names are chosen that make it easy to remember what an object reference is to be used for (eg g for a :class:`Graph` or vec for a :class:`Vector`) but it's important to remember that these are just for convenience and that any object reference can be used to point to any kind of object
199199

200200
Objects include vectors, graphs, lists, ...
201201
###########################################
@@ -261,7 +261,7 @@ Lists are useful for maintaining pointers to objects so that they are maintained
261261

262262
1. Make vec point to a new vector. Print out and record its identity (``print vec``). Now print using the object name (ie print Vector[#] with the right #). This confirms that the object exists. Destroy the object by reinitializing the vec reference. Now try to print using the object name. What does it say.
263263

264-
2. As in Exercise 1: make vec point to a new :hoc:class:`Vector` and use print to find the vector name. Make XO a reference to a new list. Append the vector to the list: {XO.append(vec). Now dereference vec as in Exercise 1. Print out the object by name and confirm that it still exists. Even though the original objref is gone, it is still pointed to by the list.
264+
2. As in Exercise 1: make vec point to a new :class:`Vector` and use print to find the vector name. Make XO a reference to a new list. Append the vector to the list: {XO.append(vec). Now dereference vec as in Exercise 1. Print out the object by name and confirm that it still exists. Even though the original objref is gone, it is still pointed to by the list.
265265

266266
3. Identify the vector on the list: (``print XO.object(0)``). Remove the vector from the list (``print XO.remove(0)``). Confirm that this vector no longer exists.
267267

@@ -423,12 +423,12 @@ Graph
423423

424424
.. seealso::
425425

426-
:hoc:class:`Graph`
426+
:class:`Graph`
427427

428428
Exercises
429429
#########
430430

431-
1. write ``proc`` that draws a colored line ($1) from (0, 0) to given coordinate ($2, $3) assume g is a :hoc:class:`Graph` object
431+
1. write ``proc`` that draws a colored line ($1) from (0, 0) to given coordinate ($2, $3) assume g is a :class:`Graph` object
432432

433433
2. write a ``proc`` that puts up two new graphs
434434

@@ -467,15 +467,15 @@ Vector
467467

468468
.. seealso::
469469

470-
:hoc:class:`Vector`
470+
:class:`Vector`
471471

472472
Exercises
473473
#########
474474

475475
1.
476476
Write a ``proc`` to make ``$o1`` vec elements the product of $o2*$o3 elements
477477

478-
(Use :hoc:meth:`Vector.resize` to get ``$o1`` to right size; generate error if sizes wrong e.g. ``if ($o2.size!=$o3.size) { print "ERROR: wrong sizes" return }``)
478+
(Use :meth:`Vector.resize` to get ``$o1`` to right size; generate error if sizes wrong e.g. ``if ($o2.size!=$o3.size) { print "ERROR: wrong sizes" return }``)
479479

480480
2.
481481
Graph vector values: ``vec.line(g, 1)`` or ``vec.mark(g, 1)``
@@ -487,7 +487,7 @@ Exercises
487487
4.
488488
Write a ``proc`` to multiply the elements of a vector by sequential values from ``1`` to ``size-1``
489489

490-
Hint: use :hoc:meth:`vec.resize <Vector.resize>`, :hoc:meth:`vec.indgen <Vector.indgen>`, :hoc:meth:`vec.mul <Vector.mul>`
490+
Hint: use :meth:`vec.resize <Vector.resize>`, :meth:`vec.indgen <Vector.indgen>`, :meth:`vec.mul <Vector.mul>`
491491

492492
File
493493
~~~~
@@ -517,7 +517,7 @@ File
517517

518518
.. seealso::
519519

520-
:hoc:class:`File`
520+
:class:`File`
521521

522522
Exercises
523523
#########
@@ -554,7 +554,7 @@ List
554554

555555
.. seealso::
556556

557-
:hoc:class:`List`
557+
:class:`List`
558558

559559
Exercises
560560
#########
@@ -621,7 +621,7 @@ Recording the simulation
621621
622622
.. seealso::
623623

624-
:hoc:meth:`Vector.record`
624+
:meth:`Vector.record`
625625

626626
Graphing and analyzing data
627627
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -669,5 +669,5 @@ Roll your own GUI
669669
Exercise
670670
########
671671

672-
1. put up panel to run sim and display (in an :hoc:func:`xvalue`) the average frequency
672+
1. put up panel to run sim and display (in an :func:`xvalue`) the average frequency
673673

docs/courses/hopfield_brody_network_in_python.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Although this is a minimal model, learning the ropes is still difficult. Therefo
99

1010
As you know, NEURON is optimized to handle the complex channel and compartment simulations that have been omitted from this exercise. The interested student might wish to convert this network into a network of spiking cells with realistic inhibitory interactions or a hybrid network with both realistic and artificial cells. Such an extended exercise would more clearly demonstrate NEURON's advantages for performing network simulations.
1111

12-
Standard intfire implementation (eg :hoc:class:`IntFire1` from ``intfire1.mod``))
12+
Standard intfire implementation (eg :class:`IntFire1` from ``intfire1.mod``))
1313
---------------------
1414

1515
Individual units are integrate-and-fire neurons.

docs/courses/network_ready_cells_from_the_cellb.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Use the "Weights" button to pop up a NetEdgeGUI panel and enter the following we
163163
Simulation
164164
++++++++++
165165

166-
In the NetGUI window, press the "Create" button. The :hoc:func:`topology()` statement should produce
166+
In the NetGUI window, press the "Create" button. The :func:`topology()` statement should produce
167167

168168
.. code::
169169

docs/guide/faq.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,12 @@ pulsedistrib also contains :download:`data/ipulse3.mod`, :download:`data/ipulse3
293293
I want a current clamp that will generate a pulse when I send it an event, or that I can use to produce pulses at precalculated times.
294294
-----------------------
295295

296-
Then get `pulsedistrib.zip <http://www.neuron.yale.edu/neuron/static/docs/repstim/pulsedistrib.zip>`_, and unzip it. Inside the pulsedistrib subdirectory you'll find :download:`data/ipulse3.mod`, :download:`data/ipulse3rig.ses`, and :download:`data/test_3.hoc` (and some other files that pertain to the previous question). :download:`data/ipulse3.mod` contains the NMODL code for a current clamp that produces a current pulse when it receives an input event. :download:`data/test_3.hoc` is a simple demo of the Ipulse3 mechanism, and :download:`data/ipulse3rig.ses` is used by :download:`data/test_3.hoc` to create the GUI for a demo of Ipulse3. It uses a :hoc:class:`NetStim` to generate the events that drive the Ipulse3. If you want to drive an Ipulse3 with recorded or precomputed event times, use the VecStim class as described under the topic `Driving a synapse with recorded or precomputed spike events <https://www.neuron.yale.edu/phpBB/viewtopic.php?f=28&t=2117>`_ in the "Hot tips" area of the `NEURON Forum <https://www.neuron.yale.edu/phpBB/>`_.
296+
Then get `pulsedistrib.zip <http://www.neuron.yale.edu/neuron/static/docs/repstim/pulsedistrib.zip>`_, and unzip it. Inside the pulsedistrib subdirectory you'll find :download:`data/ipulse3.mod`, :download:`data/ipulse3rig.ses`, and :download:`data/test_3.hoc` (and some other files that pertain to the previous question). :download:`data/ipulse3.mod` contains the NMODL code for a current clamp that produces a current pulse when it receives an input event. :download:`data/test_3.hoc` is a simple demo of the Ipulse3 mechanism, and :download:`data/ipulse3rig.ses` is used by :download:`data/test_3.hoc` to create the GUI for a demo of Ipulse3. It uses a :class:`NetStim` to generate the events that drive the Ipulse3. If you want to drive an Ipulse3 with recorded or precomputed event times, use the VecStim class as described under the topic `Driving a synapse with recorded or precomputed spike events <https://www.neuron.yale.edu/phpBB/viewtopic.php?f=28&t=2117>`_ in the "Hot tips" area of the `NEURON Forum <https://www.neuron.yale.edu/phpBB/>`_.
297297

298298
I have a set of recorded or calculated spike times. How can I use these to drive a postsynaptic mechanism?
299299
------------------------
300300

301-
Assuming that your synaptic mechanism has a ``NET_RECEIVE`` block, so that it is driven by events delivered by a :hoc:class:`NetCon`, I can think of two ways this might be done. Which one to use depends on how many calculated spike times you are dealing with.
301+
Assuming that your synaptic mechanism has a ``NET_RECEIVE`` block, so that it is driven by events delivered by a :class:`NetCon`, I can think of two ways this might be done. Which one to use depends on how many calculated spike times you are dealing with.
302302

303303
If you only have a "few" spikes (up to a few dozen), you could just dump them into the spike queue at the onset of the simulation. Here's how:
304304

docs/guide/hoc_chapter_11_old_reference.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ When NEURON is installed, four programs are constructed from the combinations of
3131

3232
**ivoc**
3333

34-
OC with C++ classes and graphical interface (which is written in C++). This is the best starting place for building non-neural applications. These C++ classes are implemented in :file:`ivoc/SRC`. The files here are of general use apart from the neuron simulation domain and generally implement the graphical interface, eg. :hoc:class:`Graph`, :hoc:func:`xpanel`, :hoc:class:`VBox`, etc. However the :hoc:class:`File`, :hoc:class:`List`, :hoc:class:`Vector`, and :hoc:class:`Random` class are very useful even if no window manager is present.
34+
OC with C++ classes and graphical interface (which is written in C++). This is the best starting place for building non-neural applications. These C++ classes are implemented in :file:`ivoc/SRC`. The files here are of general use apart from the neuron simulation domain and generally implement the graphical interface, eg. :class:`Graph`, :func:`xpanel`, :class:`VBox`, etc. However the :class:`File`, :class:`List`, :class:`Vector`, and :class:`Random` class are very useful even if no window manager is present.
3535

3636
**nrniv**
3737

@@ -360,7 +360,7 @@ Names introduced by nrnoc
360360
VClamp SVClamp IClamp AlphaSynapse
361361
APCount
362362
363-
Missing from the above list are the built-in object classes such as :hoc:class:`List`, :hoc:class:`Graph`, :hoc:class:`HBox`, :hoc:class:`File`, :hoc:class:`Deck`, :hoc:class:`Random`, :hoc:class:`Vector` and some new functions such as :hoc:class:`fit\_praxis`, :hoc:class:`xmenu`, :hoc:class:`xbutton`, etc, as well as neuron specific classes such as :hoc:class:`Shape`, :hoc:class:`SectionList`, etc. The help files in :hoc:class:`NEURONHOME/lib/help` are kept up to date but this file tends to lag behind the current version.
363+
Missing from the above list are the built-in object classes such as :class:`List`, :class:`Graph`, :class:`HBox`, :class:`File`, :class:`Deck`, :class:`Random`, :class:`Vector` and some new functions such as :class:`fit\_praxis`, :class:`xmenu`, :class:`xbutton`, etc, as well as neuron specific classes such as :class:`Shape`, :class:`SectionList`, etc. The help files in :class:`NEURONHOME/lib/help` are kept up to date but this file tends to lag behind the current version.
364364

365365
Variables
366366
---------
@@ -612,7 +612,7 @@ As a trivial example of a function definition, consider:
612612
return $1 * $1
613613
}
614614
615-
This defines the function :hoc:class:`f(arg1)` which returns the square of its argument. User defined functions can be used in any expression.
615+
This defines the function :class:`f(arg1)` which returns the square of its argument. User defined functions can be used in any expression.
616616

617617
Functions can be called recursively. For example, the factorial function, can be defined as
618618

docs/guide/optimization2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ Then we write our own custom ``init()`` procedure that uses a forall loop to giv
328328
329329
To simplify future code maintenance, we probably should put both of these code fragments into a single file called :file:`params.hoc`.
330330

331-
To make use of :file:`params.hoc`, we have to add a new :hoc:func:`load_file` statement to :file:`init_iclampopt.hoc`. The proxy variables have to exist before the MRF can use them, so :file:`params.hoc` must be loaded before :file:`iclampfit.ses`. Here's the new :file:`init_iclampopt.hoc` :
331+
To make use of :file:`params.hoc`, we have to add a new :func:`load_file` statement to :file:`init_iclampopt.hoc`. The proxy variables have to exist before the MRF can use them, so :file:`params.hoc` must be loaded before :file:`iclampfit.ses`. Here's the new :file:`init_iclampopt.hoc` :
332332

333333
.. code::
334334
hoc

0 commit comments

Comments
 (0)