Recommended best practice for including jupyter notebooks **without** their outputs, but enabling use of the _freeze cache #13047
Replies: 2 comments 10 replies
-
|
The freezer contents, by definition, include the contents of the notebook you executed. So if I understand your situation correctly, the essential mismatch between your requirements and Quarto features need to be solved by disabling the freezer for the pages which you don't want to check in to version control. Of course, in that case, everyone will need to re-execute those .ipynb files at every
It can be used for notebooks. It's just that freeze is, by design, meant to be used in conjunction with source control. You might be able to split the difference by using the |
Beta Was this translation helpful? Give feedback.
-
|
I'd love to rekindle this discussion if possible. I have relented and am now version controlling _freeze (I am having issues with this around version controlling many files, but that is an aside!). My question about what determines whether the cache will get used when running, for example,
If I remove the output from the jupyter notebook, it no longer "hit"s the cache, and so is re-executed. i.e. I'm having to version control the output data twice! Once within the jupyter notebook itself and once within the _freeze cache. It's an important part of my project that the default setting is that jupyter notebooks get executed (unless there has been no change to them, and there exists a cache for them) - my project partly serves as a website of documentation of code, but also as validation that this code actually runs (the publication of the site is proof that the code runs). I get the behaviour I need out of the box if I use a .qmd file; I would love to get the same when using .ipynb files (because this is a much better format for my developers to use) without having to version control the notebook output data twice! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I would like contributors of my quarto backed site to be able to include jupyter notebooks as pages. However, I have some requirements:
execute: enabled: true, such that every render will rerun the notebook from scratch if there has been a change in the source codeHowever, because the "file source" which matches the _freeze cache hash check is that of the notebook including its outputs, it doesn't seem like I can satisfy my requirements (i.e. I am forced to version control notebook outputs if I want to be able to use _freeze cache).
Is there any other current approach that I'm missing that would enable me to use the cache without having to version control jupyter notebook outputs.
Some solutions I'm currently considering involve making use of a pre render script which could do one of the following:
quarto convertto convert all ipynb files to qmd pre-render, and prevent the rendering of ipynb altogether (I worry about weird edge cases where something would work in a notebook that doesn't in qmd)All advice well received, and I'm happy to provide more information about my setup as needed.
Beta Was this translation helpful? Give feedback.
All reactions