Skip to content

Commit 03c8742

Browse files
authored
Merge pull request #1787 from amcadmus/master
Merge devel into master
2 parents c4f0cec + 06763c2 commit 03c8742

File tree

156 files changed

+2791
-1014
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+2791
-1014
lines changed

.github/labeler.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Python:
2+
- deepmd/**/*
3+
- source/tests/**/*
4+
Docs: doc/**/*
5+
Examples: examples/**/*
6+
Core: source/lib/**/*
7+
CUDA: source/lib/src/cuda/**/*
8+
ROCM: source/lib/src/rocm/**/*
9+
OP: source/op/**/*
10+
C++: source/api_cc/**/*
11+
LAMMPS: source/lmp/**/*
12+
Gromacs: source/gmx/**/*
13+
i-Pi: source/ipi/**/*

.github/workflows/build_cc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212
- variant: cpu
1313
- variant: cuda
1414
steps:
15+
- name: work around permission issue
16+
run: git config --global --add safe.directory /__w/deepmd-kit/deepmd-kit
1517
- uses: actions/checkout@master
1618
with:
1719
submodules: true

.github/workflows/build_wheel.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
os: [ubuntu-18.04] #, windows-latest, macos-latest]
1414

1515
steps:
16+
- name: work around permission issue
17+
run: git config --global --add safe.directory /__w/deepmd-kit/deepmd-kit
1618
- uses: actions/checkout@v2
1719
- uses: actions/setup-python@v2
1820
name: Install Python
@@ -26,7 +28,7 @@ jobs:
2628
- name: Build wheels
2729
env:
2830
CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-* cp310-*"
29-
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/deepmodeling/manylinux2010_x86_64_tensorflow
31+
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/deepmodeling/manylinux2014_x86_64_tensorflow
3032
CIBW_BEFORE_BUILD: pip install tensorflow
3133
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*"
3234
run: |

.github/workflows/labeler.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: "Pull Request Labeler"
2+
on:
3+
- pull_request_target
4+
5+
jobs:
6+
triage:
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/labeler@v4
13+
with:
14+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/lint_python.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
python-version: [3.8]
1212

1313
steps:
14+
- name: work around permission issue
15+
run: git config --global --add safe.directory /__w/deepmd-kit/deepmd-kit
1416
- uses: actions/checkout@v1
1517
- uses: actions/setup-python@v2
1618
with:

.github/workflows/test_cc.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ jobs:
66
testpython:
77
name: Test C++
88
runs-on: ubuntu-latest
9+
container: ghcr.io/deepmodeling/deepmd-kit-test-cc:latest
910
steps:
11+
- name: work around permission issue
12+
run: git config --global --add safe.directory /__w/deepmd-kit/deepmd-kit
1013
- uses: actions/checkout@master
11-
- run: source/install/test_cc.sh
14+
- run: source/install/test_cc_local.sh
15+
env:
16+
tensorflow_root: /usr/local
17+
- run: source/install/codecov.sh

.github/workflows/test_python.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151

5252
container: ghcr.io/deepmodeling/deepmd-kit-test-environment:py${{ matrix.python }}-gcc${{ matrix.gcc }}-tf${{ matrix.tf }}
5353
steps:
54+
- name: work around permission issue
55+
run: git config --global --add safe.directory /__w/deepmd-kit/deepmd-kit
5456
- uses: actions/checkout@master
5557
- name: pip cache
5658
uses: actions/cache@v2

README.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ A full [document](doc/train/train-input-auto.rst) on options in the training inp
8686
- [Install GROMACS](doc/install/install-gromacs.md)
8787
- [Building conda packages](doc/install/build-conda.md)
8888
- [Data](doc/data/index.md)
89-
- [Data conversion](doc/data/data-conv.md)
89+
- [System](doc/data/system.md)
90+
- [Formats of a system](doc/data/data-conv.md)
9091
- [Prepare data with dpdata](doc/data/dpdata.md)
9192
- [Model](doc/model/index.md)
9293
- [Overall](doc/model/overall.md)
@@ -99,6 +100,7 @@ A full [document](doc/train/train-input-auto.rst) on options in the training inp
99100
- [Fit `tensor` like `Dipole` and `Polarizability`](doc/model/train-fitting-tensor.md)
100101
- [Train a Deep Potential model using `type embedding` approach](doc/model/train-se-e2-a-tebd.md)
101102
- [Deep potential long-range](doc/model/dplr.md)
103+
- [Deep Potential - Range Correction (DPRc)](doc/model/dprc.md)
102104
- [Training](doc/train/index.md)
103105
- [Training a model](doc/train/training.md)
104106
- [Advanced options](doc/train/training-advanced.md)
@@ -121,37 +123,31 @@ A full [document](doc/train/train-input-auto.rst) on options in the training inp
121123
- [LAMMPS commands](doc/third-party/lammps-command.md)
122124
- [Run path-integral MD with i-PI](doc/third-party/ipi.md)
123125
- [Run MD with GROMACS](doc/third-party/gromacs.md)
126+
- [Interfaces out of DeePMD-kit](doc/third-party/out-of-deepmd-kit.md)
124127

125128
# Code structure
129+
126130
The code is organized as follows:
127131

128132
* `data/raw`: tools manipulating the raw data files.
129-
130133
* `examples`: examples.
131-
132134
* `deepmd`: DeePMD-kit python modules.
133-
134135
* `source/api_cc`: source code of DeePMD-kit C++ API.
135-
136136
* `source/ipi`: source code of i-PI client.
137-
138137
* `source/lib`: source code of DeePMD-kit library.
139-
140138
* `source/lmp`: source code of Lammps module.
141-
142139
* `source/gmx`: source code of Gromacs plugin.
143-
144140
* `source/op`: tensorflow op implementation. working with library.
145141

146142

147143
# Troubleshooting
148144

149-
- [Model compatibility](doc/troubleshooting/model-compatability.md)
145+
- [Model compatibility](doc/troubleshooting/model_compatability.md)
150146
- [Installation](doc/troubleshooting/installation.md)
151-
- [The temperature undulates violently during early stages of MD](doc/troubleshooting/md-energy-undulation.md)
152-
- [MD: cannot run LAMMPS after installing a new version of DeePMD-kit](doc/troubleshooting/md-version-compatibility.md)
153-
- [Do we need to set rcut < half boxsize?](doc/troubleshooting/howtoset-rcut.md)
154-
- [How to set sel?](doc/troubleshooting/howtoset-sel.md)
147+
- [The temperature undulates violently during early stages of MD](doc/troubleshooting/md_energy_undulation.md)
148+
- [MD: cannot run LAMMPS after installing a new version of DeePMD-kit](doc/troubleshooting/md_version_compatibility.md)
149+
- [Do we need to set rcut < half boxsize?](doc/troubleshooting/howtoset_rcut.md)
150+
- [How to set sel?](doc/troubleshooting/howtoset_sel.md)
155151
- [How to control the number of nodes used by a job?](doc/troubleshooting/howtoset_num_nodes.md)
156152
- [How to tune Fitting/embedding-net size?](doc/troubleshooting/howtoset_netsize.md)
157153

deepmd/calculator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class DP(Calculator):
5454
"""
5555

5656
name = "DP"
57-
implemented_properties = ["energy", "forces", "virial", "stress"]
57+
implemented_properties = ["energy", "free_energy", "forces", "virial", "stress"]
5858

5959
def __init__(
6060
self,
@@ -102,6 +102,8 @@ def calculate(
102102
atype = [self.type_dict[k] for k in symbols]
103103
e, f, v = self.dp.eval(coords=coord, cells=cell, atom_types=atype)
104104
self.results['energy'] = e[0][0]
105+
# see https://gitlab.com/ase/ase/-/merge_requests/2485
106+
self.results['free_energy'] = e[0][0]
105107
self.results['forces'] = f[0]
106108
self.results['virial'] = v[0].reshape(3, 3)
107109

deepmd/common.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def add_data_requirement(
9595
high_prec: bool = False,
9696
type_sel: bool = None,
9797
repeat: int = 1,
98+
default: float = 0.,
9899
):
99100
"""Specify data requirements for training.
100101
@@ -116,6 +117,8 @@ def add_data_requirement(
116117
select only certain type of atoms, by default None
117118
repeat : int, optional
118119
if specify repaeat data `repeat` times, by default 1
120+
default : float, optional, default=0.
121+
default value of data
119122
"""
120123
data_requirement[key] = {
121124
"ndof": ndof,
@@ -124,6 +127,7 @@ def add_data_requirement(
124127
"high_prec": high_prec,
125128
"type_sel": type_sel,
126129
"repeat": repeat,
130+
"default": default,
127131
}
128132

129133

@@ -444,28 +448,6 @@ def expand_sys_str(root_dir: Union[str, Path]) -> List[str]:
444448
return matches
445449

446450

447-
def docstring_parameter(*sub: Tuple[str, ...]):
448-
"""Add parameters to object docstring.
449-
450-
Parameters
451-
----------
452-
sub: Tuple[str, ...]
453-
list of strings that will be inserted into prepared locations in docstring.
454-
455-
Note
456-
----
457-
Can be used on both object and classes.
458-
"""
459-
460-
@wraps
461-
def dec(obj: "_OBJ") -> "_OBJ":
462-
if obj.__doc__ is not None:
463-
obj.__doc__ = obj.__doc__.format(*sub)
464-
return obj
465-
466-
return dec
467-
468-
469451
def get_np_precision(precision: "_PRECISION") -> np.dtype:
470452
"""Get numpy precision constant from string.
471453

0 commit comments

Comments
 (0)