From 394b871452d4a419e10487f20b7b9044b143a83a Mon Sep 17 00:00:00 2001 From: pared Date: Tue, 30 Jul 2019 15:02:38 +0200 Subject: [PATCH] metrics show: extend NOTEs for show --- dvc/repo/metrics/show.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dvc/repo/metrics/show.py b/dvc/repo/metrics/show.py index 4b53f2222..42ceab3d0 100644 --- a/dvc/repo/metrics/show.py +++ b/dvc/repo/metrics/show.py @@ -188,16 +188,15 @@ def _collect_metrics(repo, path, recursive, typ, xpath, branch): if not o.metric: continue - # NOTE this case assumes that metric has been modified with - # `dvc metric modify -t {} -x {}`, so stage file should contain - # info what type metric is and what is its xpath + # NOTE this case assumes that typ has not been provided in CLI call + # and one of the following cases: + # - stage file contains metric type + # - typ will be read from file extension later if not typ and isinstance(o.metric, dict): t = o.metric.get(o.PARAM_METRIC_TYPE, typ) # NOTE user might want to check different xpath, hence xpath first x = xpath or o.metric.get(o.PARAM_METRIC_XPATH) else: - # NOTE if metric has not been modified, user needs to provide - # both metric type and xpath t = typ x = xpath