-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
plots: add plot markers to DVC files #3807
Conversation
( | ||
PARAM_OUTS, | ||
_get_outs( | ||
[out for out in stage.outs if not (out.metric or out.plot)] | ||
), | ||
), | ||
( | ||
stage.PARAM_METRICS, | ||
_get_outs([out for out in stage.outs if out.metric]), | ||
), | ||
( | ||
stage.PARAM_PLOTS, | ||
_get_outs([out for out in stage.outs if out.plot]), | ||
), |
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 do this in a single loop in _get_outs()
. What do you say?
0a2b430
to
4feffd0
Compare
"--plots-no-cache", | ||
action="append", | ||
default=[], | ||
help="Declare output plot file (do not put into DVC cache).", |
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 copying help from the options above. Clearly this is not great.
@@ -27,10 +27,14 @@ def _remove_whitespace(value): | |||
return value.replace(" ", "").replace("\n", "") | |||
|
|||
|
|||
def _run_with_metric(tmp_dir, metric_filename, commit=None, tag=None): | |||
tmp_dir.dvc.run(metrics_no_cache=[metric_filename], single_stage=True) |
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 need to revisit this helper at some point. It was (and is) a bit hackish.
Do we plan to add default metric in a plot there? Current "strategy" of selecting a last key doesn't look well. |
@Suor Could you elaborate? |
@efiop plot data file contains several plots, i.e. values of several metrics over something. Here it's I think we should have a way to set default metric to build plot from, probably within a dvc file. |
Adding to the above, there is a |
@pared knowing default metric to select from plot data would be very valuable to the corresponding viewer feature. Now there is no interface to change anything, so default matters, it will matter even when some interface will be added. Will also improve cli experience. |
@Suor to not extend this PR scope, maybe we should create p0 for that? |
Another issue I see is that default metric ( |
4f4dbb5
to
d51b288
Compare
if out.plot and isinstance(out.plot, dict): | ||
res.update(out.plot) |
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.
Can you please point me where this is being set as dict? I couldn't find it. π
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.
@skshetry It is actually not set anywhere programmatically (we might introduce dvc plots modify
later, but for now it should be set by-hand).
Involves some refactoring to make plots comply with the rest of the code base.
77be08a
to
cd43bcc
Compare
Just to sync this with the rest of the codebase. We should consider renaming it to "workspace" everywhere, but for now I opt to not touch it to not break something that depends on it.
Better corresponds to other commands like `import`.
Makes it comply with `dvc metrics/params` CLI options.
Based on feedback from the users.
@Suor Great questions! For now going only with |
Ok, merging for now. Will have a followup PR. |
β I have followed the Contributing to DVC checklist.
π If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here. If the CLI API is changed, I have updated tab completion scripts.
iterative/dvc.org#1255
Thank you for the contribution - we'll try to review it as soon as possible. π