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

Adding a note on dvc plots diff --targets with revisions usage #1549

Merged
merged 3 commits into from
Jul 10, 2020

Conversation

imhardikj
Copy link
Contributor

@imhardikj imhardikj commented Jul 8, 2020

Fixes #1425
Continuation of #1544
@jorgeorpinel @pared I have included possible uses cases in the note

@imhardikj imhardikj marked this pull request as ready for review July 9, 2020 13:04
Comment on lines 114 to 123
> Alternatively, you can also run above statement as:
> Please note that when you're specifying `--targets` options with multiple
> `revisions`:
>
> ```dvc
> $ dvc plots diff --targets t1.json t2.csv HEAD v1 v2
> ```
>
> This statement will show an error because argument parser confuses `revisions`
> as arguments for `--targets` option. To avoid this error use `--` after all
> the arguments for `--targets`:
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's move this note up to the description as a regular paragraph, and just make a quick reminder in this note (block quote) here in the example.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, per #1544 (comment) please move up into the --targets option bullet text instead. Feel free to use several paragraphs and even code blocks or block quote notes in there, but do try to summarize all this a little in both places. Thanks

Copy link
Member

Choose a reason for hiding this comment

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

please, let's try to keep it really simple. The problem itself is very simple and clear and one sentence should be enough in the description or option description to my mind.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, by "summarize all this a little" I meant summarize it a lot too 🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

Continued in #1549 (review)

@shcheklein shcheklein merged commit fe3b871 into iterative:master Jul 10, 2020
Copy link
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.

Post-merge review.

Comment on lines +50 to +52
(see the `--plots` option of `dvc run`). When you are specifying multiple
arguments for `--targets` and `revisions`, use `--` after all the arguments
for `--targets`:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
(see the `--plots` option of `dvc run`). When you are specifying multiple
arguments for `--targets` and `revisions`, use `--` after all the arguments
for `--targets`:
(see the `--plots` option of `dvc run`). When specifying multiple targets and
`revisions`, you may use `--` after this option's arguments, e.g.:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll incorporate these changes in a new PR

Copy link
Contributor

Choose a reason for hiding this comment

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

I see it's done in #1567, thanks.

Comment on lines +58 to +60
Without `--`. this statement will show an error as argument parser confuses
`revisions` as arguments for `--targets` option. Alternatively, you can also
run above statement as:
Copy link
Contributor

Choose a reason for hiding this comment

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

Just

Suggested change
Without `--`. this statement will show an error as argument parser confuses
`revisions` as arguments for `--targets` option. Alternatively, you can also
run above statement as:
Alternatively, you can also run above statement as:

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder is this should be the first recommendation though, not --. I also wonder which other commands can benefit from the -- syntax.

Copy link
Contributor

Choose a reason for hiding this comment

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

WDYT @imhardikj ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think order is correct. As mentioned in #1544 (comment) it's almost natural instinct to give targets first and then revisions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

-- will be used only when a option accepts multiple arguments and at least one positional argument. This can be used in metrics diff. But right now metrics diff doesn't have any example which shows usage of --targets option.

Copy link
Contributor

Choose a reason for hiding this comment

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

But the same note applies to metrics diff? If so please copy it to that reference as well in your new PR, or a subsequent one 🙂 Adding an targets example (similar to the one here) would be a nice addition too but not necessary.

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.

cmd ref: doc plots diff --targets with revisions usage
4 participants