From 0a964f25c5f8c826664e54ed9551e27efed823e9 Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Wed, 16 Dec 2015 18:02:04 +0000 Subject: [PATCH] Taguchi parameters passed as a dictionary into user namespace dictionary available in input files. --- gprMax/gprMax.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gprMax/gprMax.py b/gprMax/gprMax.py index a7f0eb1e..a66fdd69 100644 --- a/gprMax/gprMax.py +++ b/gprMax/gprMax.py @@ -175,7 +175,9 @@ def main(): # Run a model # Add specific value for each parameter to optimise for each experiment to user accessible namespace optnamespace = usernamespace.copy() - optnamespace.update((key, value[modelrun - 1]) for key, value in optparams.items()) + tmp = {} + tmp.update((key, value[modelrun - 1]) for key, value in optparams.items()) + optnamespace.update({'optparams': tmp}) run_model(args, modelrun, numbermodelruns, inputfile, usernamespace) comm.send(None, dest=0, tag=tags.DONE.value) elif tag == tags.EXIT.value: @@ -189,7 +191,9 @@ def main(): for modelrun in range(1, numbermodelruns + 1): # Add specific value for each parameter to optimise, for each experiment to user accessible namespace optnamespace = usernamespace.copy() - optnamespace.update((key, value[modelrun - 1]) for key, value in optparams.items()) + tmp = {} + tmp.update((key, value[modelrun - 1]) for key, value in optparams.items()) + optnamespace.update({'optparams': tmp}) run_model(args, modelrun, numbermodelruns, inputfile, optnamespace) tsimend = perf_counter() print('\nTotal simulation time [HH:MM:SS]: {}'.format(datetime.timedelta(seconds=int(tsimend - tsimstart))))