suny-downstate-medical-center / netpyne

A Python package to facilitate the development, parallel simulation, optimization and analysis of multiscale biological neuronal networks in NEURON.
http://www.netpyne.org
MIT License
148 stars 138 forks source link

LFP recording error when pop has multiple cell morphologies #772

Open vvbragin opened 1 year ago

vvbragin commented 1 year ago

This happens because NetPyNE calculates segment coords only once per population (in Pop.calcRelativeSegCoords()), and then reuses it for all cells in this pop, assuming that they all have the same morphology. But if this assumption is broken, it crashes. To solve this, need to either calculate it per each cell, without per-pop caching (bulletproof but might be expensive), or once per cellType (more efficient but still vulnerable in case some subset of cells of given cellType has the modified morphology modified by modifyCells())

urdapile commented 5 days ago

Fixed when "diversity" is used. It takes one cell template per subpopulation (cfg.includeParamsLabel should be True, as it is by default)