Skip to content

Commit

Permalink
fix: fix UT
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzyphysics committed Mar 28, 2024
1 parent 1905100 commit 399af96
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 71 deletions.
28 changes: 14 additions & 14 deletions tests/test_caly_evo_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@
except ModuleNotFoundError:
# case of upload everything to argo, no context needed
pass
from context import (
default_host,
default_image,
skip_ut_with_dflow,
skip_ut_with_dflow_reason,
upload_python_packages,
)
from mocked_ops import (
MockedCollRunCaly,
MockedPrepDPOptim,
MockedRunDPOptim,
mocked_numb_models,
)

from dpgen2.constants import (
lmp_conf_name,
lmp_input_name,
Expand Down Expand Up @@ -82,20 +96,6 @@
)
from dpgen2.utils.step_config import normalize as normalize_step_dict

from .context import (
default_host,
default_image,
skip_ut_with_dflow,
skip_ut_with_dflow_reason,
upload_python_packages,
)
from .mocked_ops import (
MockedCollRunCaly,
MockedPrepDPOptim,
MockedRunDPOptim,
mocked_numb_models,
)

default_config = normalize_step_dict(
{
"template_config": {
Expand Down
4 changes: 2 additions & 2 deletions tests/test_collect_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
except ModuleNotFoundError:
# case of upload everything to argo, no context needed
pass
from .context import (
from context import (
default_host,
default_image,
skip_ut_with_dflow,
skip_ut_with_dflow_reason,
upload_python_packages,
)
from .mocked_ops import (
from mocked_ops import (
MockedCollectData,
)

Expand Down
28 changes: 14 additions & 14 deletions tests/test_prep_run_caly.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@
except ModuleNotFoundError:
# case of upload everything to argo, no context needed
pass
from context import (
default_host,
default_image,
skip_ut_with_dflow,
skip_ut_with_dflow_reason,
upload_python_packages,
)
from mocked_ops import (
MockedCollRunCaly,
MockedRunCalyModelDevi,
MockedRunDPOptim,
mocked_numb_models,
)

from dpgen2.exploration.task import (
BaseExplorationTaskGroup,
ExplorationTask,
Expand All @@ -72,20 +86,6 @@
)
from dpgen2.utils.step_config import normalize as normalize_step_dict

from .context import (
default_host,
default_image,
skip_ut_with_dflow,
skip_ut_with_dflow_reason,
upload_python_packages,
)
from .mocked_ops import (
MockedCollRunCaly,
MockedRunCalyModelDevi,
MockedRunDPOptim,
mocked_numb_models,
)

prep_default_config = normalize_step_dict(
{
"template_config": {
Expand Down
22 changes: 11 additions & 11 deletions tests/test_prep_run_dp_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,14 @@
except ModuleNotFoundError:
# case of upload everything to argo, no context needed
pass
from dpgen2.constants import (
train_task_pattern,
)
from dpgen2.superop.prep_run_dp_train import (
ModifyTrainScript,
PrepRunDPTrain,
)
from dpgen2.utils.step_config import normalize as normalize_step_dict

from .context import (
from context import (
default_host,
default_image,
skip_ut_with_dflow,
skip_ut_with_dflow_reason,
upload_python_packages,
)
from .mocked_ops import (
from mocked_ops import (
MockedModifyTrainScript,
MockedPrepDPTrain,
MockedRunDPTrain,
Expand All @@ -69,6 +60,15 @@
mocked_template_script,
)

from dpgen2.constants import (
train_task_pattern,
)
from dpgen2.superop.prep_run_dp_train import (
ModifyTrainScript,
PrepRunDPTrain,
)
from dpgen2.utils.step_config import normalize as normalize_step_dict

default_config = normalize_step_dict(
{
"template_config": {
Expand Down
24 changes: 12 additions & 12 deletions tests/test_prep_run_lmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@
except ModuleNotFoundError:
# case of upload everything to argo, no context needed
pass
from context import (
default_host,
default_image,
skip_ut_with_dflow,
skip_ut_with_dflow_reason,
upload_python_packages,
)
from mocked_ops import (
MockedRunLmp,
mocked_numb_models,
)

from dpgen2.constants import (
lmp_conf_name,
lmp_input_name,
Expand All @@ -68,18 +80,6 @@
)
from dpgen2.utils.step_config import normalize as normalize_step_dict

from .context import (
default_host,
default_image,
skip_ut_with_dflow,
skip_ut_with_dflow_reason,
upload_python_packages,
)
from .mocked_ops import (
MockedRunLmp,
mocked_numb_models,
)

default_config = normalize_step_dict(
{
"template_config": {
Expand Down
26 changes: 13 additions & 13 deletions tests/test_prep_run_vasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@
except ModuleNotFoundError:
# case of upload everything to argo, no context needed
pass
from context import (
default_host,
default_image,
skip_ut_with_dflow,
skip_ut_with_dflow_reason,
upload_python_packages,
)
from mocked_ops import (
MockedPrepVasp,
MockedRunVasp,
mocked_incar_template,
)

from dpgen2.constants import (
fp_task_pattern,
)
Expand All @@ -57,19 +70,6 @@
)
from dpgen2.utils.step_config import normalize as normalize_step_dict

from .context import (
default_host,
default_image,
skip_ut_with_dflow,
skip_ut_with_dflow_reason,
upload_python_packages,
)
from .mocked_ops import (
MockedPrepVasp,
MockedRunVasp,
mocked_incar_template,
)

default_config = normalize_step_dict(
{
"template_config": {
Expand Down
10 changes: 5 additions & 5 deletions tests/test_select_confs.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@
except ModuleNotFoundError:
# case of upload everything to argo, no context needed
pass
from dpgen2.op.select_confs import (
SelectConfs,
)

from .mocked_ops import (
from mocked_ops import (
MockedConfSelector,
MockedExplorationReport,
MockedSelectConfs,
)

from dpgen2.op.select_confs import (
SelectConfs,
)


class TestMockedSelectConfs(unittest.TestCase):
def setUp(self):
Expand Down

0 comments on commit 399af96

Please sign in to comment.