Skip to content

Commit b71eb19

Browse files
author
rodriguez-facundo
committed
fix delete wrong key
1 parent e523735 commit b71eb19

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

netpyne_ui/netpyne_geppetto.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -555,18 +555,20 @@ def propagate(self, model, label, cond, new, old):
555555
if cond in analysis[plot].keys():
556556
for index, item in enumerate(analysis[plot][cond]):
557557
if isinstance(item, str):
558-
if new == None:
559-
analysis[plot][cond].pop(index)
560-
break
561-
elif item == old:
562-
analysis[plot][cond][index] = new
563-
else:
564-
if isinstance(item[0], str):
558+
if item == old:
565559
if new == None:
566-
analysis[plot][cond].pop(index)
560+
analysis[plot][cond].remove(item)
567561
break
568-
elif item[0] == old:
569-
analysis[plot][cond][index] = [new, item[1]]
562+
else:
563+
analysis[plot][cond][index] = new
564+
else:
565+
if isinstance(item[0], str):
566+
if item[0] == old:
567+
if new == None:
568+
analysis[plot][cond].pop(index)
569+
break
570+
else:
571+
analysis[plot][cond][index] = [new, item[1]]
570572
else:
571573
obj = getattr(self.netParams, model)
572574
for key in obj.keys():

0 commit comments

Comments
 (0)