This is the tutorial video example from "Intoduction to cellular simulations", I got the error:
def parser():
parser = tools.standard_parser()
group = parser.add_argument_group('experiment specific options')
group.add_argument('--ionic_model', default='TT2',
choices=['TT2', 'Courtemanche', 'HH'],
help='pick ionic model')
group.add_argument('--duration',
type=float, default=1000.,
help='Duration of simulation (ms)')
group.add_argument('--stim-strength',
type=float, default=60.,
help='pick transmembrane current stimulus strength')
group.add_argument('--stim-dur',
type=float, default=2.,
help='pick transmembrane current stimulus duration')
return parser
def jobID(args):
"""
Generate name of top level output directory.
"""
today = date.today()
return '{}_basic_{}'.format(today.isoformat(), args.duration)
@tools.carpexample(parser, jobID)
def run(args, job):
# define & config EP model
cmd = [settings.execs.BENCH,
'--imp={}'.format(args.imp)]
if args.imp_par is not '':
cmd += ['--imp-par', args.imp_par]
if args.plug_in is not '':
cmd += ['--plug-in', args.plug_in]
if args.plug_par is not '':
cmd += ['--plug-par', args.plug_par]
# setup stimulus
cmd += ['--stim-curr', args.stim_strength,
'--numstim', int(float(args.duration)/float(args.bcl)+1),
'--bcl', args.bcl,
'--stim-assign', 'on',
'--stim-species', 'K_i']
# run bench with available ionic models
cmd += ['--duration', args.duration]
# executing bench
job.mpi(cmd, 'Running {}'.format(args.imp))
if args.visualize:
visualization(args. job.ID)
if __name__ == '__main__':
run()