make exp run --dry imply --temp

This commit is contained in:
dberenbaum
2023-09-13 15:06:46 +09:00
committed by Peter Rowlands (변기호)
parent ba0834caa0
commit d81a1bbf56
3 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ class CmdExperimentsRun(CmdRepro):
def add_parser(experiments_subparsers, parent_parser):
EXPERIMENTS_RUN_HELP = "Run or resume an experiment."
EXPERIMENTS_RUN_HELP = "Run an experiment."
experiments_run_parser = experiments_subparsers.add_parser(
"run",
parents=[parent_parser],
+3
View File
@@ -30,6 +30,9 @@ def run( # noqa: C901, PLR0912
Returns a dict mapping new experiment SHAs to the results
of `repro` for that experiment.
"""
if kwargs.get("dry"):
tmp_dir = True
if run_all:
return repo.experiments.reproduce_celery(jobs=jobs)
+3 -1
View File
@@ -676,10 +676,12 @@ def test_experiment_unchanged(tmp_dir, scm, dvc, exp_stage):
assert len(dvc.experiments.ls()[scm.get_rev()]) == 2
def test_experiment_run_dry(tmp_dir, scm, dvc, exp_stage):
def test_experiment_run_dry(tmp_dir, scm, dvc, exp_stage, mocker):
repro = mocker.spy(dvc.experiments, "reproduce_one")
dvc.experiments.run(exp_stage.addressing, dry=True)
assert len(dvc.experiments.ls()["master"]) == 0
assert repro.call_args.kwargs["tmp_dir"] is True
def test_clean(tmp_dir, scm, dvc, mocker):