mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
metrics show: extend NOTEs for show
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user