mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
experiments: fix checkpoints sorting issues in dvc exp show (#4740)
* experiments: order experiment (branches) by timestamp * checkpoints: sort checkpoint branches by tip commit values * remove sort logic from dvc.scm
This commit is contained in:
@@ -155,7 +155,11 @@ def _sort_exp(experiments, sort_by, typ, reverse):
|
||||
ret = OrderedDict()
|
||||
|
||||
def _sort(item):
|
||||
_, exp = item
|
||||
rev, exp = item
|
||||
tip = exp.get("checkpoint_tip")
|
||||
if tip and tip != rev:
|
||||
# Sort checkpoint experiments by tip commit
|
||||
return _sort((tip, experiments[tip]))
|
||||
for fname, item in exp.get(typ, {}).items():
|
||||
if isinstance(item, dict):
|
||||
item = flatten(item)
|
||||
|
||||
@@ -110,7 +110,12 @@ def show(
|
||||
)
|
||||
|
||||
# collect reproduced experiments
|
||||
for exp_branch in repo.experiments.scm.list_branches():
|
||||
for head in sorted(
|
||||
repo.experiments.scm.repo.heads,
|
||||
key=lambda h: h.commit.committed_date,
|
||||
reverse=True,
|
||||
):
|
||||
exp_branch = head.name
|
||||
m = repo.experiments.BRANCH_RE.match(exp_branch)
|
||||
if m:
|
||||
rev = repo.scm.resolve_rev(m.group("baseline_rev"))
|
||||
|
||||
Reference in New Issue
Block a user