Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions dpgen2/entrypoint/main.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
import argparse
import json
import logging
import os
import textwrap
from typing import (
List,
Optional,
)

import dflow
from dflow import (
Step,
Steps,
Workflow,
download_artifact,
upload_artifact,
)

from dpgen2 import (
__version__,
)
Expand Down
8 changes: 0 additions & 8 deletions dpgen2/entrypoint/showkey.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
import glob
import os
import pickle
from pathlib import (
Path,
)

import dpdata
from dflow import (
Workflow,
)
Expand Down
2 changes: 0 additions & 2 deletions dpgen2/entrypoint/status.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import logging
from typing import (
Dict,
List,
Optional,
Union,
)

from dflow import (
Expand Down
9 changes: 1 addition & 8 deletions dpgen2/entrypoint/submit.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import copy
import glob
import json
import logging
import os
import pickle
import re
from copy import (
deepcopy,
)
Expand All @@ -15,12 +12,8 @@
Dict,
List,
Optional,
Tuple,
Type,
Union,
)

import dpdata
from dflow import (
ArgoStep,
InputArtifact,
Expand Down Expand Up @@ -588,7 +581,7 @@ def workflow_concurrent_learning(
if fp_style == "deepmd":
assert (
"teacher_model_path" in fp_config["run"]
), f"Cannot find 'teacher_model_path' in config['fp']['run_config'] when fp_style == 'deepmd'"
), "Cannot find 'teacher_model_path' in config['fp']['run_config'] when fp_style == 'deepmd'"
assert os.path.exists(
fp_config["run"]["teacher_model_path"]
), f"No such file: {fp_config['run']['teacher_model_path']}"
Expand Down
10 changes: 5 additions & 5 deletions dpgen2/entrypoint/watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
Dict,
List,
Optional,
Union,
)

from dflow import (
Expand Down Expand Up @@ -43,28 +42,29 @@ def update_finished_steps(
if finished_keys is not None:
diff_keys = []
for kk in wf_keys:
if not (kk in finished_keys):
if kk not in finished_keys:
diff_keys.append(kk)
else:
diff_keys = wf_keys
for kk in diff_keys:
logging.info(f'steps {kk.ljust(50,"-")} finished')
logging.info(f"steps {kk.ljust(50, '-')} finished")
if download:
download_dpgen2_artifacts(wf, kk, prefix=prefix, chk_pnt=chk_pnt)
logging.info(f'steps {kk.ljust(50,"-")} downloaded')
logging.info(f"steps {kk.ljust(50, '-')} downloaded")
finished_keys = wf_keys
return finished_keys


def watch(
workflow_id,
wf_config: Optional[Dict] = {},
wf_config: Optional[dict] = None,
watching_keys: Optional[List] = default_watching_keys,
frequency: float = 600.0,
download: bool = False,
prefix: Optional[str] = None,
chk_pnt: bool = False,
):
wf_config = wf_config or {}
wf_config = normalize_args(wf_config)

global_config_workflow(wf_config)
Expand Down
6 changes: 2 additions & 4 deletions dpgen2/entrypoint/workflow.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import argparse
import json
import logging
import os
from typing import (
Optional,
)
Expand Down Expand Up @@ -38,8 +35,9 @@ def add_subparser_workflow_subcommand(subparsers, command: str):
def execute_workflow_subcommand(
command: str,
wfid: str,
wf_config: Optional[dict] = {},
wf_config: Optional[dict] = None,
):
wf_config = wf_config or {}
wf_config = normalize_args(wf_config)
global_config_workflow(wf_config)
wf = Workflow(id=wfid)
Expand Down
5 changes: 0 additions & 5 deletions dpgen2/fp/prep_fp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import json
import os
from abc import (
ABC,
abstractmethod,
Expand All @@ -9,11 +7,8 @@
)
from typing import (
Any,
Dict,
List,
Set,
Tuple,
Union,
)

import dpdata
Expand Down
3 changes: 0 additions & 3 deletions dpgen2/fp/run_fp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import json
import os
from abc import (
ABC,
Expand All @@ -10,12 +9,10 @@
from typing import (
Dict,
List,
Set,
Tuple,
)

import dargs
import dpdata
from dflow.python import (
OP,
OPIO,
Expand Down
4 changes: 0 additions & 4 deletions dpgen2/fp/vasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@
Path,
)
from typing import (
Dict,
List,
Optional,
Set,
Tuple,
Union,
)

import dpdata
Expand Down
1 change: 0 additions & 1 deletion dpgen2/fp/vasp_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
Union,
)

import dpdata
import numpy as np
from dargs import (
Argument,
Expand Down