Skip to content

Commit 3461444

Browse files
author
facu.r
committed
fix warning when executing getAvailableCellModels
1 parent f775276 commit 3461444

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

netpyne_ui/netpyne_geppetto.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -348,17 +348,19 @@ def getAvailablePops(self):
348348
def getAvailableCellModels(self):
349349
cellModels = set([])
350350
for p in netParams.popParams:
351-
cm = netParams.popParams[p]['cellModel']
352-
if cm not in cellModels:
353-
cellModels.add(cm)
351+
if 'cellModel' in netParams.popParams[p]:
352+
cm = netParams.popParams[p]['cellModel']
353+
if cm not in cellModels:
354+
cellModels.add(cm)
354355
return cellModels
355356

356357
def getAvailableCellTypes(self):
357358
cellTypes = set([])
358359
for p in netParams.popParams:
359-
ct = netParams.popParams[p]['cellType']
360-
if ct not in cellTypes:
361-
cellTypes.add(ct)
360+
if 'celltype' in netParams.popParams[p]:
361+
ct = netParams.popParams[p]['cellType']
362+
if ct not in cellTypes:
363+
cellTypes.add(ct)
362364
return cellTypes
363365

364366
def getAvailableSections(self):

0 commit comments

Comments
 (0)