From 7633910c3052b8f22f0ac290f5523baf867ddae0 Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Wed, 16 Dec 2015 20:22:13 +0000 Subject: [PATCH] Corrections to passing of dictionaries to input files. --- gprMax/gprMax.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gprMax/gprMax.py b/gprMax/gprMax.py index a66fdd69..668734eb 100644 --- a/gprMax/gprMax.py +++ b/gprMax/gprMax.py @@ -84,7 +84,9 @@ def main(): maxiterations = 20 # Process Taguchi code blocks in the input file; pass in ordered dictionary to hold parameters to optimise - taguchinamespace = taguchi_code_blocks(inputfile, {'optparams': OrderedDict()}) + tmp = usernamespace.copy() + tmp.update({'optparams': OrderedDict()}) + taguchinamespace = taguchi_code_blocks(inputfile, tmp) # Extract dictionaries and variables containing initialisation parameters optparams = taguchinamespace['optparams'] @@ -216,9 +218,11 @@ 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() + tmp = {} for key, value in optparams.items(): - optnamespace[key] = value[modelrun - 1] + tmp[key] = value[modelrun - 1] optparamshist[key].append(value[modelrun - 1]) + 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))))