Skip to content

Commit 12a0fcb

Browse files
wanghan-iapcmHan Wang
andauthored
expand init data system if it is a str (#55)
Co-authored-by: Han Wang <wang_han@iapcm.ac.cn>
1 parent 42de137 commit 12a0fcb

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

dpgen2/entrypoint/submit.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@
8181
}
8282
)
8383

84+
def expand_sys_str(root_dir: Union[str, Path]) -> List[str]:
85+
root_dir = Path(root_dir)
86+
matches = [str(d) for d in root_dir.rglob("*") if (d / "type.raw").is_file()]
87+
if (root_dir / "type.raw").is_file():
88+
matches.append(str(root_dir))
89+
return matches
90+
8491
def make_concurrent_learning_op (
8592
train_style : str = 'dp',
8693
explore_style : str = 'lmp',
@@ -329,7 +336,10 @@ def workflow_concurrent_learning(
329336
)
330337
fp_arti = upload_artifact(
331338
dump_object_to_file(fp_inputs, 'vasp_inputs.dat'))
332-
init_data = upload_artifact(config['init_data_sys'])
339+
init_data = config['init_data_sys']
340+
if isinstance(init_data,str):
341+
init_data = expand_sys_str(init_data)
342+
init_data = upload_artifact(init_data)
333343
iter_data = upload_artifact([])
334344
if init_models_paths is not None:
335345
init_models = upload_artifact(init_models_paths)

0 commit comments

Comments
 (0)