Make plot templates optional
See original GitHub issueThis 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:
- Created 2 years ago
- Reactions:2
- Comments:14 (11 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
What about bundling the default templates in the dvc package directory (so including them in
MANIFEST.in
andpackage_data
insetup.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 inpkg_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 neededRight, 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.