Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move to ruff formatter #181

Merged
merged 2 commits into from
Dec 19, 2023
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
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