Skip to content

Commit

Permalink
chore(dev): add pytest scripts for LAMMPS in devcontainer (#4319)
Browse files Browse the repository at this point in the history
Introduce new scripts for running pytest with LAMMPS, enhancing the
development environment for testing.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
  • Loading branch information
njzjz authored Nov 7, 2024
1 parent 9699349 commit 3236db5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .devcontainer/READMD.md → .devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 9 additions & 0 deletions .devcontainer/gdb_pytest_lmp
Original file line number Diff line number Diff line change
@@ -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 "$@"
9 changes: 9 additions & 0 deletions .devcontainer/pytest_lmp
Original file line number Diff line number Diff line change
@@ -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 "$@"

0 comments on commit 3236db5

Please sign in to comment.