From 321c7c048750fa0b547f0585eb437f66ed782079 Mon Sep 17 00:00:00 2001 From: Su Tian Date: Wed, 20 Jan 2021 00:04:04 -0500 Subject: [PATCH] 0119 --- dakota_interface.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/dakota_interface.py b/dakota_interface.py index 5751c07..71d75ba 100644 --- a/dakota_interface.py +++ b/dakota_interface.py @@ -128,12 +128,18 @@ def process(fn_json_args): return except: - results.fail() - with open('results.out', 'w') as fout: - results.write(stream=fout) print(fse.format(dt.datetime.now(), evid, 'FAIL')) - e = tb.format_exc() - print(e) + if 'fail_replace' in interface_args.keys(): + for k, v in interface_args['fail_replace'].items(): + # if v == 'inf' or v == '-inf': + results[k].function = float(v) + results.write() + else: + results.fail() + with open('results.out', 'w') as fout: + results.write(stream=fout) + e = tb.format_exc() + print(e) return