- update lammps python package to use setuptools
- refactor MLIAP classes into lammps python package
lammps.mliap package
- change TorchWrapper to use dtype and device as arguments
- turn activation of mliappy into functions (was a class)
- add a check to see if python interpreter is compatible
with python lib calls internal to lammps
mliap_model_python_couple.pyx:
- load models ending in '.pt' or '.pth' with pytorch rather than pickle
- Moves lammps.py into its own package
- Imports entire module in __init__.py
- Changes both how legacy and CMake build systems install
- Added traditional setup.py for Python-only installation
Note: the CMake install target runs setup.py build and install
in a way that produces files in CMAKE_BINARY_DIR/python instead
of python/build. This is to maintain out-of-source compilation
support.
This moves the lammps.get_neighlist() method to lammps.numpy.get_neighlist().
lammps.get_neighlist() now returns a NeighList object, while the NumPy variants
returns a NumPyNeighList object. The main difference between the two is that while
the ctypes variant returns neighlist elements as
atom idx (int), numneighs (int), neighbors (POINTER(c_int))
the NumPy variant returns
atom idx (int), neighbors (numpy.array)
LammpsNumpyWrapper was a class that was defined inside of the
lammps.numpy property when it was first accessed. This made it hard
to document the methods of this class.
This commit extracts this utility class into the lammps module and
renames it to 'numpy_wrapper'.
Keep LAMMPS_TAGINT and LAMMPS_BIGINT internal to LAMMPS.
An external caller now only needs to distinguish between 32 and 64bit
integers, doubles and C strings.
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.