Skip to content

Commit

Permalink
doc: show-md on params/metrics diff, shows diff in markdown table for…
Browse files Browse the repository at this point in the history
…mat (#1266)
  • Loading branch information
skshetry authored May 12, 2020
1 parent 427601f commit df7744b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 29 deletions.
5 changes: 4 additions & 1 deletion content/docs/command-reference/diff.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ workspace.

```usage
usage: dvc diff [-h] [-q | -v]
[--show-json] [--show-hash]
[--show-json] [--show-hash] [--show-md]
[a_rev] [b_rev]
positional arguments:
Expand Down Expand Up @@ -49,6 +49,9 @@ for example when `dvc init` was used with the `--no-scm` option.
- `--show-hash` - print file and directory hash values along with their path.
Useful for debug purposes.

- `--show-md` - print the list of files and directories with their status in the
Markdown table format.

- `-h`, `--help` - prints the usage/help message, and exit.

- `-q`, `--quiet` - do not write anything to standard output. Exit with 0 if no
Expand Down
11 changes: 7 additions & 4 deletions content/docs/command-reference/metrics/diff.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ commits in the <abbr>DVC repository</abbr>, or between a commit and the
```usage
usage: dvc metrics diff [-h] [-q | -v]
[--targets [<path> [<path> ...]]]
[-t <type>] [-x <path>] [-R] [--show-json]
[-t <type>] [-x <path>] [-R]
[--show-json] [--show-md]
[a_ref] [b_ref]
positional arguments:
Expand Down Expand Up @@ -63,6 +64,8 @@ They're calculated between two commits (hash, branch, tag, or any
- `--show-json` - prints the command's output in easily parsable JSON format,
instead of a human-readable table.

- `--show-md` - prints the command's output in Markdown table format.

- `-h`, `--help` - prints the usage/help message, and exit.

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

```
$ dvc metrics diff
Path Metric Value Change
metrics.json TP 531 4
metrics.json AUC 0.967 0.003
Path Metric Value Change
metrics.json TP 531 4
metrics.json AUC 0.967 0.003
```
50 changes: 26 additions & 24 deletions content/docs/command-reference/params/diff.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ commits in the <abbr>DVC repository</abbr>, or between a commit and the
## Synopsis

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

- `--show-md` - prints the command's output in the Markdown table format.

- `-h`, `--help` - prints the usage/help message, and exit.

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

```dvc
$ dvc params diff
Path Param Old New
params.yaml lr None 0.0041
params.yaml process.bow None 15000
params.yaml process.thresh None 0.98
params.yaml train.epochs None 70
params.yaml train.layers None 9
Path Param Old New
params.yaml lr None 0.0041
params.yaml process.bow None 15000
params.yaml process.thresh None 0.98
params.yaml train.epochs None 70
params.yaml train.layers None 9
```

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

```dvc
$ dvc params diff
Path Param Old New
params.yaml lr 0.0041 0.0043
params.yaml train.layers 9 7
params.yaml train.epochs 70 110
Path Param Old New
params.yaml lr 0.0041 0.0043
params.yaml train.layers 9 7
params.yaml train.epochs 70 110
```

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

```dvc
$ dvc params diff --all
Path Param Old New
params.yaml lr 0.0041 0.0043
params.yaml process.bow 15000 15000
params.yaml process.thresh 0.98 0.98
params.yaml train.layers 9 7
params.yaml train.epochs 70 110
Path Param Old New
params.yaml lr 0.0041 0.0043
params.yaml process.bow 15000 15000
params.yaml process.thresh 0.98 0.98
params.yaml train.layers 9 7
params.yaml train.epochs 70 110
```

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

```dvc
$ dvc params diff e12b167
Path Param Old New
params.yaml lr 0.0038 0.0043
params.yaml train.epochs 70 110
Path Param Old New
params.yaml lr 0.0038 0.0043
params.yaml train.epochs 70 110
```

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

```dvc
$ dvc params diff e12b167 HEAD^
Path Param Old New
params.yaml lr 0.0038 0.0041
params.yaml train.layers 10 9
params.yaml train.epochs 50 70
Path Param Old New
params.yaml lr 0.0038 0.0041
params.yaml train.layers 10 9
params.yaml train.epochs 50 70
```

0 comments on commit df7744b

Please sign in to comment.