dvc icon indicating copy to clipboard operation
dvc copied to clipboard

top-level params/metrics/plots/artifacts: support templating and foreach

Open dberenbaum opened this issue 2 years ago • 7 comments

Templating and foreach are only supported in stages in dvc.yaml. It would be nice to have support in top-level params, metrics, plots, and artifacts.

dberenbaum avatar Dec 14 '22 19:12 dberenbaum

@skshetry pointed out that these should probably be separate issues since templating should be straightforward (syntax doesn't change, reuse existing top-level vars), whereas foreach will require new syntax (for one thing, stages are dicts whereas other top-level fields are lists). When we get to these, we can split them up.

dberenbaum avatar Jan 12 '23 13:01 dberenbaum

I am not sure I fully understand what foreach means for top-level metrics/params/plots

daavoo avatar Jan 12 '23 16:01 daavoo

yeah, I don't understand it as well. We are looking for a way to make it DRY, and less repeatable. Think of cases where the stages are already created with foreach and looped.

I proposed adding support for regex/globbing or directory params/metrics supports as an alternative too.

Also see https://iterativeai.slack.com/archives/CB41NAL8H/p1667074000124059.

skshetry avatar Jan 12 '23 16:01 skshetry

Globbing (also for deps, out, etc.) would be incredibly useful!

xnhp avatar Aug 29 '23 14:08 xnhp

Would this feature be added any time soon?

There's a lack of consistency between the stage plots and top level plots. Stage plots support templating but not the functionality of top level plots. Will have to hard code paths for the plots for the moment.

paluchasz avatar Sep 15 '23 09:09 paluchasz

@paluchasz Unfortunately, there's no estimate now for this feature. Do you use dvclive or is it possible for you to do so? That would write the paths to plots out for you automatically.

dberenbaum avatar Sep 15 '23 17:09 dberenbaum

Let's include all top-level sections in this issue and close #9999 as a duplicate.

dberenbaum avatar Feb 06 '24 13:02 dberenbaum

I am planning on working on this, this week.

skshetry avatar Mar 04 '24 18:03 skshetry

Just wanted to +1 the glob patterns request

uditrana avatar Mar 07 '24 19:03 uditrana