check for None is essential commands

这个提交包含在:
jasminium
2019-09-04 17:12:59 +01:00
父节点 e8b0c28f6e
当前提交 d4a14471bd

查看文件

@@ -84,6 +84,7 @@ def process_singlecmds(singlecmds):
# Spatial discretisation
cmd = '#dx_dy_dz'
if singlecmds[cmd] is not None:
tmp = [float(x) for x in singlecmds[cmd].split()]
if len(tmp) != 3:
raise CmdInputError(cmd + ' requires exactly three parameters')
@@ -94,6 +95,7 @@ def process_singlecmds(singlecmds):
# Domain
cmd = '#domain'
if singlecmds[cmd] is not None:
tmp = [float(x) for x in singlecmds[cmd].split()]
if len(tmp) != 3:
raise CmdInputError(cmd + ' requires exactly three parameters')
@@ -111,6 +113,7 @@ def process_singlecmds(singlecmds):
# Time window
cmd = '#time_window'
if singlecmds[cmd] is not None:
tmp = singlecmds[cmd].split()
if len(tmp) != 1:
raise CmdInputError(cmd + ' requires exactly one parameter to specify the time window. Either in seconds or number of iterations.')