mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-01-19 02:48:09 -05:00
* autopep8 rule-groups E101,W1,W2,W3 * autopep8 with rule group E3 (blank lines) autopep8 --in-place --recursive --max-line-length=200 --exclude="externals" --select="E101,E3,W1,W2,W3" . * tabs and space W191 * autopep8 aggressive
25 lines
657 B
Python
25 lines
657 B
Python
#!/Users/ian/anaconda/bin/python
|
|
|
|
import json, glob, CoolProp
|
|
|
|
for fluid in glob.glob('../fluids/*.json'):
|
|
with open(fluid, 'r') as fp:
|
|
jj = json.load(fp)
|
|
|
|
pL = jj['ANCILLARIES'].pop('pL')
|
|
pV = jj['ANCILLARIES'].pop('pV')
|
|
# Keep the one with the lower error
|
|
if pL['max_abserror_percentage'] < pV['max_abserror_percentage']:
|
|
pS = pL
|
|
else:
|
|
pS = pV
|
|
|
|
pseudo_pure = jj['EOS'][0]['pseudo_pure']
|
|
if pseudo_pure:
|
|
print '-----------------PSEUDO (SKIPPING !!!)', fluid
|
|
else:
|
|
print fluid
|
|
jj['ANCILLARIES']['pS'] = pS
|
|
with open(fluid, 'w') as fp:
|
|
json.dump(jj, fp)
|