From 7dfcc480ba1e19bd3232349fc733caef94034292 Mon Sep 17 00:00:00 2001 From: stainer_t Date: Mon, 8 Sep 2025 13:48:49 +0200 Subject: Initial commit from Polytechnique Montreal --- PyGan/data/test_lcm.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 PyGan/data/test_lcm.py (limited to 'PyGan/data/test_lcm.py') diff --git a/PyGan/data/test_lcm.py b/PyGan/data/test_lcm.py new file mode 100644 index 0000000..91576f9 --- /dev/null +++ b/PyGan/data/test_lcm.py @@ -0,0 +1,41 @@ +# +# test_lcm: non regression testing for lcm class +# +import lcm +from assertS import * +import numpy as np +my_lcm=lcm.new('LCM_INP','nonfuel',impx=1) +my_lcm._impx=3 +my_lcm.lib() +my_lcm.keys() +sign=my_lcm['SIGNATURE'] +print('object signature=', sign) +daughter=my_lcm['REFL'] +daughter.lib() +o2=lcm.new('LCM_INP','new_branch_of_dictionary',pyobj=daughter,impx=1) +state=o2['STATE-VECTOR'] +print('state vector=', state) +o3=daughter['MIXTURES'] +ia=np.array([8, 7, 8, 4, 9, 1, 0, 4], dtype='i') +ra=np.array([8.0,6.0,5.0,2.0,1.0], dtype='f') +da=np.array([8.0,6.0,5.0,2.0,1.0], dtype='d') +o2['key1']='new comments for this record' +o2['key2']=ia +o2['key3']=ra +o2['key4']=da +print('key2=',o2['key2']) +print('np type of key2=',o2['key2'].dtype) +print('np type of key3=',o2['key3'].dtype) +print('np type of key4=',o2['key4'].dtype) +o4=o2.rep('key5') +o2.lib() +print('o2 object name=',o2._name) +o5=o3[0]['CALCULATIONS'][0] +o5.lib() +print('ISOTOPESUSED=',o5['ISOTOPESUSED']) +print('ISOTOPESTEMP=',o5['ISOTOPESTEMP']) +print('ISOTOPESMIX=',o5['ISOTOPESMIX']) +lcm.new('ASCII',pyobj=daughter) +assertS(o5,'ISOTOPESTEMP',0,5.23150024E+02) +del o5 +print("test test_lcm completed") -- cgit v1.2.3