Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
pip install -e .[test]
pip install mock coverage pytest
- name: Test
run: SKIP_UT_WITH_DFLOW=0 DFLOW_DEBUG=1 coverage run --source=./dpgen2 -m unittest -v -f && coverage report
run: SKIP_UT_WITH_DFLOW=0 DFLOW_DEBUG=1 coverage run --source=./dpgen2 -m unittest -v && coverage report
- uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ tests/caly-*
tests/coll-*
tests/dpgen-*
tests/upload
upload/
tests/init_data/
tests/incar
tests/potcar
Expand Down
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ repos:
# Python
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.3
rev: v0.12.12
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
Expand Down
5 changes: 3 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
import os
import sys
from datetime import (
date,
datetime,
timezone,
)

# -- Project information -----------------------------------------------------

project = "DPGEN2"
copyright = "2022-%d, DeepModeling" % date.today().year
copyright = "2022-%d, DeepModeling" % datetime.now(timezone.utc).year
author = "DeepModeling"


Expand Down
4 changes: 1 addition & 3 deletions dpgen2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
try:
from ._version import version as __version__
except ImportError:
from .__about__ import (
__version__,
)
from .__about__ import __version__ as __version__
7 changes: 7 additions & 0 deletions dpgen2/conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@
"alloy": AlloyConfGenerator,
"file": FileConfGenerator,
}

__all__ = [
"AlloyConfGenerator",
"ConfGenerator",
"FileConfGenerator",
"conf_styles",
]
2 changes: 0 additions & 2 deletions dpgen2/conf/alloy_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
)
from typing import (
List,
Optional,
Tuple,
Union,
)
Expand All @@ -14,7 +13,6 @@
import numpy as np
from dargs import (
Argument,
Variant,
)

from .conf_generator import (
Expand Down
3 changes: 0 additions & 3 deletions dpgen2/conf/file_conf.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import glob
import os
from pathlib import (
Path,
)
from typing import (
List,
Optional,
Tuple,
Union,
)

import dpdata
from dargs import (
Argument,
Variant,
)

from .conf_generator import (
Expand Down
5 changes: 0 additions & 5 deletions dpgen2/entrypoint/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@
Variant,
)

import dpgen2
from dpgen2.conf import (
conf_styles,
)
from dpgen2.constants import (
default_image,
)
from dpgen2.exploration.report import (
conv_styles,
)
Expand Down Expand Up @@ -83,7 +79,6 @@ def dp_dist_train_args():

def dp_train_args():
doc_numb_models = "Number of models trained for evaluating the model deviation"
doc_config = "Configuration of training"
doc_template_script = "File names of the template training script. It can be a `List[str]`, the length of which is the same as `numb_models`. Each template script in the list is used to train a model. Can be a `str`, the models share the same template training script. "
doc_init_models_paths = "the paths to initial models"
doc_init_models_uri = "The URI of initial models"
Expand Down
8 changes: 0 additions & 8 deletions dpgen2/entrypoint/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,16 @@
Path,
)
from typing import (
Dict,
List,
Optional,
Union,
)

import dflow

from dpgen2.utils import (
bohrium_config_from_dict,
dump_object_to_file,
load_object_from_file,
matched_step_key,
print_keys_in_nice_format,
sort_slice_ops,
workflow_config_from_dict,
)
from dpgen2.utils.step_config import normalize as normalize_step_dict


def global_config_workflow(
Expand Down
4 changes: 0 additions & 4 deletions dpgen2/entrypoint/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Dict,
List,
Optional,
Union,
)

from dflow import (
Expand All @@ -14,9 +13,6 @@
from dpgen2.entrypoint.common import (
global_config_workflow,
)
from dpgen2.utils.dflow_query import (
matched_step_key,
)
from dpgen2.utils.download_dpgen2_artifacts import (
download_dpgen2_artifacts,
download_dpgen2_artifacts_by_def,
Expand Down
15 changes: 1 addition & 14 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 All @@ -41,11 +31,8 @@
status,
)
from .submit import (
make_concurrent_learning_op,
make_naive_exploration_scheduler,
resubmit_concurrent_learning,
submit_concurrent_learning,
workflow_concurrent_learning,
)
from .watch import (
default_watching_keys,
Expand Down Expand Up @@ -327,7 +314,7 @@ def main():
logging.basicConfig(level=logging.INFO)

args = parse_args()
dict_args = vars(args)
vars(args)

if args.command == "submit":
with open(args.CONFIG) as fp:
Expand Down
11 changes: 3 additions & 8 deletions dpgen2/entrypoint/showkey.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import glob
import os
import pickle
from pathlib import (
Path,
)
import functools
import operator

import dpdata
from dflow import (
Workflow,
)
Expand All @@ -32,7 +27,7 @@ def showkey(

wf = Workflow(id=wf_id)
folded_keys = get_resubmit_keys(wf)
all_step_keys = sum(folded_keys.values(), [])
all_step_keys = functools.reduce(operator.iadd, folded_keys.values(), [])
prt_str = print_keys_in_nice_format(
all_step_keys,
["run-train", "run-lmp", "run-fp", "diffcsp-gen", "run-relax"],
Expand Down
3 changes: 0 additions & 3 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 All @@ -15,7 +13,6 @@
global_config_workflow,
)
from dpgen2.utils.dflow_query import (
get_all_schedulers,
get_last_scheduler,
)

Expand Down
Loading
Loading