Skip to content

Commit 47a23b3

Browse files
authored
merge devel to master (v0.12.1) (#1507)
2 parents 042ea32 + 53668e6 commit 47a23b3

38 files changed

+1135
-218
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
target-branch: "devel"

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ jobs:
2121
run: pip install -e .[test]
2222
- name: Test
2323
run: coverage run --source=./dpgen -m unittest -v && coverage report
24-
- uses: codecov/codecov-action@v3
24+
- uses: codecov/codecov-action@v4
25+
env:
26+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2527
pass:
2628
needs: [build]
2729
runs-on: ubuntu-latest

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Jinzhe Zeng <jinzhe.zeng@rutgers.edu>

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.5.0
5+
rev: v4.6.0
66
hooks:
77
# there are many log files in tests
88
# TODO: seperate py files and log files
@@ -28,7 +28,7 @@ repos:
2828

2929
# Python
3030
- repo: https://github.com/astral-sh/ruff-pre-commit
31-
rev: v0.1.3
31+
rev: v0.3.5
3232
hooks:
3333
- id: ruff
3434
args: ["--fix"]

MANIFEST.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
prune conda
2+
prune doc
3+
prune tests
4+
prune examples

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ Yuzhi Zhang, Haidi Wang, Weijie Chen, Jinzhe Zeng, Linfeng Zhang, Han Wang, and
2323

2424
## Download and Install
2525

26-
DP-GEN only supports Python 3.9 and above. You can use one of the following methods to install DP-GEN:
26+
DP-GEN only supports Python 3.9 and above. You can [setup a conda/pip environment](https://docs.deepmodeling.com/faq/conda.html), and then use one of the following methods to install DP-GEN:
2727

2828
- Install via pip: `pip install dpgen`
29-
- Install via conda: `conda install -c conda-forge dpgen``
29+
- Install via conda: `conda install -c conda-forge dpgen`
3030
- Install from source code: `git clone https://github.com/deepmodeling/dpgen && pip install ./dpgen`
3131

3232
To test if the installation is successful, you may execute

dpgen/auto_test/lib/lammps.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,7 @@ def make_lammps_eval(conf, type_map, interaction, param):
189189
ret += (
190190
"thermo_style custom step pe pxx pyy pzz pxy pxz pyz lx ly lz vol c_mype\n"
191191
)
192-
ret += (
193-
"dump 1 all custom 100 dump.relax id type xs ys zs fx fy fz\n"
194-
) # 06/09 give dump.relax
192+
ret += "dump 1 all custom 100 dump.relax id type xs ys zs fx fy fz\n" # 06/09 give dump.relax
195193
ret += "run 0\n"
196194
ret += "variable N equal count(all)\n"
197195
ret += "variable V equal vol\n"

dpgen/auto_test/lib/mfp_eosfit.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,16 +1441,7 @@ def ext_velp(
14411441
)
14421442
for i in range(ndata):
14431443
fw.write(
1444-
"{:12.6f}\t{:12.6f}\t{:12.6f}\t{:12.6f}\t{:12.6f}\t{:12.6f}\t{:12.6f}\t{:12.6f}\n".format(
1445-
vv[i],
1446-
ee[i],
1447-
cellaa[i],
1448-
cellbb[i],
1449-
cellcc[i],
1450-
cellbaba[i],
1451-
cellcaca[i],
1452-
cellca_cal[i],
1453-
)
1444+
f"{vv[i]:12.6f}\t{ee[i]:12.6f}\t{cellaa[i]:12.6f}\t{cellbb[i]:12.6f}\t{cellcc[i]:12.6f}\t{cellbaba[i]:12.6f}\t{cellcaca[i]:12.6f}\t{cellca_cal[i]:12.6f}\n"
14541445
)
14551446
fw.flush()
14561447
fw.close()
@@ -1662,9 +1653,7 @@ def lsqfit_eos(
16621653
)
16631654
for i in range(len(vol)):
16641655
fve.write(
1665-
"{:20f}\t{:20f}\t{:20f}\t{:20f}\n".format(
1666-
vol[i], repro_en[i], en[i], 100 * np.abs((en[i] - repro_en[i]) / en[i])
1667-
)
1656+
f"{vol[i]:20f}\t{repro_en[i]:20f}\t{en[i]:20f}\t{100 * np.abs((en[i] - repro_en[i]) / en[i]):20f}\n"
16681657
)
16691658
fve.flush()
16701659
p_tmp = repro_press[i]

dpgen/auto_test/lib/pwscf.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,7 @@ def _make_pwscf_03_config(sys_data):
7272
cc = 0
7373
for ii in range(ntypes):
7474
for jj in range(atom_numbs[ii]):
75-
ret += "{} {:f} {:f} {:f}\n".format(
76-
atom_names[ii],
77-
coordinates[cc][0],
78-
coordinates[cc][1],
79-
coordinates[cc][2],
80-
)
75+
ret += f"{atom_names[ii]} {coordinates[cc][0]:f} {coordinates[cc][1]:f} {coordinates[cc][2]:f}\n"
8176
cc += 1
8277
return ret
8378

dpgen/auto_test/reproduce.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,7 @@ def post_repro(
153153
output_ener_tot.extend(output_task_result["energies"])
154154

155155
init_epa = init_ener[jj - idid] / natoms
156-
ptr_data += "{} {:7.3f} {:7.3f} {:7.3f}\n".format(
157-
ii,
158-
init_epa,
159-
output_epa,
160-
output_epa - init_epa,
161-
)
156+
ptr_data += f"{ii} {init_epa:7.3f} {output_epa:7.3f} {output_epa - init_epa:7.3f}\n"
162157
idid += nframe
163158
output_ener = np.array(output_ener)
164159
output_ener = np.reshape(output_ener, [-1, 1])

0 commit comments

Comments
 (0)