Skip to content

Commit

Permalink
move to ruff formatter (#181)
Browse files Browse the repository at this point in the history
See https://astral.sh/blog/the-ruff-formatter.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
njzjz and pre-commit-ci[bot] committed Dec 19, 2023
1 parent faf582e commit 71f2918
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ repos:
- id: check-symlinks
- id: check-toml
# Python
- repo: https://github.com/psf/black
rev: 22.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.1.3
hooks:
- id: black-jupyter
- id: ruff-format
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
Expand Down
1 change: 0 additions & 1 deletion dpgen2/entrypoint/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ def workflow_concurrent_learning(
)

if config["inputs"].get("do_finetune", False):

finetune_step = make_finetune_step(
config,
prep_train_config,
Expand Down
1 change: 1 addition & 0 deletions dpgen2/exploration/deviation/deviation_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

class DeviManager(ABC):
r"""A class for model deviation management."""

MAX_DEVI_V = "max_devi_v"
MIN_DEVI_V = "min_devi_v"
AVG_DEVI_V = "avg_devi_v"
Expand Down
5 changes: 4 additions & 1 deletion dpgen2/exploration/task/lmp_template_task_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ def _make_lmp_task(
plm_cont: Optional[str] = None,
) -> ExplorationTask:
task = ExplorationTask()
task.add_file(lmp_conf_name, conf,).add_file(
task.add_file(
lmp_conf_name,
conf,
).add_file(
lmp_input_name,
lmp_cont,
)
Expand Down
5 changes: 4 additions & 1 deletion dpgen2/exploration/task/npt_task_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ def _make_lmp_task(
pp: Optional[float],
) -> ExplorationTask:
task = ExplorationTask()
task.add_file(lmp_conf_name, conf,).add_file(
task.add_file(
lmp_conf_name,
conf,
).add_file(
lmp_input_name,
make_lmp_input(
lmp_conf_name,
Expand Down
3 changes: 0 additions & 3 deletions tests/op/test_prep_dp_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def test_template_str_hybrid(self):
self.assertEqual(jdata["training"]["seed"], 4 * ii + 3)

def test_template_str_se_e2_a(self):

ip = OPIO(
{
"template_script": template_script_se_e2_a,
Expand All @@ -133,7 +132,6 @@ def test_template_str_se_e2_a(self):
self.assertEqual(jdata["training"]["seed"], 3 * ii + 2)

def test_template_list_hyb_sea(self):

ip = OPIO(
{
"template_script": [template_script_hybrid, template_script_se_e2_a],
Expand Down Expand Up @@ -166,7 +164,6 @@ def test_template_list_hyb_sea(self):
self.assertEqual(jdata["training"]["seed"], 4 * ii + 2)

def test_template_raise_wrong_list_length(self):

ip = OPIO(
{
"template_script": [
Expand Down

0 comments on commit 71f2918

Please sign in to comment.