-
Notifications
You must be signed in to change notification settings - Fork 394
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
Conversation
> 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`: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Continued in #1549 (review)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Post-merge review.
(see the `--plots` option of `dvc run`). When you are specifying multiple | ||
arguments for `--targets` and `revisions`, use `--` after all the arguments | ||
for `--targets`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(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.: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT @imhardikj ?
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Fixes #1425
Continuation of #1544
@jorgeorpinel @pared I have included possible uses cases in the note