@@ -197,7 +197,7 @@ def setup(self, key):
197197 neuron = self ._get_neuron (key )
198198 pulsegen = self ._make_pulse_input (key )
199199 if pulsegen is None :
200- print key , 'Not implemented.'
200+ print (( key , 'Not implemented.' ))
201201
202202 def simulate (self , key ):
203203 self .setup (key )
@@ -207,7 +207,7 @@ def run(self, key):
207207 try :
208208 Vm = self .Vm_tables [key ]
209209 u = self .u_tables [key ]
210- except KeyError , e :
210+ except KeyError as e :
211211 Vm = moose .Table (self .data_container .path + '/' + key + '_Vm' )
212212 nrn = self .neurons [key ]
213213 moose .connect (Vm , 'requestOut' , nrn , 'getVm' )
@@ -217,7 +217,7 @@ def run(self, key):
217217 self .u_tables [key ] = utable
218218 try :
219219 Im = self .inject_tables [key ]
220- except KeyError , e :
220+ except KeyError as e :
221221 Im = moose .Table (self .data_container .path + '/' + key + '_inject' ) # May be different for non-pulsegen sources.
222222 Im .connect ('requestOut' , self ._get_neuron (key ), 'getIm' )
223223 self .inject_tables [key ] = Im
@@ -237,7 +237,7 @@ def run(self, key):
237237 time = linspace (0 , IzhikevichDemo .parameters [key ][7 ], len (Vm .vector ))
238238 # DEBUG
239239 nrn = self ._get_neuron (key )
240- print 'a = %g, b = %g, c = %g, d = %g, initVm = %g, initU = %g' % (nrn .a ,nrn .b , nrn .c , nrn .d , nrn .initVm , nrn .initU )
240+ print (( 'a = %g, b = %g, c = %g, d = %g, initVm = %g, initU = %g' % (nrn .a ,nrn .b , nrn .c , nrn .d , nrn .initVm , nrn .initU )) )
241241 #! DEBUG
242242 return (time , Vm , Im )
243243
@@ -246,14 +246,14 @@ def _get_neuron(self, key):
246246 try :
247247 params = IzhikevichDemo .parameters [key ]
248248 except KeyError as e :
249- print ' %s : Invalid neuron type. The valid types are:' % (key )
249+ print (( ' %s : Invalid neuron type. The valid types are:' % (key )) )
250250 for key in IzhikevichDemo .parameters :
251- print key
251+ print ( key )
252252 raise e
253253 try :
254254 neuron = self .neurons [key ]
255255 return neuron
256- except KeyError , e :
256+ except KeyError as e :
257257 neuron = moose .IzhikevichNrn (self .model_container .path + '/' + key )
258258
259259 if key == 'integrator' or key == 'Class_1' : # Integrator has different constants
@@ -354,7 +354,7 @@ def _make_pulse_input(self, key):
354354 self .inputs [key ] = input_table
355355 return input_table
356356 else :
357- print key , ': Stimulus is not based on pulse generator.'
357+ print (( key , ': Stimulus is not based on pulse generator.' ))
358358 raise
359359 pulsegen = self ._make_pulsegen (key ,
360360 firstLevel ,
@@ -529,9 +529,9 @@ def getEquation(self, key):
529529 plot (time , Im .vector )
530530 subplot (3 ,1 ,3 )
531531 show ()
532- print 'Finished simulation.'
532+ print ( 'Finished simulation.' )
533533except ImportError :
534- print 'Matplotlib not installed.'
534+ print ( 'Matplotlib not installed.' )
535535
536536#
537537# Izhikevich.py ends here
0 commit comments