From 78e25747a4e887a6699ae60ca770ee045bc7e8c9 Mon Sep 17 00:00:00 2001 From: David de la Iglesia Castro Date: Fri, 4 Nov 2022 18:07:05 +0100 Subject: [PATCH] exp init: Update DVCLive paths. Closes #8531 --- dvc/repo/experiments/init.py | 4 ++-- tests/func/experiments/test_init.py | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dvc/repo/experiments/init.py b/dvc/repo/experiments/init.py index 4cc0039bf..68c1c57ac 100644 --- a/dvc/repo/experiments/init.py +++ b/dvc/repo/experiments/init.py @@ -250,8 +250,8 @@ def init( models = context.get("models") live_path = context.pop("live", None) - live_metrics = f"{live_path}.json" if live_path else None - live_plots = os.path.join(live_path, "scalars") if live_path else None + live_metrics = f"{live_path}/metrics.json" if live_path else None + live_plots = os.path.join(live_path, "plots") if live_path else None if type == "checkpoint": outs_key = "checkpoints" diff --git a/tests/func/experiments/test_init.py b/tests/func/experiments/test_init.py index 25775f9e7..5e200e547 100644 --- a/tests/func/experiments/test_init.py +++ b/tests/func/experiments/test_init.py @@ -345,11 +345,13 @@ def test_init_interactive_live( "train": { "cmd": "python script.py", "deps": ["data", "script.py"], - "metrics": [{"dvclive.json": {"cache": False}}], + "metrics": [ + {os.path.join("dvclive", "metrics.json"): {"cache": False}} + ], "outs": ["models"], "params": [{"params.yaml": None}], "plots": [ - {os.path.join("dvclive", "scalars"): {"cache": False}} + {os.path.join("dvclive", "plots"): {"cache": False}} ], } } @@ -434,12 +436,12 @@ def test_init_with_type_default_and_live_provided( "cmd": "cmd", "deps": ["data", "src"], "metrics": [ - {"live.json": {"cache": False}}, + {os.path.join("live", "metrics.json"): {"cache": False}}, ], "outs": ["models"], "params": [{"params.yaml": None}], "plots": [ - {os.path.join("live", "scalars"): {"cache": False}}, + {os.path.join("live", "plots"): {"cache": False}}, ], } } @@ -477,13 +479,13 @@ def test_init_with_live_and_metrics_plots_provided( "cmd": "cmd", "deps": ["data", "src"], "metrics": [ - {"live.json": {"cache": False}}, + {os.path.join("live", "metrics.json"): {"cache": False}}, {"metrics.json": {"cache": False}}, ], "outs": ["models"], "params": [{"params.yaml": None}], "plots": [ - {os.path.join("live", "scalars"): {"cache": False}}, + {os.path.join("live", "plots"): {"cache": False}}, {"plots": {"cache": False}}, ], }