From b28aeeb79a912f5e35111ce5a09bde127aab4ebe Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Thu, 23 Feb 2017 09:46:07 +0000 Subject: [PATCH] Corrected bug that effected reading of #taguchi: command when checking for space after command name. --- gprMax/input_cmds_file.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gprMax/input_cmds_file.py b/gprMax/input_cmds_file.py index abfc7766..d84c01df 100644 --- a/gprMax/input_cmds_file.py +++ b/gprMax/input_cmds_file.py @@ -173,8 +173,8 @@ def check_cmd_names(processedlines, checkessential=True): cmdname = cmd[0] cmdparams = cmd[1] - # Check if there is space between command name and parameters, i.e. check first character of parameter string - if ' ' not in cmdparams[0]: + # Check if there is space between command name and parameters, i.e. check first character of parameter string. Ignore case when there are no parameters for a command, e.g. for #taguchi: + if ' ' not in cmdparams[0] and len(cmdparams.strip('\n')) != 0: raise CmdInputError('There must be a space between the command name and parameters in ' + processedlines[lindex]) # Check if command name is valid @@ -190,7 +190,7 @@ def check_cmd_names(processedlines, checkessential=True): if singlecmds[cmdname] == 'None': singlecmds[cmdname] = cmd[1].strip(' \t\n') else: - raise CmdInputError('You can only have instance of ' + cmdname + ' in your model') + raise CmdInputError('You can only have a single instance of ' + cmdname + ' in your model') elif cmdname in multiplecmds: multiplecmds[cmdname].append(cmd[1].strip(' \t\n'))