-
Notifications
You must be signed in to change notification settings - Fork 23
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 6 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,4 +12,5 @@ | |
| "ti", | ||
| "ti_water", | ||
| "lib", | ||
| "workflows", | ||
| ] | ||
| 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,15 @@ | ||
| import os | ||
| import sys | ||
|
|
||
| from _pytest.config import Config # type: ignore | ||
|
|
||
| project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) | ||
| sys.path.insert(0, project_root) | ||
|
|
||
|
|
||
| def pytest_configure(config: Config) -> None: | ||
| """Print paths information before any test collection starts.""" | ||
| print("\n" + "=" * 50) | ||
| print(f"Running tests from: {os.path.abspath(__file__)}") | ||
| print(f"Project root: {project_root}") | ||
| print("=" * 50 + "\n") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,22 +50,21 @@ def test_spring_multiple_element(self): | |
| ret2 = dpti.hti._ff_spring(**input) | ||
| self.assertEqual(ret1, ret2) | ||
|
|
||
|
|
||
| def test_spring_var_spring_multiple_element(self): | ||
| input = {"lamb": 0.20, "m_spring_k": [118.71, 207.2], "var_spring": False} | ||
| ret1 = textwrap.dedent( | ||
| """\ | ||
| group type_1 type 1 | ||
| group type_2 type 2 | ||
| fix l_spring_1 type_1 spring/self 9.4968000000e+01 | ||
| fix_modify l_spring_1 energy yes | ||
| fix l_spring_2 type_2 spring/self 1.6576000000e+02 | ||
| fix_modify l_spring_2 energy yes | ||
| variable l_spring equal f_l_spring_1+f_l_spring_2 | ||
| """ | ||
| ) | ||
| ret2 = dpti.hti._ff_spring(**input) | ||
| self.assertEqual(ret1, ret2) | ||
| def test_spring_var_spring_multiple_element(self): | ||
| input = {"lamb": 0.20, "m_spring_k": [118.71, 207.2], "var_spring": False} | ||
| ret1 = textwrap.dedent( | ||
| """\ | ||
| group type_1 type 1 | ||
| group type_2 type 2 | ||
| fix l_spring_1 type_1 spring/self 1.1871000000e+02 | ||
| fix_modify l_spring_1 energy yes | ||
| fix l_spring_2 type_2 spring/self 2.0720000000e+02 | ||
| fix_modify l_spring_2 energy yes | ||
| variable l_spring equal f_l_spring_1+f_l_spring_2 | ||
| """ | ||
| ) | ||
| ret2 = dpti.hti._ff_spring(**input) | ||
| self.assertEqual(ret1, ret2) | ||
|
Comment on lines
+53
to
+67
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 Duplicate scenario & misleading test name
Removing redundancy will keep the suite fast and intention-revealing. 🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.