mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-01 23:08:43 +01:00
* params/metrics/plots/exp show: introduce onerror * fixup * plots/metrics/params: removing errors * removing more errors * removing errors * some more removing * new plots ux * new ux for metrics * new ux for params * fixing tests * fixups * minor test fixes * minor test fixes * commands: plots/params: fix ui imports * working on error handlng decorator, stopped at show checkpoints * error_handler, further dvelopment * plots just before moving loading to collect * appending errors to results: initial passing * fixup * onerror: remove onerror fixture * fixups * plots/metrics/params/experiments: temporarily remove error warnings * plots: extract parsing out of class method * metrics/experiments: provide exception serializer for show-json * params/plots/metrics: signal errors * rebase fixups * fix TODOs * fixup * skshetry's review refactor
35 lines
824 B
Python
35 lines
824 B
Python
import json
|
|
import os
|
|
|
|
|
|
def test_metrics_order(tmp_dir, dvc):
|
|
tmp_dir.gen(
|
|
{
|
|
"p.json": json.dumps({"p1": 1}),
|
|
"p1.json": json.dumps({"p2": 1}),
|
|
"sub": {
|
|
"p3.json": json.dumps({"p3": 1}),
|
|
"p4.json": json.dumps({"p4": 1}),
|
|
},
|
|
}
|
|
)
|
|
|
|
dvc.stage.add(
|
|
metrics=["p.json", str(tmp_dir / "sub" / "p4.json")],
|
|
cmd="cmd1",
|
|
name="stage1",
|
|
)
|
|
with (tmp_dir / "sub").chdir():
|
|
dvc.stage.add(
|
|
metrics=[str(tmp_dir / "p1.json"), str("p3.json")],
|
|
cmd="cmd2",
|
|
name="stage2",
|
|
)
|
|
|
|
assert list(dvc.metrics.show()[""]["data"]) == [
|
|
"p.json",
|
|
os.path.join("sub", "p4.json"),
|
|
"p1.json",
|
|
os.path.join("sub", "p3.json"),
|
|
]
|