question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make plot templates optional

See original GitHub issue

This is for discussion.

Not all of us use plots when using dvc, so for many repositories when you do dvc init it will add a folder .dvc/plots with a lot of json files that end up being unused. It would be good to have an option to ignore these files, say

dvc init --no-plots

Then if the user don’t have it and tries to do anything with dvc plot we create these templates (or perhaps throw an error saying they have to initialise a template).

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:14 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
pmrowlacommented, Sep 16, 2021

What about bundling the default templates in the dvc package directory (so including them in MANIFEST.in and package_data in setup.py) instead of populating .dvc/plots/ with the defaults?

So by default when .dvc/plots/<template_name>.html doesn’t exist we would look for it in pkg_resources.resource_filename('dvc.plots', 'templates/<template_name>.html').

If users want to override the defaults they can continue to do so in .dvc/plots/... (and we should provide some init command or flag to copy the current defaults into .dvc/plots for users to start with).

For users that are not using their own custom plots, they would just have an empty/nonexistent .dvc/plots/ dir and always get the latest default template (via whatever DVC release they are using) and users that are using their own customized versions would just continue to use their custom one instead of the latest default. (In the case for users customizing their own templates, they would be responsible for keeping them up to date with DVC releases as needed)


If we do it this way we could also just allow users to specify their own plots directory entirely (and search for matching templates in [custom_dir, .dvc/plots, DVC_PKG_DIR/plots/templates] with some documented priority) so that they can more easily use some shared set of plot templates between projects as needed

1reaction
dberenbaumcommented, Sep 17, 2021

Right, I forgot about that idea! That should make it easy to show the templates in the repo, but let’s not add any of this to #6550. Let’s address in a separate PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

plots templates | Data Version Control - DVC
List built-in plots templates, or show JSON specification for one so that you can ... It can be defined with the -x option...
Read more >
Save a custom chart as a template - Microsoft Support
To reuse a chart you customized, you can save it as a chart template (*.crtx). Right-click the chart, and select Save as Template....
Read more >
8 Novel Outline Templates That Help You Write Your Story
We've created novel outline templates for each major genre that follow the Hero's Journey and other proven story frameworks.
Read more >
Plot Templates | Inventor Nastran 2020
Four of these templates are available; more can be created by right-clicking on Plot Templates and selecting New.
Read more >
Origin Help - Graph Template Basics - OriginLab
If you would like to customize the graph and, optionally, save your customizations to a template file, see the next section.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found