exp run: do nothing if result matches parent (HEAD) (#5600)

This commit is contained in:
Peter Rowlands (변기호)
2021-03-12 14:09:03 +09:00
committed by GitHub
parent 2db55032c4
commit fe4cb9c439
2 changed files with 7 additions and 1 deletions
+5 -1
View File
@@ -725,10 +725,14 @@ class Experiments:
rel_cwd=relpath(os.getcwd(), self.scm.root_dir),
)
if not exec_result.exp_hash or not exec_result.ref_info:
if not exec_result.exp_hash:
raise DvcException(
f"Failed to reproduce experiment '{rev[:7]}'"
)
if not exec_result.ref_info:
# repro succeeded but result matches baseline
# (no experiment generated or applied)
return {}
exp_rev = self.scm.get_ref(str(exec_result.ref_info))
self.scm.set_ref(EXEC_APPLY, exp_rev)
return {exp_rev: exec_result.exp_hash}
+2
View File
@@ -358,6 +358,8 @@ class BaseExecutor(ABC):
if os.path.exists(args_path):
args, kwargs = cls.unpack_repro_args(args_path)
remove(args_path)
# explicitly git rm/unstage the args file
dvc.scm.add([args_path])
else:
args = []
kwargs = {}