diff --git a/dpgen2/entrypoint/args.py b/dpgen2/entrypoint/args.py index 06495ad2..4e4471e5 100644 --- a/dpgen2/entrypoint/args.py +++ b/dpgen2/entrypoint/args.py @@ -198,8 +198,90 @@ def lmp_args(): ] +def run_expl_caly_conf_args(): + doc_caly_model_devi_group_size = "group size for model deviation." + doc_run_calypso_command = "command of running calypso." + doc_caly_run_dp_opt_command = "command of running optimization with dp." + return [ + Argument( + "model_devi_group_size", + int, + optional=True, + doc=doc_caly_model_devi_group_size, + ), + Argument( + "run_calypso_command", + str, + optional=True, + default="calypso.x", + doc=doc_run_calypso_command, + ), + Argument( + "run_opt_command", + str, + optional=True, + doc=doc_caly_run_dp_opt_command, + ), + ] + + +def caly_args(): + doc_config = "Configuration of calypso exploration" + doc_max_numb_iter = "Maximum number of iterations per stage" + doc_fatal_at_max = ( + "Fatal when the number of iteration per stage reaches the `max_numb_iter`" + ) + doc_output_nopbc = "Remove pbc of the output configurations" + doc_convergence = "The method of convergence check." + doc_configuration = "A list of initial configurations." + doc_stages = ( + "The definition of exploration stages of type `List[List[ExplorationTaskGroup]`. " + "The outer list provides the enumeration of the exploration stages. " + "Then each stage is defined by a list of exploration task groups. " + "Each task group is described in :ref:`the task group definition` " + ) + + return [ + Argument( + "config", + dict, + run_expl_caly_conf_args(), + optional=True, + default=RunLmp.normalize_config({}), + doc=doc_config, + ), + Argument( + "max_numb_iter", int, optional=True, default=10, doc=doc_max_numb_iter + ), + Argument( + "fatal_at_max", bool, optional=True, default=True, doc=doc_fatal_at_max + ), + Argument( + "output_nopbc", bool, optional=True, default=False, doc=doc_output_nopbc + ), + Argument( + "convergence", + dict, + [], + [variant_conv()], + optional=False, + doc=doc_convergence, + ), + Argument( + "configurations", + list, + [], + [variant_conf()], + optional=False, + repeat=True, + doc=doc_configuration, + alias=["configuration"], + ), + Argument("stages", List[List[dict]], optional=False, doc=doc_stages), + ] + + def variant_explore(): - # TODO: add calypso_args doc = "The type of the exploration" doc_lmp = "The exploration by LAMMPS simulations" doc_calypso = "The exploration by CALYPSO structure prediction" @@ -207,7 +289,9 @@ def variant_explore(): "type", [ Argument("lmp", dict, lmp_args(), doc=doc_lmp), - Argument("calypso", dict, lmp_args(), doc=doc_calypso), + Argument("calypso", dict, caly_args(), doc=doc_calypso), + Argument("calypso:default", dict, caly_args(), doc=doc_calypso), + Argument("calypso:merge", dict, caly_args(), doc=doc_calypso), ], doc=doc, ) diff --git a/dpgen2/op/run_caly_dp_optim.py b/dpgen2/op/run_caly_dp_optim.py index 7b5c5086..639c97d5 100644 --- a/dpgen2/op/run_caly_dp_optim.py +++ b/dpgen2/op/run_caly_dp_optim.py @@ -102,7 +102,7 @@ def execute( config = ip["config"] if ip["config"] is not None else {} command = config.get( - f"run_opt_command", "python -u calypso_run_opt.py {model_name}" + "run_opt_command", "python -u calypso_run_opt.py model.ckpt.pt" ) work_dir = Path(ip["task_name"])