update black and change line-length to 88 (#8953)

This commit is contained in:
skshetry
2023-02-04 05:28:07 +02:00
committed by GitHub
parent 5d2701341b
commit a86470ccbc
317 changed files with 1520 additions and 3738 deletions
+13 -28
View File
@@ -112,9 +112,7 @@ def test_apply(tmp_dir, scm, dvc, exp_stage):
from dvc.exceptions import InvalidArgumentError
from dvc.repo.experiments.exceptions import ApplyConflictError
results = dvc.experiments.run(
exp_stage.addressing, params=["foo=2"], tmp_dir=True
)
results = dvc.experiments.run(exp_stage.addressing, params=["foo=2"], tmp_dir=True)
exp_a = first(results)
results = dvc.experiments.run(
@@ -151,9 +149,7 @@ def test_apply(tmp_dir, scm, dvc, exp_stage):
def test_apply_failed(tmp_dir, scm, dvc, failed_exp_stage, test_queue):
from dvc.exceptions import InvalidArgumentError
dvc.experiments.run(
failed_exp_stage.addressing, params=["foo=2"], queue=True
)
dvc.experiments.run(failed_exp_stage.addressing, params=["foo=2"], queue=True)
exp_rev = dvc.experiments.scm.resolve_rev(f"{CELERY_STASH}@{{0}}")
dvc.experiments.run(
@@ -218,7 +214,6 @@ def test_apply_untracked(tmp_dir, scm, dvc, exp_stage):
def test_get_baseline(tmp_dir, scm, dvc, exp_stage):
init_rev = scm.get_rev()
assert dvc.experiments.get_baseline(init_rev) is None
@@ -267,9 +262,11 @@ def test_update_py_params(tmp_dir, scm, dvc, test_queue, copy_script):
tmp_dir.gen(
"params.py",
"INT = 1\nFLOAT = 0.001\nDICT = {'a': 1}\n\n"
"class Train:\n seed = 2020\n\n"
"class Klass:\n def __init__(self):\n self.a = 111\n",
(
"INT = 1\nFLOAT = 0.001\nDICT = {'a': 1}\n\n"
"class Train:\n seed = 2020\n\n"
"class Klass:\n def __init__(self):\n self.a = 111\n"
),
)
stage = dvc.run(
cmd="python copy.py params.py metrics.py",
@@ -322,9 +319,7 @@ def test_update_py_params(tmp_dir, scm, dvc, test_queue, copy_script):
scm.commit("init")
with pytest.raises(PythonFileCorruptedError):
dvc.experiments.run(
stage.addressing, params=["params.py:INT=2a"], tmp_dir=True
)
dvc.experiments.run(stage.addressing, params=["params.py:INT=2a"], tmp_dir=True)
def test_detached_parent(tmp_dir, scm, dvc, exp_stage, mocker):
@@ -352,9 +347,7 @@ def test_branch(tmp_dir, scm, dvc, exp_stage):
scm.branch("branch-exists")
results = dvc.experiments.run(
exp_stage.addressing, params=["foo=2"], name="foo"
)
results = dvc.experiments.run(exp_stage.addressing, params=["foo=2"], name="foo")
exp_a = first(results)
ref_a = dvc.experiments.get_branch_by_rev(exp_a)
@@ -369,9 +362,7 @@ def test_branch(tmp_dir, scm, dvc, exp_stage):
assert scm.resolve_rev(name) == exp_a
tmp_dir.scm_gen({"new_file": "new_file"}, commit="new baseline")
results = dvc.experiments.run(
exp_stage.addressing, params=["foo=2"], name="foo"
)
results = dvc.experiments.run(exp_stage.addressing, params=["foo=2"], name="foo")
exp_b = first(results)
ref_b = dvc.experiments.get_branch_by_rev(exp_b)
@@ -500,9 +491,7 @@ def test_subdir(tmp_dir, scm, dvc, workspace):
name="copy-file",
no_exec=True,
)
scm.add(
[subdir / "dvc.yaml", subdir / "copy.py", subdir / "params.yaml"]
)
scm.add([subdir / "dvc.yaml", subdir / "copy.py", subdir / "params.yaml"])
scm.commit("init")
results = dvc.experiments.run(
@@ -590,9 +579,7 @@ def test_run_celery(tmp_dir, scm, dvc, exp_stage, mocker):
def test_run_metrics(tmp_dir, scm, dvc, exp_stage, mocker):
from dvc.cli import main
mocker.patch.object(
dvc.experiments, "run", return_value={"abc123": "abc123"}
)
mocker.patch.object(dvc.experiments, "run", return_value={"abc123": "abc123"})
show_mock = mocker.patch.object(dvc.metrics, "show", return_value={})
main(["exp", "run", "-m"])
@@ -638,9 +625,7 @@ def test_fix_exp_head(tmp_dir, scm, tail):
"params, target",
itertools.product(("foo: 1", "foo: 2"), (True, False)),
)
def test_modified_data_dep(
tmp_dir, scm, dvc, workspace, params, target, copy_script
):
def test_modified_data_dep(tmp_dir, scm, dvc, workspace, params, target, copy_script):
tmp_dir.dvc_gen("data", "data")
tmp_dir.gen("params.yaml", "foo: 1")
exp_stage = dvc.run(