From 786b8a7b20e725c0723da3fafd57cd293022f7ff Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 15 Jul 2022 21:11:36 -0500 Subject: [PATCH 1/3] args: add `shuffle_poscar` to run jdata --- dpgen/generator/arginfo.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dpgen/generator/arginfo.py b/dpgen/generator/arginfo.py index 9357ee912..2536a12b7 100644 --- a/dpgen/generator/arginfo.py +++ b/dpgen/generator/arginfo.py @@ -126,6 +126,7 @@ def model_devi_lmp_args() -> List[Argument]: doc_model_devi_clean_traj = 'If type of model_devi_clean_traj is bool type then it denote whether to clean traj folders in MD since they are too large. If it is Int type, then the most recent n iterations of traj folders will be retained, others will be removed.' doc_model_devi_nopbc = 'Assume open boundary condition in MD simulations.' doc_model_devi_activation_func = 'Set activation functions for models, length of the list should be the same as numb_models, and two elements in the list of string respectively assign activation functions to the embedding and fitting nets within each model. Backward compatibility: the orginal "list of String" format is still supported, where embedding and fitting nets of one model use the same activation function, and the length of the list should be the same as numb_models.' + doc_shuffle_poscar = 'Shuffle atoms of each frame before running simulations.' # TODO: explain the reason to do shuffle? return [ model_devi_jobs_args(), @@ -159,6 +160,7 @@ def model_devi_lmp_args() -> List[Argument]: doc=doc_model_devi_nopbc), Argument("model_devi_activation_func", list, optional=True, doc=doc_model_devi_activation_func), + Argument("shuffle_poscar", bool, optional=False, doc=doc_shuffle_poscar), ] From 4089db5e22b7f8673e60c05cbc2bc0d2db910dad Mon Sep 17 00:00:00 2001 From: Han Wang <92130845+wanghan-iapcm@users.noreply.github.com> Date: Wed, 20 Jul 2022 10:56:24 +0800 Subject: [PATCH 2/3] Update arginfo.py --- dpgen/generator/arginfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpgen/generator/arginfo.py b/dpgen/generator/arginfo.py index 2536a12b7..26d667c57 100644 --- a/dpgen/generator/arginfo.py +++ b/dpgen/generator/arginfo.py @@ -126,7 +126,7 @@ def model_devi_lmp_args() -> List[Argument]: doc_model_devi_clean_traj = 'If type of model_devi_clean_traj is bool type then it denote whether to clean traj folders in MD since they are too large. If it is Int type, then the most recent n iterations of traj folders will be retained, others will be removed.' doc_model_devi_nopbc = 'Assume open boundary condition in MD simulations.' doc_model_devi_activation_func = 'Set activation functions for models, length of the list should be the same as numb_models, and two elements in the list of string respectively assign activation functions to the embedding and fitting nets within each model. Backward compatibility: the orginal "list of String" format is still supported, where embedding and fitting nets of one model use the same activation function, and the length of the list should be the same as numb_models.' - doc_shuffle_poscar = 'Shuffle atoms of each frame before running simulations.' # TODO: explain the reason to do shuffle? + doc_shuffle_poscar = 'Shuffle atoms of each frame before running simulations. The purpose is to sample the element occupation of alloys.' return [ model_devi_jobs_args(), From 084cd1d5ec41ae97824799771afb70098a88f8e1 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Wed, 20 Jul 2022 18:39:07 -0400 Subject: [PATCH 3/3] add default to shuffle_poscar --- dpgen/generator/arginfo.py | 2 +- dpgen/generator/run.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dpgen/generator/arginfo.py b/dpgen/generator/arginfo.py index 26d667c57..02078c25d 100644 --- a/dpgen/generator/arginfo.py +++ b/dpgen/generator/arginfo.py @@ -160,7 +160,7 @@ def model_devi_lmp_args() -> List[Argument]: doc=doc_model_devi_nopbc), Argument("model_devi_activation_func", list, optional=True, doc=doc_model_devi_activation_func), - Argument("shuffle_poscar", bool, optional=False, doc=doc_shuffle_poscar), + Argument("shuffle_poscar", bool, optional=True, default=False, doc=doc_shuffle_poscar), ] diff --git a/dpgen/generator/run.py b/dpgen/generator/run.py index 43ff1bba3..53c3ed0ca 100644 --- a/dpgen/generator/run.py +++ b/dpgen/generator/run.py @@ -802,7 +802,7 @@ def make_model_devi (iter_index, sys_configs.append(temp_sys_list) else: sys_configs = jdata['sys_configs'] - shuffle_poscar = jdata['shuffle_poscar'] + shuffle_poscar = jdata.get('shuffle_poscar', False) if model_devi_engine != 'calypso': cur_job = model_devi_jobs[iter_index]