exp run: disallow --rev for workspace runs (#5831)

This commit is contained in:
Peter Rowlands (변기호)
2021-04-16 18:02:13 +09:00
committed by GitHub
parent b08a3a8caa
commit 29b9c5370c
+12 -7
View File
@@ -509,10 +509,16 @@ class CmdExperimentsRun(CmdRepro):
def run(self):
from dvc.command.metrics import _show_metrics
if self.args.reset and self.args.checkpoint_resume:
raise InvalidArgumentError(
"--reset and --rev are mutually exclusive."
)
if self.args.checkpoint_resume:
if self.args.reset:
raise InvalidArgumentError(
"--reset and --rev are mutually exclusive."
)
if not (self.args.queue or self.args.tmp_dir):
raise InvalidArgumentError(
"--rev can only be used in conjunction with "
"--queue or --temp."
)
if self.args.reset:
logger.info("Any existing checkpoints will be reset and re-run.")
@@ -932,9 +938,8 @@ def add_parser(subparsers, parent_parser):
type=str,
dest="checkpoint_resume",
help=(
"Continue the specified checkpoint experiment. "
"(Only required for explicitly resuming checkpoints in queued "
"or temp dir runs.)"
"Continue the specified checkpoint experiment. Can only be used "
"in conjunction with --queue or --temp."
),
metavar="<experiment_rev>",
).complete = completion.EXPERIMENT