make lammps_config_has_package() accessible in Python module

This commit is contained in:
Axel Kohlmeyer
2022-10-05 20:14:10 -04:00
parent 8b6c93cb11
commit 0a8dfb73da
2 changed files with 23 additions and 0 deletions

View File

@ -265,6 +265,7 @@ class lammps(object):
self.lib.lammps_encode_image_flags.restype = self.c_imageint
self.lib.lammps_config_has_package.argtypes = [c_char_p]
self.lib.lammps_config_package_name.argtypes = [c_int, c_char_p, c_int]
self.lib.lammps_config_accelerator.argtypes = [c_char_p, c_char_p, c_char_p]
@ -1627,6 +1628,21 @@ class lammps(object):
# -------------------------------------------------------------------------
def has_package(self, name):
""" Report if the named package has been enabled in the LAMMPS shared library.
This is a wrapper around the :cpp:func:`lammps_config_has_package`
function of the library interface.
:param name: name of the package
:type name: string
:return: state of package availability
:rtype: bool
"""
return self.lib.lammps_config_has_package(name.encode()) != 0
# -------------------------------------------------------------------------
@property
def accelerator_config(self):
""" Return table with available accelerator configuration settings.