-
Notifications
You must be signed in to change notification settings - Fork 21
And example CLI command and fix small bugs #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Changes from all commits
1fcd98d
8eb9a7e
30e985f
c8abe54
cffdc41
0deff46
effdd95
fc61bcb
3eaa6bc
ccf268c
e3943b3
662f792
2b030ca
2887179
f8edc61
c0d6eaa
ebf7b9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,19 @@ | ||||||||||
# NPT | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add a shebang and enable strict mode for portability and safety. Without a shebang, the script may run under an unexpected shell. Enabling strict mode ( Apply this diff: +#!/usr/bin/env bash
+set -euo pipefail 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Shellcheck (0.10.0)[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. (SC2148) 🤖 Prompt for AI Agents
|
||||||||||
dpti equi gen npt.json -e npt-xy -t 200 -p 20000 -o NPT_sim/ | ||||||||||
# cd NPT_sim/new_job/ | ||||||||||
dpti equi extract ./ -o npt_avg.lmp | ||||||||||
|
||||||||||
# NVT | ||||||||||
dpti equi gen equi_settings.json --ensemble nvt -t 200 -p 20000 --conf-npt ./NPT_sim/new_job/ -o NVT_sim/ | ||||||||||
# cd NVT_sim/new_job/ | ||||||||||
dpti equi extract ./ -o nvt_last_dump.lmp | ||||||||||
|
||||||||||
# HTI | ||||||||||
dpti hti gen hti.json -s three-step -o HTI_sim/ | ||||||||||
# dpti hti_water gen hti_water.json -o HTI_water/ | ||||||||||
# dpti hti_ice gen hti_ice.json -s three-step -o HTI_ice/ | ||||||||||
dpti hti compute ./new_job/ -t gibbs --npt ../NPT_sim/new_job/ | ||||||||||
|
||||||||||
# TI | ||||||||||
dpti ti gen ti_settings.json -o TI_sim/ | ||||||||||
dpti ti compute ./TI_sim/new_job/ --hti ../HTI_sim/new_job/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
beta.lmp |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"equi_conf": null, | ||
"equi_conf": "nvt_last_dump.lmp", | ||
"ncopies": [ | ||
1, | ||
1, | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,3 @@ | ||||||||||||||
wget https://huggingface.co/Felix5572/Sn-SCAN-Compressed/resolve/main/graph.pb -O Sn_SCAN_compressed.pb | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add she-bang and fail-fast options for predictable execution Without a she-bang the script’s interpreter is ambiguous (SC2148). +#!/usr/bin/env bash
+# Download compressed DeepPot models required by example workflows
+set -euo pipefail
+
wget https://huggingface.co/Felix5572/Sn-SCAN-Compressed/resolve/main/graph.pb -O Sn_SCAN_compressed.pb 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Shellcheck (0.10.0)[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. (SC2148) 🤖 Prompt for AI Agents
|
||||||||||||||
|
||||||||||||||
wget https://huggingface.co/Felix5572/Water-Ice-SCAN-Phase-Dirgram/resolve/main/graph.pb -O H2O-Phase-Diagram-model_compressed.pb |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../H2O-Phase-Diagram-model_compressed.pb |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,37 @@ | ||||||||||||||||||||
# docker pull yfb222333/dpti-lammps-fep:latest | ||||||||||||||||||||
# docker run -it --gpus all dpti-lammps-fep:latest | ||||||||||||||||||||
# all in /opt/ | ||||||||||||||||||||
# all files in /opt/dpti/examples/water_SCAN/ice04/ | ||||||||||||||||||||
|
||||||||||||||||||||
Comment on lines
+1
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add shebang line for proper shell script execution. The workflow documentation is excellent and provides clear guidance for users. However, the script should include a shebang line to specify the shell interpreter. Add this line at the beginning of the file: +#!/bin/bash
# docker pull yfb222333/dpti-lammps-fep:latest
# docker run -it --gpus all dpti-lammps-fep:latest
# all in /opt/
# all files in /opt/dpti/examples/water_SCAN/ice04/ 📝 Committable suggestion
Suggested change
🧰 Tools🪛 Shellcheck (0.10.0)[error] 1-1: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive. (SC2148) 🤖 Prompt for AI Agents
|
||||||||||||||||||||
#NPT | ||||||||||||||||||||
dpti equi gen npt.json -o npt/ | ||||||||||||||||||||
|
||||||||||||||||||||
# submit jobs `lmp -i in.lammps` for npt/ | ||||||||||||||||||||
|
||||||||||||||||||||
dpti equi extract ./npt/ -o npt_avg.lmp # extract average | ||||||||||||||||||||
|
||||||||||||||||||||
# NVT | ||||||||||||||||||||
dpti equi gen nvt.json -o nvt/ | ||||||||||||||||||||
|
||||||||||||||||||||
# submit jobs `lmp -i in.lammps` for nvt/ | ||||||||||||||||||||
|
||||||||||||||||||||
dpti equi extract ./nvt/ -o nvt_last_dump.lmp # extract average | ||||||||||||||||||||
|
||||||||||||||||||||
## HTI (hti,hti_liq, hti_water, hti_ice) module | ||||||||||||||||||||
dpti hti_ice gen hti_ice.json -s three-step -o hti/ | ||||||||||||||||||||
|
||||||||||||||||||||
# submit jobs `lmp -i in.lammps` for subdirs like `hti/0*/task*/` | ||||||||||||||||||||
|
||||||||||||||||||||
dpti hti_ice compute ./hti/ -t gibbs --npt ./npt/ # note use NPT simulation usually longer steps, and the P*V value is more accurate | ||||||||||||||||||||
|
||||||||||||||||||||
# result txt in ./hti/result | ||||||||||||||||||||
|
||||||||||||||||||||
## TI (ti, ti_water) module | ||||||||||||||||||||
|
||||||||||||||||||||
dpti ti_water gen path-t.json -o ti_path_t/ | ||||||||||||||||||||
|
||||||||||||||||||||
# submit jobs `lmp -i in.lammps` for subdirs like `ti_path_t/task*/` | ||||||||||||||||||||
|
||||||||||||||||||||
dpti ti_water compute ./ti_path_t/ --hti ./hti/ # HTI simulation (starting point, gibbs free energy value) | ||||||||||||||||||||
|
||||||||||||||||||||
# final result for a ti-line txt in ./ti_path_t/result |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ice04.lmp |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../H2O-Phase-Diagram-model_compressed.pb |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"equi_conf": "nvt_last_dump.lmp", | ||
"ncopies": [ | ||
1, | ||
1, | ||
1 | ||
], | ||
"lambda_lj_on": [ | ||
"0.000:0.100:0.0125", | ||
"0.100:0.200:0.025", | ||
"0.200:1.000:0.2", | ||
"1" | ||
], | ||
"lambda_deep_on": [ | ||
"0.0:0.1:0.025", | ||
"0.1:1.0:0.1125", | ||
"1" | ||
], | ||
"lambda_spring_off": [ | ||
"0.000:0.750:0.125", | ||
"0.750:0.875:0.0625", | ||
"0.875:1.000:0.03125", | ||
"1" | ||
], | ||
"protect_eps": 1e-08, | ||
"model": "graph.pb", | ||
"model_mass_map": [ | ||
16, | ||
2 | ||
], | ||
"spring_k": 0.5, | ||
"soft_param": { | ||
"epsilon": 0.02, | ||
"sigma_oo": 3.15, | ||
"sigma_oh": 0.987, | ||
"sigma_hh": 0.987, | ||
"activation": 0.5, | ||
"n": 1.0, | ||
"alpha_lj": 0.5, | ||
"rcut": 6.0, | ||
"_comment": "that's all" | ||
}, | ||
"crystal": "frenkel", | ||
"langevin": true, | ||
"nsteps": 200000, | ||
"dt": 0.0005, | ||
"stat_freq": 10, | ||
"stat_skip": 10000, | ||
"stat_bsize": 2000, | ||
"temp": 150.000000, | ||
"_comment": "that's all" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Improve resource management while maintaining the fallback logic.
The fallback mechanism from
jdata.json
toequi_settings.json
is a good improvement for compatibility. However, the file opening should use context managers to ensure proper resource cleanup.Apply this diff to improve resource management:
📝 Committable suggestion
🧰 Tools
🪛 Pylint (3.3.7)
[refactor] 1336-1336: Consider using 'with' for resource-allocating operations
(R1732)
[refactor] 1338-1338: Consider using 'with' for resource-allocating operations
(R1732)
🤖 Prompt for AI Agents