Skip to content

Commit

Permalink
final fixes for composition parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Sep 13, 2024
1 parent 39827d7 commit bd281e8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion calphy/postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def gather_results(mainfolder):
datadict['reference_phase'] = []
datadict['error_code'] = []
datadict['composition'] = []
datadict['calculation'] = []

folders = next(os.walk(mainfolder))[1]
for folder in folders:
Expand All @@ -92,6 +93,7 @@ def gather_results(mainfolder):
datadict['pressure'].append(inp['pressure'])
datadict['reference_phase'].append(inp['reference_phase'])
datadict['composition'].append(None)
datadict['calculation'].append(folder)

#check output file
outfile = os.path.join(mainfolder, folder, 'report.yaml')
Expand All @@ -116,7 +118,9 @@ def gather_results(mainfolder):
datadict['free_energy'].append(out['results']['free_energy'])

#add normal composition
composition = {x:y for x,y in zip(out['input']['element'], out['input']['concentration'])}
el_arr = np.array(out['input']['element'].split(' ')).astype(str)
comp_arr = np.array(out['input']['concentration'].split(' ')).astype(float)
composition = {x:y for x,y in zip(el_arr, comp_arr)}
datadict['composition'][-1] = composition

if mode == 'composition_scaling':
Expand Down

0 comments on commit bd281e8

Please sign in to comment.