Commit Graph

171 Commits

Author SHA1 Message Date
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
ccc743e13e Add test for thermo data 2020-09-16 15:14:05 -04:00
8ccd3c03fa Correct test name 2020-09-16 12:54:36 -04:00
2270d8f4ec Add PyLammps.atoms test and fix bug with -echo screen/both 2020-09-16 12:48:20 -04:00
9cdd35e625 Make sure Python tests run unbuffered so PyLammps works 2020-09-16 11:28:38 -04:00
ca24806f4c Add tests 2020-09-16 10:11:00 -04:00
e5e449795a Add tests for has_style and available_styles 2020-09-15 15:16:19 -04:00
77d475d121 Add more tests 2020-09-11 15:48:23 -04:00
58833ce11e Add API tests 2020-09-11 15:21:36 -04:00
1855f92694 Use include and omit 2020-09-11 12:44:41 -04:00
377163d940 Add target to generate Python coverage XML 2020-09-11 11:36:22 -04:00
96db122377 Add Python coverage collection if enabled 2020-09-04 17:15:51 -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
69cffb2d04 import test infrastructure for c, c++ and python library usage 2020-08-25 11:03:31 -04:00