test.py 1.15 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

import dtype

print('------------------------------------------')
print('initializing array and getting 2nd element')
dat  = dtype.P_datatype(2)
dat.fortranContent()
dat.cythonContent()
print('------------------------------------------')
print('call to fortranChange with parameters \'fortran change\', 13. 6')
dat.fortranChange('fortran change', 13.,6)
print('------------------------------------------')
print('changing content of dat.rtab[0] = -8000.')
dat.rtab[0] = -8000.
dat.cythonContent()
print('------------------------------------------')
print('call to cythonChange with parameters \'cython change\', 144. 12')
dat.cythonChange('cython change', 144., 12)
dat.fortranContent()
print('------------------------------------------')

print('getting a weird strucutre as a dictionnary and printing key:val')
#getting a weird structure seen
#as a dictionary
di2_1 = dat.getWeirdCopy(1)
for k in di2_1.keys():
  print(str(k)+':'+str(di2_1[k]))
print('------------------------------------------')

# to check handling of null pointers
# within the data structures
print('checking handling of null pointers')
d0 = dtype.P_datatype(1)
d0.fortranContent()
d0.cythonContent()