Skip to content

metrics & plots: help output improvements#3963

Merged
efiop merged 16 commits into
treeverse:masterfrom
nik123:MetricsAndPlotsHelpOutputImprovements
Jun 14, 2020
Merged

metrics & plots: help output improvements#3963
efiop merged 16 commits into
treeverse:masterfrom
nik123:MetricsAndPlotsHelpOutputImprovements

Conversation

@nik123
Copy link
Copy Markdown
Contributor

@nik123 nik123 commented Jun 5, 2020

Fixes #3924

It seems that changes might be covered in treeverse/dvc.org#1382. The list of required changes in docs:

  1. Few param names in docs are outdated: --xlab -> --x-label and --ylab -> --y-label
  2. dvc metrics diff: help for targets param should be changed to Limit command scope to these metric files. Using -R, directories to search metric files in can also be given.
  3. dvc metrics show: help for targets param should be changed to Limit command scope to these metric files. Using -R, directories to search metric files in can also be given.
  4. dvc plots diff -h: command description should be updated (see discussion in comments).

@nik123
Copy link
Copy Markdown
Contributor Author

nik123 commented Jun 5, 2020

Few param names in docs are outdated: --xlab -> --x-label and --ylab -> --y-label but it seems it is already covered here https://github.com/iterative/dvc.org/pull/1382/files#r434965944

@efiop efiop requested review from jorgeorpinel and pared June 5, 2020 20:42
Comment thread dvc/command/metrics.py
"--targets",
nargs="*",
help=(
"Metric files or directories (see -R) to show diff for. "
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actually, in this case -R works, so we should keep it 🙂 But probably need to rephrase it a bit, because it is about directories containing metric files.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated the message. May still be badly phrased though

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the new text is accurate (taken from older commands like push/pull). Should we also apply it to metrics show though? I think so!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed text in metrics show. Please, check it out.

Comment thread dvc/command/plots.py Outdated
fix_subparsers(plots_subparsers)

SHOW_HELP = "Generate a plots image file from a metrics file."
SHOW_HELP = "Generate plot from a metrics file."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actually, it can generate multiple plots from multiple metrics files.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@nik123 nik123 requested a review from efiop June 6, 2020 13:14
@jorgeorpinel
Copy link
Copy Markdown
Contributor

already covered here https://github.com/iterative/dvc.org/pull/1382/files#r434965944

Yes, some of it but maybe this PR will have even more changes so could we maybe restore the PR template with the check boxes so we don't forget to apply the same changes to docs afterwards?

It could be done directly in treeverse/dvc.org/pull/1382 if it's still in progress once this is approved.

Comment thread dvc/command/plots.py
def add_parser(subparsers, parent_parser):
PLOTS_HELP = (
"Generating plots for metrics stored in structured files "
"Commands to visualize and compare plot metrics in structured files "
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for this change. We may be changing it further per this treeverse/dvc.org#1382 (comment). Please check the resolution tomorrow or so.

Copy link
Copy Markdown
Contributor

@jorgeorpinel jorgeorpinel left a comment

Choose a reason for hiding this comment

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

So far so good, thanks! (Just left a couple small notes ☝️).

I'm not opposed to merging but there's a few more things related to metrics output strings we could address here or separately:

  • Lots of unnecessary periods in the non-sentence descriptions of command options.
  • Similar updates apply to plots modify now that it has been added, also based on https://github.com/iterative/dvc.org/pull/1382/files?file-filters%5B%5D=.md#diff-b6540815158031bd570b61c0cb46c19f but arguable, of course. For example:
    • PLOTS_MODIFY_HELP = "Modify display properties of plot metric files."
    • target arg help: `"Metric file to set props to" (no period)
    • for --unset: "Unset one or more display properties."
  • Additionally, it would be nice to reorder the command parameters to match the order in the Options sections of the corresponding cmd refs (as ordered in #1382)

@nik123
Copy link
Copy Markdown
Contributor Author

nik123 commented Jun 7, 2020

already covered here https://github.com/iterative/dvc.org/pull/1382/files#r434965944

Yes, some of it but maybe this PR will have even more changes so could we maybe restore the PR template with the check boxes so we don't forget to apply the same changes to docs afterwards?

It could be done directly in iterative/dvc.org/pull/1382 if it's still in progress once this is approved.

@jorgeorpinel I added list of required documentation changes into original post. I will create separate PR if treeverse/dvc.org#1382 will be resolved before this one.

@efiop efiop requested a review from jorgeorpinel June 8, 2020 08:44
Copy link
Copy Markdown
Contributor

@pared pared left a comment

Choose a reason for hiding this comment

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

2 comments, I like including metavar.

Comment thread dvc/command/plots.py Outdated
"Plot differences in metrics between commits in the DVC "
"repository, or between the last commit and the workspace."
)
PLOTS_DIFF_HELP = "Plot differences in metrics between commits."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think phrasing here (in original DIFF_HELP too) is a bit off. We never plot differences. Plots exist alongside, either on the same plot (default, scatter) or on separate canvases (confusion matrix).

In the case of metrics, we do diff them by subtracting. Word diff suggests visualizing some kind of difference between metrics, which is not happening in plots.
I am not sure whether we should treat the plot in a similar way we do with metrics.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@pared but the command is called diff :) A few lines on the same plot could also be considered as diff, that's what we do and why the command is called dvc plots diff. As you've mentioned, we don't really plot all plots in the same image, but rather we show 1 image per 1 plot with multiple lines in it, and that is how we visualise a diff for a particular plot.

Comment thread dvc/command/plots.py Outdated
"revisions",
nargs="*",
default=None,
help="Git commits to plot from/to",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We do not write plots to commits. I might miss something, why this to?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That was my fault. Our latest version is

Git commits to find metrics to compare

per treeverse/dvc.org#1382 (review)

@efiop efiop requested a review from pared June 9, 2020 09:57
Copy link
Copy Markdown
Contributor

@pared pared left a comment

Choose a reason for hiding this comment

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

One minor thingy

Comment thread dvc/command/plots.py
"Plot differences in metrics between commits in the DVC "
"repository, or between the last commit and the workspace."
"Show multiple versions of plot metrics "
"by plotting them in a single image."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's not always single image (confusion matrix requires to plot few of them). I think Show multiple versions of plot metircs. Would be fine

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Shame we lost the info about "between commits in the DVC repository, or between the last commit and the workspace." 🙁

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What about "Show multiple versions of plot metrics from different commits"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Or we should go back to "Plot differences in metrics between commits in the DVC repository, or between the last commit and the workspace."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok, I guess I caused some confusion here, by reviewing even the base version. @nik123 I am sorry about that. @jorgeorpinel could you take look? In docs, we have:

This command visualize difference between metrics among experiments in the repository history.

That sounds about right.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@nik123 I am for that, let's ask @jorgeorpinel for the green light.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@pared But you are the author of this feature. Isn't single image completely wrong?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@efiop not quite, even for confusion matrix one could argue that we are dealing with single image. Take a look at this example What we have here is three plots on one image, thats why I believe Jorge is right, and I was wrong in the beginning.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It seems we almost have an agreement. @jorgeorpinel what are your thoughts about last proposed text?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well, I lost track of this one until now oops, sorry! The text you came up with is good 🙂

Copy link
Copy Markdown
Contributor

@jorgeorpinel jorgeorpinel left a comment

Choose a reason for hiding this comment

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

Thanks for the updates @nik123! And sorry for the delay to come back. Here are a few more minor suggestions after a final pass. Probably you could just commit them from GH

Comment thread dvc/command/plots.py Outdated
Comment thread dvc/command/plots.py Outdated
Comment thread dvc/command/plots.py Outdated
Comment thread dvc/command/plots.py Outdated
Comment thread dvc/command/plots.py Outdated
Comment thread dvc/command/plots.py Outdated
"-o",
"--out",
default=None,
help="Destination path to save plots to.",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
help="Destination path to save plots to.",
help="Destination path to save plots to",

Copy link
Copy Markdown
Contributor

@efiop efiop Jun 10, 2020

Choose a reason for hiding this comment

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

@jorgeorpinel Is it really worth bothering with dots in this PR? We have dots all over the place, I don't really see a point in blocking this PR just because of it: it makes it even less consistent.

efiop and others added 4 commits June 10, 2020 14:09
Co-authored-by: Jorge Orpinel <jorgeorpinel@users.noreply.github.com>
Co-authored-by: Jorge Orpinel <jorgeorpinel@users.noreply.github.com>
Co-authored-by: Jorge Orpinel <jorgeorpinel@users.noreply.github.com>
Co-authored-by: Jorge Orpinel <jorgeorpinel@users.noreply.github.com>
efiop and others added 3 commits June 10, 2020 14:09
Co-authored-by: Jorge Orpinel <jorgeorpinel@users.noreply.github.com>
Co-authored-by: Jorge Orpinel <jorgeorpinel@users.noreply.github.com>
@efiop efiop merged commit f7348af into treeverse:master Jun 14, 2020
@efiop
Copy link
Copy Markdown
Contributor

efiop commented Jun 14, 2020

Thank you @nik123 ! 🙏 Sorry for the delay, we'll take it from here.

@nik123 nik123 deleted the MetricsAndPlotsHelpOutputImprovements branch June 17, 2020 15:53
nik123 added a commit to nik123/dvc.org that referenced this pull request Jun 17, 2020
* cmd ref: metrics diff: targets desc updated per treeverse/dvc#3963

* cmd ref: metrics show: targets desc updated per treeverse/dvc#3963
shcheklein pushed a commit to treeverse/dvc.org that referenced this pull request Jun 17, 2020
* cmd ref: metrics diff: targets desc updated per treeverse/dvc#3963

* cmd ref: metrics show: targets desc updated per treeverse/dvc#3963
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

metrics & plots: help output improvements [qa]

4 participants