mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-01 03:00:13 -04:00
Updated constants module generator script
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
@@ -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']]
|
||||
|
||||
Reference in New Issue
Block a user