1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-08-25 06:31:43 +02:00

rename python test and add temporary TODO

This commit is contained in:
q-posev 2021-08-04 14:13:23 +03:00
parent 9a28b8d4bc
commit 60c28c1f3b

View File

@ -4,6 +4,15 @@ import shutil
from pytrexio import * 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 ========# #======== 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) 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) result = trexio_read_nucleus_num(test_file2)
assert result[0]==0 assert result[0]==TREXIO_SUCCESS
assert result[1]==nucleus_num assert result[1]==nucleus_num
#print(result) #print(result)
charges2 = doubleArray(nucleus_num) charges2 = doubleArray(nucleus_num)
for i in range(nucleus_num): print(charges2[3])
charges2[i] = -1. #for i in range(nucleus_num):
# charges2[i] = -1.
rc = trexio_read_nucleus_charge(test_file2, charges2) rc = trexio_read_nucleus_charge(test_file2, charges2)
assert rc==TREXIO_SUCCESS assert rc==TREXIO_SUCCESS