Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: show-md on params/metrics diff #1266

Merged
merged 1 commit into from
May 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
Comment on lines 10 to 14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the actual order in which it's printed? I don't see this output in the core repo master branch yet. Thanks

This comment was marked as resolved.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the actual order in which it's printed?

Yes, that's the order.

$ dvc metrics diff -h
usage: dvc metrics diff [-h] [-q | -v] [--targets [<paths> [<paths> ...]]] [-R] [--all] [--show-json] [--show-md]
                        [a_rev] [b_rev]

Show changes in metrics between commits
Documentation: <https://man.dvc.org/metrics/diff>

positional arguments:
  a_rev                 Old Git commit to compare (defaults to HEAD)
  b_rev                 New Git commit to compare (defaults to the current workspace)

optional arguments:
  -h, --help            show this help message and exit
  -q, --quiet           Be quiet.
  -v, --verbose         Be verbose.
  --targets [<paths> [<paths> ...]]
                        Metric files or directories (see -R) to show diff for. Shows diff for all metric files by default.
  -R, --recursive       If any target is a directory, recursively search and process metric files.
  --all                 Show unchanged metrics as well.
  --show-json           Show output in JSON format.
  --show-md             Show tabulated output in the Markdown format (GFM).

Note that we still need to readjust the docs for the -t and -x on the metrics. But, I have tried to keep the order for all dvc {metrics,params} diff.

Copy link
Contributor

@jorgeorpinel jorgeorpinel May 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you're missing [--all] though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take care of it.


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
Comment on lines +111 to +113
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The heading formats got affected by the change. Previously it was centered, it's left aligned now.

```
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
```