Files
CoolProp/dev/scripts/inject_superancillary.py
2025-03-10 20:32:22 -04:00

13 lines
474 B
Python

from pathlib import Path
import json
FLUIDS = Path(__file__).parent / 'fluids'
assert(FLUIDS.exists())
FASTCHEB_OUT = Path(r"D:\Code\fastchebpure")
for path in FASTCHEB_OUT.glob('*.json'):
name = path.stem.replace('_exps','')
contents = json.load(path.open())
destpath = FLUIDS / f'{name}.json'
dest = json.load(destpath.open())
dest['EOS'][0]['SUPERANCILLARY'] = contents
with destpath.open('w') as fp:
fp.write(json.dumps(dest, indent=2))