-
Notifications
You must be signed in to change notification settings - Fork 0
Description
I am working with the .ipynb
file (I don't have the paired .py
file open and am not editing it) and from time to time the .ipynb
file will be rewritten by jupytext
. Mostly this results in the .ipynb
editing window dropping out of editing the cell I am editing, sometimes scrolling to somewhere radically different in the notebook; sometimes it somehow interrupts the kernel executing the current cell, or at least swallows the cell's output; occasionally I get a message telling me that the .ipynb
file is newer than VSCode thinks it should be and I have to manually tell it that it's safe to overwrite it with what I am editing.
I have VSCode autosave on pauses in typing, so I think this happens when VSCode saves the .ipynb
file; definitely I see it happen (sometimes) when I manually hit "save". I also have ruff formatting the file on save.
My guess would be that the .ipynb
file is being saved, then jupytext
runs and updates the .py
file; but then the .py
file appears to be newer, and jupytext
runs again, copying the content of the .py
file back into the .ipynb
file. File-wise, this is a safe round-trip, so it does not damage the contents. Unfortunately VSCode correctly detects that the .ipynb
file has been "modified" and reloads it; this reload affects active editing.