Skip to content

Commit 5cd51b1

Browse files
committed
doc: show-md on params/metrics diff, shows diff in markdown table format
1 parent 5c9a37d commit 5cd51b1

File tree

2 files changed

+33
-28
lines changed

2 files changed

+33
-28
lines changed

content/docs/command-reference/metrics/diff.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ commits in the <abbr>DVC repository</abbr>, or between a commit and the
99
```usage
1010
usage: dvc metrics diff [-h] [-q | -v]
1111
[--targets [<path> [<path> ...]]]
12-
[-t <type>] [-x <path>] [-R] [--show-json]
12+
[-t <type>] [-x <path>] [-R]
13+
[--show-json] [--show-md]
1314
[a_ref] [b_ref]
1415
1516
positional arguments:
@@ -63,6 +64,8 @@ They're calculated between two commits (hash, branch, tag, or any
6364
- `--show-json` - prints the command's output in easily parsable JSON format,
6465
instead of a human-readable table.
6566

67+
- `--show-md` - prints the command's output in Markdown table format.
68+
6669
- `-h`, `--help` - prints the usage/help message, and exit.
6770

6871
- `-q`, `--quiet` - do not write anything to standard output. Exit with 0 if no
@@ -105,7 +108,7 @@ had in the previous commit:
105108

106109
```
107110
$ dvc metrics diff
108-
Path Metric Value Change
109-
metrics.json TP 531 4
110-
metrics.json AUC 0.967 0.003
111+
Path Metric Value Change
112+
metrics.json TP 531 4
113+
metrics.json AUC 0.967 0.003
111114
```

content/docs/command-reference/params/diff.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ commits in the <abbr>DVC repository</abbr>, or between a commit and the
77
## Synopsis
88

99
```usage
10-
usage: dvc params diff [-h] [-q | -v] [--all] [--show-json]
10+
usage: dvc params diff [-h] [-q | -v] [--all] [--show-json] [--show-md]
1111
[a_rev] [b_rev]
1212
1313
positional arguments:
@@ -40,6 +40,8 @@ itself does not ascribe any specific meaning for these values.
4040
- `--show-json` - prints the command's output in easily parsable JSON format,
4141
instead of a human-readable table.
4242

43+
- `--show-md` - prints the command's output in the Markdown table format.
44+
4345
- `-h`, `--help` - prints the usage/help message, and exit.
4446

4547
- `-q`, `--quiet` - do not write anything to standard output. Exit with 0 if no
@@ -78,12 +80,12 @@ Let's now print parameter values that we are tracking in this
7880

7981
```dvc
8082
$ dvc params diff
81-
Path Param Old New
82-
params.yaml lr None 0.0041
83-
params.yaml process.bow None 15000
84-
params.yaml process.thresh None 0.98
85-
params.yaml train.epochs None 70
86-
params.yaml train.layers None 9
83+
Path Param Old New
84+
params.yaml lr None 0.0041
85+
params.yaml process.bow None 15000
86+
params.yaml process.thresh None 0.98
87+
params.yaml train.epochs None 70
88+
params.yaml train.layers None 9
8789
```
8890

8991
The command above shows the difference in parameters between the workspace and
@@ -96,22 +98,22 @@ won't be shown if there are no changes:
9698

9799
```dvc
98100
$ dvc params diff
99-
Path Param Old New
100-
params.yaml lr 0.0041 0.0043
101-
params.yaml train.layers 9 7
102-
params.yaml train.epochs 70 110
101+
Path Param Old New
102+
params.yaml lr 0.0041 0.0043
103+
params.yaml train.layers 9 7
104+
params.yaml train.epochs 70 110
103105
```
104106

105107
Specify `--all` option to see all the parameters including not changed ones:
106108

107109
```dvc
108110
$ dvc params diff --all
109-
Path Param Old New
110-
params.yaml lr 0.0041 0.0043
111-
params.yaml process.bow 15000 15000
112-
params.yaml process.thresh 0.98 0.98
113-
params.yaml train.layers 9 7
114-
params.yaml train.epochs 70 110
111+
Path Param Old New
112+
params.yaml lr 0.0041 0.0043
113+
params.yaml process.bow 15000 15000
114+
params.yaml process.thresh 0.98 0.98
115+
params.yaml train.layers 9 7
116+
params.yaml train.epochs 70 110
115117
```
116118

117119
To compare parameters with a specific commit, a tag or any
@@ -120,9 +122,9 @@ additional command line parameter:
120122

121123
```dvc
122124
$ dvc params diff e12b167
123-
Path Param Old New
124-
params.yaml lr 0.0038 0.0043
125-
params.yaml train.epochs 70 110
125+
Path Param Old New
126+
params.yaml lr 0.0038 0.0043
127+
params.yaml train.epochs 70 110
126128
```
127129

128130
Note that the `train.layers` parameter disappeared because its value was not
@@ -133,8 +135,8 @@ To see the difference between two specific commits, both need to be specified:
133135

134136
```dvc
135137
$ dvc params diff e12b167 HEAD^
136-
Path Param Old New
137-
params.yaml lr 0.0038 0.0041
138-
params.yaml train.layers 10 9
139-
params.yaml train.epochs 50 70
138+
Path Param Old New
139+
params.yaml lr 0.0038 0.0041
140+
params.yaml train.layers 10 9
141+
params.yaml train.epochs 50 70
140142
```

0 commit comments

Comments
 (0)