-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update deepmd input to v2; format JSON files (#1315)
This PR updates all JSON files: - convert `default_training_param` to v2 format - format JSON files - update `_comment` to `_commentN` to avoid duplicated keys - enable `check-json` and `pretty-format-json` hooks ```py import json from glob import glob from deepmd.utils.compat import update_deepmd_input, convert_input_v1_v2 for ii in glob("**/*.json", recursive=True): with open(ii) as f: content = f.read() count = 1 while True: if r'"_comment"' not in content: break content = content.replace('"_comment"', '"_comment%d"' % count, 1) count += 1 try: jdata = json.loads(content) except Exception as e: print(ii, e) continue if "default_training_param" in jdata: jdata["default_training_param"] = update_deepmd_input( jdata["default_training_param"], warning=False) if "decay_rate" in jdata["default_training_param"]["learning_rate"]: jdata["default_training_param"] = convert_input_v1_v2( jdata["default_training_param"], warning=False) if "load_ckpt" in jdata["default_training_param"]["training"]: del jdata["default_training_param"]["training"]["load_ckpt"] content = json.dumps(jdata, indent=2) with open(ii, "w") as f: f.write(content) ``` --------- Signed-off-by: Jinzhe Zeng <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
0761763
commit 2a25606
Showing
184 changed files
with
13,612 additions
and
7,972 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,36 @@ | ||
{ | ||
"cell_type": "diamond", | ||
"latt": 2.5, | ||
"super_cell": [1, 1, 1], | ||
"elements": ["Al"], | ||
"potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR" | ||
], | ||
"encut": 600, | ||
"kspacing_relax": 0.16, | ||
"kspacing_md": 0.08, | ||
"kgamma": false, | ||
"scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06], | ||
"skip_relax": false, | ||
"pert_numb": 100, | ||
"pert_box": 0.03, | ||
"pert_atom": 0.01, | ||
"md_temp": 100, | ||
"md_nstep": 10, | ||
"deepgen_templ": "../generator/template/", | ||
"coll_ndata": 5000, | ||
"_comment": "that's all" | ||
"cell_type": "diamond", | ||
"latt": 2.5, | ||
"super_cell": [ | ||
1, | ||
1, | ||
1 | ||
], | ||
"elements": [ | ||
"Al" | ||
], | ||
"potcars": [ | ||
"/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR" | ||
], | ||
"encut": 600, | ||
"kspacing_relax": 0.16, | ||
"kspacing_md": 0.08, | ||
"kgamma": false, | ||
"scale": [ | ||
0.96, | ||
0.98, | ||
1.0, | ||
1.02, | ||
1.04, | ||
1.06 | ||
], | ||
"skip_relax": false, | ||
"pert_numb": 100, | ||
"pert_box": 0.03, | ||
"pert_atom": 0.01, | ||
"md_temp": 100, | ||
"md_nstep": 10, | ||
"deepgen_templ": "../generator/template/", | ||
"coll_ndata": 5000, | ||
"_comment1": "that's all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,36 @@ | ||
{ | ||
"cell_type": "diamond", | ||
"latt": 2.5, | ||
"super_cell": [2, 2, 2], | ||
"elements": ["Al"], | ||
"potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR" | ||
], | ||
"encut": 600, | ||
"kspacing_relax": 0.16, | ||
"kspacing_md": 0.08, | ||
"kgamma": false, | ||
"scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06], | ||
"skip_relax": false, | ||
"pert_numb": 100, | ||
"pert_box": 0.03, | ||
"pert_atom": 0.01, | ||
"md_temp": 100, | ||
"md_nstep": 10, | ||
"deepgen_templ": "../template/", | ||
"coll_ndata": 5000, | ||
"_comment": "that's all" | ||
"cell_type": "diamond", | ||
"latt": 2.5, | ||
"super_cell": [ | ||
2, | ||
2, | ||
2 | ||
], | ||
"elements": [ | ||
"Al" | ||
], | ||
"potcars": [ | ||
"/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR" | ||
], | ||
"encut": 600, | ||
"kspacing_relax": 0.16, | ||
"kspacing_md": 0.08, | ||
"kgamma": false, | ||
"scale": [ | ||
0.96, | ||
0.98, | ||
1.0, | ||
1.02, | ||
1.04, | ||
1.06 | ||
], | ||
"skip_relax": false, | ||
"pert_numb": 100, | ||
"pert_box": 0.03, | ||
"pert_atom": 0.01, | ||
"md_temp": 100, | ||
"md_nstep": 10, | ||
"deepgen_templ": "../template/", | ||
"coll_ndata": 5000, | ||
"_comment1": "that's all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,36 @@ | ||
{ | ||
"cell_type": "fcc", | ||
"latt": 4.04, | ||
"super_cell": [1, 1, 1], | ||
"elements": ["Al"], | ||
"potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR" | ||
], | ||
"encut": 600, | ||
"kspacing_relax": 0.16, | ||
"kspacing_md": 0.06, | ||
"kgamma": false, | ||
"scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06], | ||
"skip_relax": true, | ||
"pert_numb": 100, | ||
"pert_box": 0.03, | ||
"pert_atom": 0.01, | ||
"md_temp": 100, | ||
"md_nstep": 10, | ||
"deepgen_templ": "../template/", | ||
"coll_ndata": 5000, | ||
"_comment": "that's all" | ||
"cell_type": "fcc", | ||
"latt": 4.04, | ||
"super_cell": [ | ||
1, | ||
1, | ||
1 | ||
], | ||
"elements": [ | ||
"Al" | ||
], | ||
"potcars": [ | ||
"/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR" | ||
], | ||
"encut": 600, | ||
"kspacing_relax": 0.16, | ||
"kspacing_md": 0.06, | ||
"kgamma": false, | ||
"scale": [ | ||
0.96, | ||
0.98, | ||
1.0, | ||
1.02, | ||
1.04, | ||
1.06 | ||
], | ||
"skip_relax": true, | ||
"pert_numb": 100, | ||
"pert_box": 0.03, | ||
"pert_atom": 0.01, | ||
"md_temp": 100, | ||
"md_nstep": 10, | ||
"deepgen_templ": "../template/", | ||
"coll_ndata": 5000, | ||
"_comment1": "that's all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,36 @@ | ||
{ | ||
"cell_type": "fcc", | ||
"latt": 4.04, | ||
"super_cell": [2, 2, 2], | ||
"elements": ["Al"], | ||
"potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR" | ||
], | ||
"encut": 600, | ||
"kspacing_relax": 0.16, | ||
"kspacing_md": 0.06, | ||
"kgamma": false, | ||
"scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06], | ||
"skip_relax": true, | ||
"pert_numb": 100, | ||
"pert_box": 0.03, | ||
"pert_atom": 0.01, | ||
"md_temp": 100, | ||
"md_nstep": 10, | ||
"deepgen_templ": "../template/", | ||
"coll_ndata": 5000, | ||
"_comment": "that's all" | ||
"cell_type": "fcc", | ||
"latt": 4.04, | ||
"super_cell": [ | ||
2, | ||
2, | ||
2 | ||
], | ||
"elements": [ | ||
"Al" | ||
], | ||
"potcars": [ | ||
"/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR" | ||
], | ||
"encut": 600, | ||
"kspacing_relax": 0.16, | ||
"kspacing_md": 0.06, | ||
"kgamma": false, | ||
"scale": [ | ||
0.96, | ||
0.98, | ||
1.0, | ||
1.02, | ||
1.04, | ||
1.06 | ||
], | ||
"skip_relax": true, | ||
"pert_numb": 100, | ||
"pert_box": 0.03, | ||
"pert_atom": 0.01, | ||
"md_temp": 100, | ||
"md_nstep": 10, | ||
"deepgen_templ": "../template/", | ||
"coll_ndata": 5000, | ||
"_comment1": "that's all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,36 @@ | ||
{ | ||
"cell_type": "hcp", | ||
"latt": 4.04, | ||
"super_cell": [1, 1, 1], | ||
"elements": ["Al"], | ||
"potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR" | ||
], | ||
"encut": 600, | ||
"kspacing_relax": 0.16, | ||
"kspacing_md": 0.06, | ||
"kgamma": false, | ||
"scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06], | ||
"skip_relax": false, | ||
"pert_numb": 100, | ||
"pert_box": 0.03, | ||
"pert_atom": 0.01, | ||
"md_temp": 100, | ||
"md_nstep": 10, | ||
"deepgen_templ": "../template/", | ||
"coll_ndata": 5000, | ||
"_comment": "that's all" | ||
"cell_type": "hcp", | ||
"latt": 4.04, | ||
"super_cell": [ | ||
1, | ||
1, | ||
1 | ||
], | ||
"elements": [ | ||
"Al" | ||
], | ||
"potcars": [ | ||
"/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR" | ||
], | ||
"encut": 600, | ||
"kspacing_relax": 0.16, | ||
"kspacing_md": 0.06, | ||
"kgamma": false, | ||
"scale": [ | ||
0.96, | ||
0.98, | ||
1.0, | ||
1.02, | ||
1.04, | ||
1.06 | ||
], | ||
"skip_relax": false, | ||
"pert_numb": 100, | ||
"pert_box": 0.03, | ||
"pert_atom": 0.01, | ||
"md_temp": 100, | ||
"md_nstep": 10, | ||
"deepgen_templ": "../template/", | ||
"coll_ndata": 5000, | ||
"_comment1": "that's all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,36 @@ | ||
{ | ||
"cell_type": "hcp", | ||
"latt": 4.04, | ||
"super_cell": [2, 2, 2], | ||
"elements": ["Al"], | ||
"potcars": ["/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR" | ||
], | ||
"encut": 600, | ||
"kspacing_relax": 0.16, | ||
"kspacing_md": 0.06, | ||
"kgamma": false, | ||
"scale": [0.96, 0.98, 1.00, 1.02, 1.04, 1.06], | ||
"skip_relax": false, | ||
"pert_numb": 100, | ||
"pert_box": 0.03, | ||
"pert_atom": 0.01, | ||
"md_temp": 100, | ||
"md_nstep": 10, | ||
"deepgen_templ": "../template/", | ||
"coll_ndata": 5000, | ||
"_comment": "that's all" | ||
"cell_type": "hcp", | ||
"latt": 4.04, | ||
"super_cell": [ | ||
2, | ||
2, | ||
2 | ||
], | ||
"elements": [ | ||
"Al" | ||
], | ||
"potcars": [ | ||
"/home/wanghan/Soft/vasp/potcar.unknown/potpaw_PBE/Al/POTCAR" | ||
], | ||
"encut": 600, | ||
"kspacing_relax": 0.16, | ||
"kspacing_md": 0.06, | ||
"kgamma": false, | ||
"scale": [ | ||
0.96, | ||
0.98, | ||
1.0, | ||
1.02, | ||
1.04, | ||
1.06 | ||
], | ||
"skip_relax": false, | ||
"pert_numb": 100, | ||
"pert_box": 0.03, | ||
"pert_atom": 0.01, | ||
"md_temp": 100, | ||
"md_nstep": 10, | ||
"deepgen_templ": "../template/", | ||
"coll_ndata": 5000, | ||
"_comment1": "that's all" | ||
} |
Oops, something went wrong.