diff --git a/.devcontainer/READMD.md b/.devcontainer/README.md similarity index 91% rename from .devcontainer/READMD.md rename to .devcontainer/README.md index 8e600a143f..57f13065b6 100644 --- a/.devcontainer/READMD.md +++ b/.devcontainer/README.md @@ -26,6 +26,11 @@ When calling and debuging LAMMPS with DeePMD-kit, use the following scripts inst - `.devcontainer/lmp` - `.devcontainer/gdb_lmp` +Use the following scripts for `pytest` with LAMMPS: + +- `.devcontainer/pytest_lmp` +- `.devcontainer/gdb_pytest_lmp` + ## Rebuild Usually the Python package does not need to reinstall. diff --git a/.devcontainer/gdb_pytest_lmp b/.devcontainer/gdb_pytest_lmp new file mode 100755 index 0000000000..e27e40d4b0 --- /dev/null +++ b/.devcontainer/gdb_pytest_lmp @@ -0,0 +1,9 @@ +#!/bin/bash +SCRIPT_PATH=$(dirname $(realpath -s $0))/../.. + +export CMAKE_PREFIX_PATH=${SCRIPT_PATH}/../libtorch +TENSORFLOW_ROOT=$(python -c 'import importlib,pathlib;print(pathlib.Path(importlib.util.find_spec("tensorflow").origin).parent)') + +env LAMMPS_PLUGIN_PATH=${SCRIPT_PATH}/../dp/lib/deepmd_lmp \ + LD_LIBRARY_PATH=${SCRIPT_PATH}/../dp/lib:${CMAKE_PREFIX_PATH}/lib:${TENSORFLOW_ROOT} \ + gdb --args python -m pytest -s "$@" diff --git a/.devcontainer/pytest_lmp b/.devcontainer/pytest_lmp new file mode 100755 index 0000000000..9371ba72d5 --- /dev/null +++ b/.devcontainer/pytest_lmp @@ -0,0 +1,9 @@ +#!/bin/bash +SCRIPT_PATH=$(dirname $(realpath -s $0))/../.. + +export CMAKE_PREFIX_PATH=${SCRIPT_PATH}/../libtorch +TENSORFLOW_ROOT=$(python -c 'import importlib,pathlib;print(pathlib.Path(importlib.util.find_spec("tensorflow").origin).parent)') + +env LAMMPS_PLUGIN_PATH=${SCRIPT_PATH}/../dp/lib/deepmd_lmp \ + LD_LIBRARY_PATH=${SCRIPT_PATH}/../dp/lib:${CMAKE_PREFIX_PATH}/lib:${TENSORFLOW_ROOT} \ + python -m pytest "$@"