term: "metrics" plural in output messages (#4699)

* api: update to latest definitions to match iterative/dvc.org/pull/908

* Update dvc/api.py

* metrics show: update -h output to match docs
per https://github.com/iterative/dvc.org/pull/1014/commits/2c3452119545987f77b764e4aa6fc94d051092a7

* api: update docstrings to match iterative/dvc.org/pull/908

* api: refactor DVC repo check in get_url, and document it

* dvc: cosmetic edits as I explored exceptions that api functions may raise

* api: copy default info to read() docstring from open()
per https://github.com/iterative/dvc/pull/3426#pullrequestreview-366949501

* api: improve open() docstring for clarity and add example
per https://github.com/iterative/dvc/pull/3426#pullrequestreview-366956856

* api: remove unnecessary info from get_url docstring
per https://github.com/iterative/dvc/pull/3426#discussion_r386203064

* api: produces->generated in open() docstring

* api: simplify open docstring
per https://github.com/iterative/dvc/pull/3426#discussion_r388218147

* term: "metrics" plural in output messages
https://github.com/iterative/dvc.org/pull/1848#pullrequestreview-506217071

* typo

Co-authored-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Jorge Orpinel
2020-10-12 12:51:57 +03:00
committed by GitHub
co-authored by Ruslan Kuprieiev
parent ca490f699e
commit 3b6a1c441e
7 changed files with 17 additions and 18 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ def get_url(path, repo=None, rev=None, remote=None):
in a DVC repo. For Git repos, HEAD is used unless a rev argument is in a DVC repo. For Git repos, HEAD is used unless a rev argument is
supplied. The default remote is tried unless a remote argument is supplied. supplied. The default remote is tried unless a remote argument is supplied.
Raises OutputNotFoundError if the file is not a dvc-tracked file. Raises OutputNotFoundError if the file is not tracked by DVC.
NOTE: This function does not check for the actual existence of the file or NOTE: This function does not check for the actual existence of the file or
directory in the remote storage. directory in the remote storage.
+6 -7
View File
@@ -171,9 +171,8 @@ def add_parser(subparsers, parent_parser):
"targets", "targets",
nargs="*", nargs="*",
help=( help=(
"Limit command scope to these metric files (supports any file, " "Limit command scope to these metrics files. Using -R, "
"even when not found as `metrics` in `dvc.yaml`). Using -R, " "directories to search metrics files in can also be given."
"directories to search metric files in can also be given."
), ),
).complete = completion.FILE ).complete = completion.FILE
metrics_show_parser.add_argument( metrics_show_parser.add_argument(
@@ -209,7 +208,7 @@ def add_parser(subparsers, parent_parser):
default=False, default=False,
help=( help=(
"If any target is a directory, recursively search and process " "If any target is a directory, recursively search and process "
"metric files." "metrics files."
), ),
) )
metrics_show_parser.set_defaults(func=CmdMetricsShow) metrics_show_parser.set_defaults(func=CmdMetricsShow)
@@ -237,8 +236,8 @@ def add_parser(subparsers, parent_parser):
"--targets", "--targets",
nargs="*", nargs="*",
help=( help=(
"Limit command scope to these metric files. Using -R, " "Limit command scope to these metrics files. Using -R, "
"directories to search metric files in can also be given." "directories to search metrics files in can also be given."
), ),
metavar="<paths>", metavar="<paths>",
).complete = completion.FILE ).complete = completion.FILE
@@ -249,7 +248,7 @@ def add_parser(subparsers, parent_parser):
default=False, default=False,
help=( help=(
"If any target is a directory, recursively search and process " "If any target is a directory, recursively search and process "
"metric files." "metrics files."
), ),
) )
metrics_diff_parser.add_argument( metrics_diff_parser.add_argument(
+2 -2
View File
@@ -124,7 +124,7 @@ def add_parser(subparsers, parent_parser):
fix_subparsers(plots_subparsers) fix_subparsers(plots_subparsers)
SHOW_HELP = "Generate plots from metric files." SHOW_HELP = "Generate plots from metrics files."
plots_show_parser = plots_subparsers.add_parser( plots_show_parser = plots_subparsers.add_parser(
"show", "show",
parents=[parent_parser], parents=[parent_parser],
@@ -176,7 +176,7 @@ def add_parser(subparsers, parent_parser):
_add_output_arguments(plots_diff_parser) _add_output_arguments(plots_diff_parser)
plots_diff_parser.set_defaults(func=CmdPlotsDiff) plots_diff_parser.set_defaults(func=CmdPlotsDiff)
PLOTS_MODIFY_HELP = "Modify display properties of plot metric files." PLOTS_MODIFY_HELP = "Modify display properties of plot metrics files."
plots_modify_parser = plots_subparsers.add_parser( plots_modify_parser = plots_subparsers.add_parser(
"modify", "modify",
parents=[parent_parser], parents=[parent_parser],
+2 -2
View File
@@ -134,7 +134,7 @@ def add_parser(subparsers, parent_parser):
"--metrics", "--metrics",
action="append", action="append",
default=[], default=[],
help="Declare output metric file.", help="Declare output metrics file.",
metavar="<path>", metavar="<path>",
) )
run_parser.add_argument( run_parser.add_argument(
@@ -142,7 +142,7 @@ def add_parser(subparsers, parent_parser):
"--metrics-no-cache", "--metrics-no-cache",
action="append", action="append",
default=[], default=[],
help="Declare output metric file (do not put into DVC cache).", help="Declare output metrics file (do not put into DVC cache).",
metavar="<path>", metavar="<path>",
) )
run_parser.add_argument( run_parser.add_argument(
+1 -1
View File
@@ -49,7 +49,7 @@ DEP_MAP = {
# NOTE: schema for dependencies is basically the same as for outputs, but # NOTE: schema for dependencies is basically the same as for outputs, but
# without output-specific entries like 'cache' (whether or not output is # without output-specific entries like 'cache' (whether or not output is
# cached, see -o and -O flags for `dvc run`) and 'metric' (whether or not # cached, see -o and -O flags for `dvc run`) and 'metric' (whether or not
# output is a metric file and how to parse it, see `-M` flag for `dvc run`). # output is a metrics file and how to parse it, see `-M` flag for `dvc run`).
SCHEMA = output.SCHEMA.copy() SCHEMA = output.SCHEMA.copy()
del SCHEMA[BaseOutput.PARAM_CACHE] del SCHEMA[BaseOutput.PARAM_CACHE]
del SCHEMA[BaseOutput.PARAM_METRIC] del SCHEMA[BaseOutput.PARAM_METRIC]
+3 -3
View File
@@ -42,7 +42,7 @@ class OutputDuplicationError(DvcException):
class OutputNotFoundError(DvcException): class OutputNotFoundError(DvcException):
"""Thrown if a file/directory not found in repository pipelines. """Thrown if a file/directory is not found as an output in any pipeline.
Args: Args:
output (unicode): path to the file/directory. output (unicode): path to the file/directory.
@@ -105,7 +105,7 @@ class ArgumentDuplicationError(DvcException):
class MoveNotDataSourceError(DvcException): class MoveNotDataSourceError(DvcException):
"""Thrown if attempted to move a file/directory that is not an output """Thrown when trying to move a file/directory that is not an output
in a data source stage. in a data source stage.
Args: Args:
@@ -164,7 +164,7 @@ class BadMetricError(DvcException):
def __init__(self, paths): def __init__(self, paths):
super().__init__( super().__init__(
"the following metrics do not exist, " "the following metrics do not exist, "
"are not metric files or are malformed: {paths}".format( "are not metrics files or are malformed: {paths}".format(
paths=", ".join(f"'{path}'" for path in paths) paths=", ".join(f"'{path}'" for path in paths)
) )
) )
+2 -2
View File
@@ -100,12 +100,12 @@ def show(
if not res: if not res:
if metrics_found: if metrics_found:
msg = ( msg = (
"Could not parse metric files. Use `-v` option to see more " "Could not parse metrics files. Use `-v` option to see more "
"details." "details."
) )
else: else:
msg = ( msg = (
"no metric files in this repository. Use `-m/-M` options for " "no metrics files in this repository. Use `-m/-M` options for "
"`dvc run` to mark stage outputs as metrics." "`dvc run` to mark stage outputs as metrics."
) )
raise NoMetricsError(msg) raise NoMetricsError(msg)