Commit Graph

18 Commits

Author SHA1 Message Date
047e4eeebc Auxiliary test methods for angles, dihedrals and impropers in python-numpy 2023-01-26 16:41:47 +02:00
ef3b01f340 add neighbor list access tests. now we can always test for a full list. 2022-10-03 18:14:08 -04:00
033af0c507 add unit test for extracting local vector and array via numpy 2022-06-20 18:48:50 -04:00
458253b452 add python interface with optional numpy support for lammps_gather_bonds()
unit tests are included
2021-07-26 22:40:21 -04:00
5520d6edd7 confirm that no incompatible neighbor lists are found 2021-04-03 10:24:46 -04:00
d3b2ccf9dd numpy version of neighbor list tests 2021-04-02 21:41:26 -04:00
7aa45ea816 Add numpy variants of extract_variable tests 2020-11-23 14:14:29 -05:00
22cca93603 Add tests for neighbor list API 2020-10-05 17:34:08 -04:00
ab6b69d6bd Add documentation and better autodetect 2020-09-17 16:39:19 -04:00
b81ad54baa Simplify extract_atom and extract_global in Python interface
Both extract methods now can auto-detect the datatype of both global
and per-atom properties. Callers can still enforce different types
if needed by specifying the now optional dtype argument.

The numpy wrapper now has a new extract_atom function method, which
replace the extract_atom_darray and extract_atom_iarray method and
autodetects both type and size. All parameters can still be forced
to use different values if needed.
2020-09-17 16:16:27 -04:00
9fa43b8b12 Skip Numpy tests if not installed 2020-09-17 12:03:36 -04:00
5dacfc47ca Change return type of lammps.get_natoms to int
Closes PR #2370
2020-09-17 10:57:49 -04:00
12582edfb7 Add numpy.extract_atom_darray test 2020-09-16 18:04:45 -04:00
02ea7af1f7 let dummy tests pass 2020-08-28 18:49:39 -04:00
cb09844182 Add placeholders for future tests 2020-08-28 17:52:15 -04:00
6bcc263b41 Ensure LAMMPS pointer is of type c_void_p
Fixes segfaults caused by API change. The API change in
lammps_open and lammps_open_no_mpi makes them return the LAMMPS pointer
via their return value. However due to how ctypes operates, even
if restype is specified to be c_void_p, the function returns an integer.

Without the proper type of the pointer, calling functions without arglists would default
to using 32bit integers to pass an argument, which cuts away parts of the 64bit pointer.
Subsequently, resolving the truncated pointer in the library causes segfaults.

This commit fixes the root cause. But it also highlights the need of specifying
the arglists of all library functions.
2020-08-28 14:21:03 -04:00
167f12a4a4 Add python test for extract_compute of peratom vector 2020-08-28 13:53:36 -04:00
d7e2be1c81 Start Python interface tests for numpy extensions 2020-08-27 17:47:49 -04:00