Updated constants module generator script

Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
Ian Bell
2014-08-21 09:13:09 +02:00
parent 94cbeb5758
commit 921ec87c20

View File

@@ -39,7 +39,7 @@ def generate_cython(data):
pxd_output_file.write('# This file is automatically generated by the generate_constants_module.py script in dev/scripts.\n# DO NOT MODIFY THE CONTENTS OF THIS FILE!\n\ncdef extern from "DataStructures.h" namespace "CoolProp":\n')
for enum_key, entries in data:
pxd_output_file.write('\tenum '+enum_key+':\n')
pxd_output_file.write('\tctypedef enum '+enum_key+':\n')
for param in entries:
param = param.strip()
pxd_output_file.write('\t\t'+param+'\n')
@@ -54,8 +54,8 @@ def generate_cython(data):
pyx_output_file.write(param+' = '+'constants_header.'+param+'\n')
pyx_output_file.close()
shutil.copy2('constants_header.pxd',os.path.join('..','..','wrappers','Python','CoolProp5','constants_header.pxd'))
shutil.copy2('constants.pyx',os.path.join('..','..','wrappers','Python','CoolProp5','constants.pyx'))
shutil.copy2('constants_header.pxd',os.path.join('..','..','wrappers','Python','CoolProp','constants_header.pxd'))
shutil.copy2('constants.pyx',os.path.join('..','..','wrappers','Python','CoolProp','constants.pyx'))
if __name__=='__main__':
data = [(enum,params_constants(enum)) for enum in ['parameters', 'input_pairs', 'fluid_types']]