Skip to content

Commit

Permalink
0929
Browse files Browse the repository at this point in the history
  • Loading branch information
tian50 committed Sep 29, 2021
1 parent 4ae36cc commit ead719f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions msgpi/dakota/interface.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
import traceback as tb
from typing import KeysView
# from typing import KeysView

import msgpi.design_analysis as mda
import msgpi.ms.bda as mbda
Expand Down Expand Up @@ -30,6 +30,8 @@ def __init__(self):

def initialize(self, fn_json_args):

self.settings['scrnout'] = True

# Load JSON arguments
# -------------------
with open(fn_json_args, 'r') as fo:
Expand Down Expand Up @@ -150,7 +152,7 @@ def writeOutput(self, status):
with open('interim.out', 'w') as fo:
json.dump(self.outputs['interim'], fo, indent=4)

with open('output.out', 'w') as fo:
with open(self.settings['dakota_results_file'], 'w') as fo:
for r in self.outputs['final']:
fo.write(f'{r[1]:24.16E} {r[0]}\n')

Expand All @@ -159,7 +161,7 @@ def writeOutput(self, status):
elif status == 1:
# Fail
self.logger.info(f'{self.log_prompt} failed')
with open('output.out', 'w') as fo:
with open(self.settings['dakota_results_file'], 'w') as fo:
fo.write('FAIL')

e = tb.format_exc()
Expand Down

0 comments on commit ead719f

Please sign in to comment.