mirror of
https://github.com/TREX-CoE/trexio.git
synced 2024-08-24 22:21:43 +02:00
rename python test and add temporary TODO
This commit is contained in:
parent
9a28b8d4bc
commit
60c28c1f3b
@ -4,6 +4,15 @@ import shutil
|
||||
|
||||
from pytrexio import *
|
||||
|
||||
# TODO: make a user-friendly more pythonic API that will have to be autogenerated
|
||||
# add Exception handling
|
||||
# check of dimensions and call to safe API
|
||||
# conversion to and from numpy arrays
|
||||
|
||||
# automatically download (hopefully the latest version) numpy.i using
|
||||
# wget https://raw.githubusercontent.com/numpy/numpy/main/tools/swig/numpy.i
|
||||
# but also keep the original copy in case if wget fails
|
||||
|
||||
#=========================================================#
|
||||
#======== SETUP THE BACK END AND OUTPUT FILE NAME ========#
|
||||
#=========================================================#
|
||||
@ -82,14 +91,18 @@ assert rc==TREXIO_SUCCESS
|
||||
|
||||
test_file2 = trexio_open(output_filename, 'r', TEST_TREXIO_BACKEND)
|
||||
|
||||
# TODO: think about adding exception handling if rc != TREXIO_SUCCESS throw an exception but do not return the code itself and then there is less arguments
|
||||
# TODO: maybe also for the write
|
||||
|
||||
result = trexio_read_nucleus_num(test_file2)
|
||||
assert result[0]==0
|
||||
assert result[0]==TREXIO_SUCCESS
|
||||
assert result[1]==nucleus_num
|
||||
#print(result)
|
||||
|
||||
charges2 = doubleArray(nucleus_num)
|
||||
for i in range(nucleus_num):
|
||||
charges2[i] = -1.
|
||||
print(charges2[3])
|
||||
#for i in range(nucleus_num):
|
||||
# charges2[i] = -1.
|
||||
|
||||
rc = trexio_read_nucleus_charge(test_file2, charges2)
|
||||
assert rc==TREXIO_SUCCESS
|
Loading…
Reference in New Issue
Block a user