From 8750a836b4f6685f93e8503be6d37b428ff41bf1 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Wed, 20 Jul 2022 22:33:16 -0400 Subject: [PATCH] args: add `shuffle_poscar` to run jdata (#806) * args: add `shuffle_poscar` to run jdata * Update arginfo.py * add default to shuffle_poscar Co-authored-by: Han Wang <92130845+wanghan-iapcm@users.noreply.github.com> --- dpgen/generator/arginfo.py | 2 ++ dpgen/generator/run.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dpgen/generator/arginfo.py b/dpgen/generator/arginfo.py index 48cdbbdbd..4e9307cd0 100644 --- a/dpgen/generator/arginfo.py +++ b/dpgen/generator/arginfo.py @@ -138,6 +138,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. The purpose is to sample the element occupation of alloys.' return [ model_devi_jobs_args(), @@ -171,6 +172,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=True, default=False, doc=doc_shuffle_poscar), ] diff --git a/dpgen/generator/run.py b/dpgen/generator/run.py index b51ff1428..7de7854c0 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]