@@ -197,7 +197,7 @@ def setup(self, key):
197
197
neuron = self ._get_neuron (key )
198
198
pulsegen = self ._make_pulse_input (key )
199
199
if pulsegen is None :
200
- print key , 'Not implemented.'
200
+ print (( key , 'Not implemented.' ))
201
201
202
202
def simulate (self , key ):
203
203
self .setup (key )
@@ -207,7 +207,7 @@ def run(self, key):
207
207
try :
208
208
Vm = self .Vm_tables [key ]
209
209
u = self .u_tables [key ]
210
- except KeyError , e :
210
+ except KeyError as e :
211
211
Vm = moose .Table (self .data_container .path + '/' + key + '_Vm' )
212
212
nrn = self .neurons [key ]
213
213
moose .connect (Vm , 'requestOut' , nrn , 'getVm' )
@@ -217,7 +217,7 @@ def run(self, key):
217
217
self .u_tables [key ] = utable
218
218
try :
219
219
Im = self .inject_tables [key ]
220
- except KeyError , e :
220
+ except KeyError as e :
221
221
Im = moose .Table (self .data_container .path + '/' + key + '_inject' ) # May be different for non-pulsegen sources.
222
222
Im .connect ('requestOut' , self ._get_neuron (key ), 'getIm' )
223
223
self .inject_tables [key ] = Im
@@ -237,7 +237,7 @@ def run(self, key):
237
237
time = linspace (0 , IzhikevichDemo .parameters [key ][7 ], len (Vm .vector ))
238
238
# DEBUG
239
239
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 )) )
241
241
#! DEBUG
242
242
return (time , Vm , Im )
243
243
@@ -246,14 +246,14 @@ def _get_neuron(self, key):
246
246
try :
247
247
params = IzhikevichDemo .parameters [key ]
248
248
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 )) )
250
250
for key in IzhikevichDemo .parameters :
251
- print key
251
+ print ( key )
252
252
raise e
253
253
try :
254
254
neuron = self .neurons [key ]
255
255
return neuron
256
- except KeyError , e :
256
+ except KeyError as e :
257
257
neuron = moose .IzhikevichNrn (self .model_container .path + '/' + key )
258
258
259
259
if key == 'integrator' or key == 'Class_1' : # Integrator has different constants
@@ -354,7 +354,7 @@ def _make_pulse_input(self, key):
354
354
self .inputs [key ] = input_table
355
355
return input_table
356
356
else :
357
- print key , ': Stimulus is not based on pulse generator.'
357
+ print (( key , ': Stimulus is not based on pulse generator.' ))
358
358
raise
359
359
pulsegen = self ._make_pulsegen (key ,
360
360
firstLevel ,
@@ -529,9 +529,9 @@ def getEquation(self, key):
529
529
plot (time , Im .vector )
530
530
subplot (3 ,1 ,3 )
531
531
show ()
532
- print 'Finished simulation.'
532
+ print ( 'Finished simulation.' )
533
533
except ImportError :
534
- print 'Matplotlib not installed.'
534
+ print ( 'Matplotlib not installed.' )
535
535
536
536
#
537
537
# Izhikevich.py ends here
0 commit comments