@@ -879,16 +879,18 @@ def deleteParam(self, model, label):
879879 # side effect on other rules
880880 if "popParams" in model :
881881 self .propagate_field_rename ("pop" , None , label )
882- self .propagate_field_rename ("cellModel" , None , rule ['cellModel' ])
883- self .propagate_field_rename ("cellType" , None , rule ['cellType' ])
882+ if 'cellModel' in rule :
883+ self .propagate_field_rename ("cellModel" , None , rule ['cellModel' ])
884+ if 'cellType' in rule :
885+ self .propagate_field_rename ("cellType" , None , rule ['cellType' ])
884886
885887 elif "stimSourceParams" in model :
886888
887889 self .propagate_field_rename ("source" , None , label )
888890 elif "synMechParams" in model :
889891 self .propagate_field_rename ("synMech" , None , label )
890892 return True
891- except Exception :
893+ except Exception as e :
892894 logging .exception (f"Error while deleting parameter: { label } " )
893895 return False
894896
@@ -966,7 +968,7 @@ def propagate(self, model, label, cond, new, old):
966968 for plot in analysis .keys ():
967969 if cond in analysis [plot ].keys ():
968970 for index , item in enumerate (analysis [plot ][cond ]):
969- if isinstance (item , str ):
971+ if isinstance (item , str ) or isinstance ( item , int ) :
970972 if item == old :
971973 if new == None :
972974 analysis [plot ][cond ].remove (item )
@@ -984,11 +986,11 @@ def propagate(self, model, label, cond, new, old):
984986 else :
985987 obj = getattr (self .netParams , model )
986988 for key in obj .keys ():
987- if label in list (obj [key ][cond ].keys ()):
989+ if cond in obj [ key ] and label in list (obj [key ][cond ].keys ()):
988990 if isinstance (obj [key ][cond ][label ], str ):
989991 if old == obj [key ][cond ][label ]:
990992 if new == '' or new == None :
991- obj [key ].pop (label )
993+ obj [key ][ cond ] .pop (label )
992994 else :
993995 obj [key ][cond ][label ] = new
994996 elif isinstance (obj [key ][cond ][label ], list ):
0 commit comments