Skip to content

Commit

Permalink
Fixed bug in JSON output routine
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolm-dsider committed Oct 9, 2023
1 parent af9aee0 commit 1056651
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/geophires_x/GEOPHIRESv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ def main(enable_geophires_logging_config=True):
JSONSDACGT = jsons.dumps(model.sdacgteconomics.OutputParameterDict, indent=4, sort_keys=True, supress_warnings=True)
jsonMerged = {**jsonMerged, **json.loads(JSONSDACGT)}

JSONoutputfile = "HDR.out"
JSONoutputfile = "HDR.json"
if len(sys.argv) > 2:
JSONoutputfile = sys.argv[2]
JSONoutputfile = JSONoutputfile.replace(".out", ".json")
JSONoutputfile = str(sys.argv[2])
segs = JSONoutputfile.split('.')
JSONoutputfile = segs[0] + '.json'
with open(JSONoutputfile, 'w', encoding='UTF-8') as f:
f.write(json.dumps(jsonMerged))

Expand Down

0 comments on commit 1056651

Please sign in to comment.