mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-08 23:09:48 +01:00
exp show: add internal --no-fetch option to disable temp/queue ref fetch
This commit is contained in:
committed by
Peter Rowlands (변기호)
parent
ba82faee53
commit
444bf27e6f
@@ -480,6 +480,7 @@ class CmdExperimentsShow(CmdBase):
|
||||
num=self.args.num,
|
||||
sha_only=self.args.sha,
|
||||
param_deps=self.args.param_deps,
|
||||
fetch_running=self.args.fetch_running,
|
||||
)
|
||||
except DvcException:
|
||||
logger.exception("failed to show experiments")
|
||||
@@ -645,4 +646,10 @@ def add_parser(experiments_subparsers, parent_parser):
|
||||
default=False,
|
||||
help="Open the Parallel Coordinates Plot directly in the browser.",
|
||||
)
|
||||
experiments_show_parser.add_argument(
|
||||
"--no-fetch",
|
||||
dest="fetch_running",
|
||||
action="store_false",
|
||||
help=argparse.SUPPRESS,
|
||||
)
|
||||
experiments_show_parser.set_defaults(func=CmdExperimentsShow)
|
||||
|
||||
@@ -742,7 +742,7 @@ class Experiments:
|
||||
return self.stash_revs[rev].name
|
||||
return None
|
||||
|
||||
def get_running_exps(self) -> Dict[str, int]:
|
||||
def get_running_exps(self, fetch_refs: bool = True) -> Dict[str, int]:
|
||||
"""Return info for running experiments."""
|
||||
from dvc.scm import InvalidRemoteSCMRepo
|
||||
from dvc.utils.serialize import load_json
|
||||
@@ -774,7 +774,7 @@ class Experiments:
|
||||
result[rev] = info.asdict()
|
||||
else:
|
||||
result[rev] = info.asdict()
|
||||
if info.git_url:
|
||||
if info.git_url and fetch_refs:
|
||||
|
||||
def on_diverged(_ref: str, _checkpoint: bool):
|
||||
return False
|
||||
|
||||
@@ -136,6 +136,7 @@ def show(
|
||||
num=1,
|
||||
param_deps=False,
|
||||
onerror: Optional[Callable] = None,
|
||||
fetch_running: bool = True,
|
||||
):
|
||||
|
||||
if onerror is None:
|
||||
@@ -153,7 +154,7 @@ def show(
|
||||
iter_revs(repo.scm, revs, num, all_branches, all_tags, all_commits)
|
||||
)
|
||||
|
||||
running = repo.experiments.get_running_exps()
|
||||
running = repo.experiments.get_running_exps(fetch_refs=fetch_running)
|
||||
|
||||
for rev in found_revs:
|
||||
res[rev]["baseline"] = _collect_experiment_commit(
|
||||
|
||||
@@ -118,6 +118,7 @@ def test_experiments_show(dvc, scm, mocker):
|
||||
revs="foo",
|
||||
sha_only=True,
|
||||
param_deps=True,
|
||||
fetch_running=True,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user