Skip to content

Commit 3b6a1c4

Browse files
jorgeorpinelefiop
andauthored
term: "metrics" plural in output messages (#4699)
* api: update to latest definitions to match treeverse/dvc.org/pull/908 * Update dvc/api.py * metrics show: update -h output to match docs per treeverse/dvc.org@2c34521 * api: update docstrings to match treeverse/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 #3426 (review) * api: improve open() docstring for clarity and add example per #3426 (review) * api: remove unnecessary info from get_url docstring per #3426 (comment) * api: produces->generated in open() docstring * api: simplify open docstring per #3426 (comment) * term: "metrics" plural in output messages treeverse/dvc.org#1848 (review) * typo Co-authored-by: Ruslan Kuprieiev <kupruser@gmail.com>
1 parent ca490f6 commit 3b6a1c4

File tree

7 files changed

+17
-18
lines changed

7 files changed

+17
-18
lines changed

dvc/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def get_url(path, repo=None, rev=None, remote=None):
2020
in a DVC repo. For Git repos, HEAD is used unless a rev argument is
2121
supplied. The default remote is tried unless a remote argument is supplied.
2222
23-
Raises OutputNotFoundError if the file is not a dvc-tracked file.
23+
Raises OutputNotFoundError if the file is not tracked by DVC.
2424
2525
NOTE: This function does not check for the actual existence of the file or
2626
directory in the remote storage.

dvc/command/metrics.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,8 @@ def add_parser(subparsers, parent_parser):
171171
"targets",
172172
nargs="*",
173173
help=(
174-
"Limit command scope to these metric files (supports any file, "
175-
"even when not found as `metrics` in `dvc.yaml`). Using -R, "
176-
"directories to search metric files in can also be given."
174+
"Limit command scope to these metrics files. Using -R, "
175+
"directories to search metrics files in can also be given."
177176
),
178177
).complete = completion.FILE
179178
metrics_show_parser.add_argument(
@@ -209,7 +208,7 @@ def add_parser(subparsers, parent_parser):
209208
default=False,
210209
help=(
211210
"If any target is a directory, recursively search and process "
212-
"metric files."
211+
"metrics files."
213212
),
214213
)
215214
metrics_show_parser.set_defaults(func=CmdMetricsShow)
@@ -237,8 +236,8 @@ def add_parser(subparsers, parent_parser):
237236
"--targets",
238237
nargs="*",
239238
help=(
240-
"Limit command scope to these metric files. Using -R, "
241-
"directories to search metric files in can also be given."
239+
"Limit command scope to these metrics files. Using -R, "
240+
"directories to search metrics files in can also be given."
242241
),
243242
metavar="<paths>",
244243
).complete = completion.FILE
@@ -249,7 +248,7 @@ def add_parser(subparsers, parent_parser):
249248
default=False,
250249
help=(
251250
"If any target is a directory, recursively search and process "
252-
"metric files."
251+
"metrics files."
253252
),
254253
)
255254
metrics_diff_parser.add_argument(

dvc/command/plots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def add_parser(subparsers, parent_parser):
124124

125125
fix_subparsers(plots_subparsers)
126126

127-
SHOW_HELP = "Generate plots from metric files."
127+
SHOW_HELP = "Generate plots from metrics files."
128128
plots_show_parser = plots_subparsers.add_parser(
129129
"show",
130130
parents=[parent_parser],
@@ -176,7 +176,7 @@ def add_parser(subparsers, parent_parser):
176176
_add_output_arguments(plots_diff_parser)
177177
plots_diff_parser.set_defaults(func=CmdPlotsDiff)
178178

179-
PLOTS_MODIFY_HELP = "Modify display properties of plot metric files."
179+
PLOTS_MODIFY_HELP = "Modify display properties of plot metrics files."
180180
plots_modify_parser = plots_subparsers.add_parser(
181181
"modify",
182182
parents=[parent_parser],

dvc/command/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,15 @@ def add_parser(subparsers, parent_parser):
134134
"--metrics",
135135
action="append",
136136
default=[],
137-
help="Declare output metric file.",
137+
help="Declare output metrics file.",
138138
metavar="<path>",
139139
)
140140
run_parser.add_argument(
141141
"-M",
142142
"--metrics-no-cache",
143143
action="append",
144144
default=[],
145-
help="Declare output metric file (do not put into DVC cache).",
145+
help="Declare output metrics file (do not put into DVC cache).",
146146
metavar="<path>",
147147
)
148148
run_parser.add_argument(

dvc/dependency/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
# NOTE: schema for dependencies is basically the same as for outputs, but
5050
# without output-specific entries like 'cache' (whether or not output is
5151
# cached, see -o and -O flags for `dvc run`) and 'metric' (whether or not
52-
# output is a metric file and how to parse it, see `-M` flag for `dvc run`).
52+
# output is a metrics file and how to parse it, see `-M` flag for `dvc run`).
5353
SCHEMA = output.SCHEMA.copy()
5454
del SCHEMA[BaseOutput.PARAM_CACHE]
5555
del SCHEMA[BaseOutput.PARAM_METRIC]

dvc/exceptions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self, output, stages):
4242

4343

4444
class OutputNotFoundError(DvcException):
45-
"""Thrown if a file/directory not found in repository pipelines.
45+
"""Thrown if a file/directory is not found as an output in any pipeline.
4646
4747
Args:
4848
output (unicode): path to the file/directory.
@@ -105,7 +105,7 @@ def __init__(self, path):
105105

106106

107107
class MoveNotDataSourceError(DvcException):
108-
"""Thrown if attempted to move a file/directory that is not an output
108+
"""Thrown when trying to move a file/directory that is not an output
109109
in a data source stage.
110110
111111
Args:
@@ -164,7 +164,7 @@ class BadMetricError(DvcException):
164164
def __init__(self, paths):
165165
super().__init__(
166166
"the following metrics do not exist, "
167-
"are not metric files or are malformed: {paths}".format(
167+
"are not metrics files or are malformed: {paths}".format(
168168
paths=", ".join(f"'{path}'" for path in paths)
169169
)
170170
)

dvc/repo/metrics/show.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ def show(
100100
if not res:
101101
if metrics_found:
102102
msg = (
103-
"Could not parse metric files. Use `-v` option to see more "
103+
"Could not parse metrics files. Use `-v` option to see more "
104104
"details."
105105
)
106106
else:
107107
msg = (
108-
"no metric files in this repository. Use `-m/-M` options for "
108+
"no metrics files in this repository. Use `-m/-M` options for "
109109
"`dvc run` to mark stage outputs as metrics."
110110
)
111111
raise NoMetricsError(msg)

0 commit comments

Comments
 (0)