Implement python-side unified support, add example

This commit is contained in:
Steven Ray Anaya
2022-08-16 02:35:31 -06:00
parent 06285556c9
commit 7a76a6ee36
4 changed files with 93 additions and 3 deletions

View File

@ -17,4 +17,4 @@ if not pylib.Py_IsInitialized():
raise RuntimeError("This interpreter is not compatible with python-based mliap for LAMMPS.")
del sysconfig, ctypes, library, pylib
from .loader import load_model, activate_mliappy
from .loader import load_model, load_unified, activate_mliappy

View File

@ -80,3 +80,12 @@ def load_model(model):
"the pair style. Call lammps.mliap.activate_mliappy(lmp)."
) from ie
mliap_model_python_couple.load_from_python(model)
def load_unified(model):
try:
import mliap_unifiedpy
except ImportError as ie:
raise ImportError("ML-IAP python module must be activated before loading\n"
"the pair style. Call lammps.mliap.activate_mliappy(lmp)."
) from ie
mliap_unifiedpy.load_from_python(model)