noteworthy have to do with Python.
Changes that affect Python
All communication with hoc from Python is now accomplished uniformly via the neuron.h object. In other words, do this first
Code: Select all
import neuron h = neuron.h
h.Section() returns new section
h.cas() returns currently accessed section
h.allsec() is an iterator over all sections
Python allows use of a nrn.Segment object as the argument to a PointProcess constructor or loc function. That is,
is an alternative to
IClamp(x, sec = section).
Also, section(0.5).sec is the section, and section(0.5).x is the arc location value 0.5.
The following new Vector functions are much (> 50 times !) faster than a Python loop over the elements:
- Vector.from_python(source) fills the Vector with doubles from a Python list or NumPy 1-d array. The Vector is resized and returned.
- Vector.to_python() returns a Python list of doubles.
- Vector.to_python(target) fills the target with doubles from the hoc Vector and returns the target object. Note that if the target is a NumPy 1-d array it must already be sized the same as the Vector.
CellBuild.cexport() is public and can be used from hoc with an argument of 1 (or 0) to force (or prevent) writing the cell info to the simulation instance.
Vector.play in continuous mode uses linear extrapolation of the last two time points when a value is requested outside the time domain of the Vector. This allows more efficient variable time step approach to a discontinuity, as it keeps the first derivative continuous when cvode asks for a value past the next discontinuity (the discontinuity event will cause a retreat to the proper time).