NEURON 9.0
NEURON 9.0 marks a major milestone with significant under-the-hood updates. This release features a redesign of internal data structures using the Structure-Of-Arrays (SoA) memory layout, replacement of pointers by DataHandles that are automatically updated when internal memory layout changes, migration of the codebase and translation of MOD files to C++, and the introduction of random number generator construct natively in the NMODL (and legacy but still default nocmodl) language. Additionally, many legacy NMODL constructs have been removed, and legacy code and libraries have been replaced with modern alternatives like Eigen, ensuring improved performance and maintainability.
What follows are a selection of the ~1500 pull request squash/merge commits to the master branch since the start of the 9.0a tag on 17-07-2023
What's New
- Use of SoA memory layout for internal data structures (#2027, #2381, #2712)
This is a prerequisite for adopting CoreNEURON GPU functionality natively into NEURON. - Replace pointers with DataHandles. DataHandles pointing to RANGE variables always point to the correct value when memory is permuted or reallocated.
- Support for random number generator language construct (
RANDOM) in NMODL (#2627) - Replace pthread-based threading implementation with
std::thread(#1859) - Introduce meaningful Python types: HOC classes associated with Python types (#1858)
- Formalization of C API for NEURON (first version) (#2357, #3557)
- Introduce nanobind to gradually replace C Python API usage (#2545)
- Requires C++17 compiler and
flex >= 2.6(#1893) - CoreNEURON repository is merged into NEURON (#2055)
- CoreNEURON report extensions (#3507, #3542)
- Modern implementation of NMODL (eventually to replace the nocmodl MOD file translator) is merged into NEURON (#3333)
- Support for
numpy>=2added (#3040) - Replace legacy Meschach source copy with Eigen library (#2470)
Breaking Changes
- MOD files are compiled as C++ instead of C (see migration guide for VERBATIM blocks)
- API changes in the functions related to random numbers, see #2618
- Restored usage of TABLE statement in hh.mod, results are now same as 8.0.2 (see #1764)
- NMODL: Disallow use of ion variable in the
CONSTANTblock (#1955) - NMODL: Disallow declaring variables and functions with the same name (#1992)
- Usage of Eigen library could introduce floating point differences, but they are very small, validated and can be ignored
Removal / Deprecation
- Removed HOC function parent_node (Issue 3571) (#3576)
- Removed usage of legacy OS X carbon libraries (#1869)
- Removed legacy LINDA code and Java bindings (#1919, #1937)
- Removed unused NMODL methods:
adams,heun,clsoda,seidel,simplex,gear(#2032) - Removed support for Python 3.7 and 3.8 (#2194, #3108)
- Removed support for legacy units and dynamic units selection (#2539)
- Removed unused NEMO simulator compatibility (#3035)
- Removed checkpoint feature (
h.checkpoint()), superseded bySaveState(#3092) - Removed legacy
Random.MLCGandRandom.ACGrandom number generators (#3189, #3190) - Removed support for mod2c transpiler for CoreNEURON (#2247)
- Removed unused NMODL constructs:
PUTQ,GETQ,RESET,MATCH,TERMINAL,SECTION,
IFERROR,MODEL_LEVEL,PLOT,SENS, etc (#1956, #1974, #1975, #2001, #2004, #2005) - Removed
__MWERKS__(CodeWarrior compiler) related code (#2655) - Removed obsolete uxnrnbbs code (#2203)
- Removed old tqueue implementations (#2225, #2740)
- Removed unused RxD
code_matrix_to_rxd_sparse(#3547) Py_NoSiteFlagis deprecated for site_import (#3286)
Bug Fixes
- Fix segfault from
unref hoc_obj, see #1857 (#1917) - Fix bug in rxd reactions involving rxd parameters (#1933)
- Fix CoreNEURON bug when checkpointing
VecPlayinstances (#2148) - Fix nocmodl bug with unused
STATE+COMPARTMENTvariable inKINETICblock (#2210) - Fix for dynamic ECS diffusion characteristics (#2229)
- Various fixes for compatibility with newer NVHPC compiler releases (#2239, #2591)
- Fix Windows and Mac crash on multiline HOC statements input from terminal (#2258)
- Fix for
Vector.max_ind(#2251) - Fix for detecting ION channel type in LoadBalance (#2310)
- Fix for
RangeVarPlotadding extra point at section ends when using plotly (#2410) - Fixed mod file array variable assignment (
seg.mech.array[i] = x) (#2504) - Various fixes in RxD features (#2593, #2588)
- Fix CoreNEURON bug causing in-memory model copy with file mode (#2767)
- Fix CoreNEURON bug when using array variables in MOD files (#2779)
- Fix lexer for ONTOLOGY parsing (#3091)
- Fix issue while using Anaconda Python on MacOS (#3088)
- Fix ParallelContext bbs memory leaks (#3563)
- Fix RxD indexing bug (#3337)
- Fix handling of
hh.modwhen using CoreNEURON (#3301) - On
h.quit(), terminal settings are same as when neuron.hoc was imported (#3259) intreplaced byfloorto accept negative coordinates (#3264)- Fix sanitizer leak involving
neuron import h, gui(#3243) - Fix leaks in
get_endian_character(#3257) - Fix leak in
pysec_childrenandpysec_subtree(#3255) - Python 3.13.1 broke
[s for s in sl]whereslis aSectionList(#3276)
Other Improvements and Changes
- Allow
segment.mechanism.func(args)to call aFUNCTIONorPROCEDURE(#2475) - Simplify
INDEPENDENTstatement as onlytvariable is accepted (#2013) - Fix various memory leaks and related improvements (#3255, #3257, #3243, #2456)
- Support for reading reporting related information with in-memory mode (#2555)
- NMODL language documentation update (#2152, #2771, #2885)
- Documentation improvements including transfer from https://neuron.yale.edu to https://nrn.readthedocs.io (#1901, #2922, #2971, #3106, #3187)
- Various test, CI, and build infrastructure improvements (#1991, #2260, #2474)
- Migrate many C code parts to C++ (#2083, #2305)
- Support online LFP calculation in CoreNEURON (via SONATA reports for BBP use cases) (#2118, #2360)
- Adopt CoreNEURON cell permute functionality into NEURON (#2598)
- Allow legacy
a.b(i)syntax for 1d arrays (extend toPointProcess.var[i]andob.dblarray[i]) (#2256) - Add an ability to run NEURON ModelDB CI using label (#2108)
- Remove unused code parts under various preprocessor variables (#2007)
- Return error/exit codes properly in
nrniv -cand nrnivmodl (#1871) - No limit on number of ion mechanisms that can be used (#3089)
- Added Jupyter support for ModelView (#1907)
- Make notebooks work with
bokeh>=3(#3061) - Added new method
ParallelContext.get_partition()(#2351) - Unified docs: one file for all languages (#3466)
- Improve rxd memory usage with
__slots__(#3572) - nrn_function_call now works with non-double returns (#3559)
- Replaced
%string formatting with f-strings (#3552) SectionList.size()andlen(sectionlist)skip deleted sections (#3524)- Add
.size()to theSectionListobject, returns the number of sections in the list (#3520) - CVode no_cap uses direct backing store instead of
Node*(#3314) - Documentation updated to use
from neuron import n(#3459) - Default node order is cell contiguous (except for thread rootnodes) (#3300)
- Support multicompartment reactions with source & destination in the ecs (#3296)
- Update
rxd.MultipleGeometryto support 3D and hybrid models (#3389) - Add NMODL warning if a
FUNCTIONdoes not have a return statement (#3404) - Update species on region exception message (#3351)
- Updated rxd reactions to allow pure backward reactions (#3273)
Vector.applyfor Python functions (#3362)- Allow python callbacks for
xstatebuttonandxcheckbox(#3355)