Skip to content

Commit

Permalink
metrics: show: add comment clarifying metric type and xpath usage
Browse files Browse the repository at this point in the history
  • Loading branch information
pared committed Jul 25, 2019
1 parent 7c52f65 commit f5e0024
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dvc/repo/metrics/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,16 @@ 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
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

Expand Down

0 comments on commit f5e0024

Please sign in to comment.