You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got into a habit of doing quarto convert notebook.ipynb && quarto render notebook.qmd to turn my notebooks into a QMD file, for testing top-to-bottom, and committing as a .qmd file that was verified to work. During quarto render the original notebook is deleted. I can see why this can be useful, but for me it's not useful at all, because I found the hard way that my notebook with 1000+ executed cells got erased. And my IPYNBs are in .gitignore anyway.
A better behavior, in my view, is to keep the existing IPYNB file. Or at least to have a -k, --keep option to quarto render.
Steps to reproduce
No response
Expected behavior
The preserve .ipynb file on quarto render .qmd
Actual behavior
The existing .ipynb file gets overwritten, then deleted
Your environment
No response
Quarto check output
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.1.1: OK
Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.3.433
Path: ~/quarto/quarto-1.3.433/bin
Quarto creates Jupyter notebooks while rendering from a Quarto document.
This temporary notebook has the same name as the Quarto document.
So, the suggested fix won't do anything as your notebook will be overwritten by the temporary one.
Why not render the notebook directly?
The fix would be to have your source notebooks in a different directory.
Thanks for your response. The simplest fix is to do render .ipynb first, then convert.
I'd imagine it's not uncommon to have both .qmd and .ipynb files present with the same name, and writing over an existing .ipynb without any warning isn't great.
I imagine this entire class of bugs goes away when we implement the execution planner in 1.5, but I agree that if we can ship a workaround in 1.4 we absolutely should.
Activity
mcanouil commentedon Aug 8, 2023
Quarto creates Jupyter notebooks while rendering from a Quarto document.
This temporary notebook has the same name as the Quarto document.
So, the suggested fix won't do anything as your notebook will be overwritten by the temporary one.
Why not render the notebook directly?
The fix would be to have your source notebooks in a different directory.
liquidcarbon commentedon Aug 8, 2023
Thanks for your response. The simplest fix is to do
render .ipynbfirst, then convert.I'd imagine it's not uncommon to have both .qmd and .ipynb files present with the same name, and writing over an existing .ipynb without any warning isn't great.
mcanouil commentedon Aug 8, 2023
To note, it's a duplicate of:
jjallaire commentedon Aug 8, 2023
Yeah, I agree that we should find a way to have the temporary notebook have a more distinguished name so this doesn't occur.
cscheid commentedon Aug 11, 2023
I imagine this entire class of bugs goes away when we implement the execution planner in 1.5, but I agree that if we can ship a workaround in 1.4 we absolutely should.