-
Notifications
You must be signed in to change notification settings - Fork 137
Description
Describe the bug
KeyError when using the new extracellular stimulation feature ('XStim') with multiple cell morphology diversity. When diversity is enabled it may be that some cell types have multiple morphologies and some only a single. calcRelativeSegCoords
seems to fail to distinguish how self._morphSegCoords
is structured in this edge case.
Related to the issue #772 with LFP. XStim feature also calls into Pop.calcRelativeSegCoords()
.
I turned on cfg.includeParamsLabel = True
as directed by the fix in #772, as I was seeing KeyErrors with 'label'
. After that, still had a KeyError with self._morphSegCoords
missing some 'label'
s.
Then inspected network.pop.py on line 641, diversity handling for populating Pop._morphSegCoords
is branched based on number of cells and was not working properly. I put in a quick fix that works for my case only; expected behavior was restored.
Reproducing the bug
Steps to reproduce the behavior:
- Multicompartment model with multiple morphologies and
diversity =True
. I believe at least one population need to have only 1 morphology subpopulation to hit this edge case but I have not confirmed this. - Add cfg stim 'XStim' for extracellular stim per the docs
cfg.includeParamsLabel = True
- Call
addStims()
- KeyError for 'label' in CompartCell in
calcAbsSegCoords
Expected behavior
No KeyError, but rather Pop._morphSegCoords
properly populates. I think branching logic in calcRelativeSegCoords
line 641 for diversity handling should be more robust.
System information
- OS and version: CentOS Stream 9
- NetPyNE version: Development branch