mwouts / jupytext

Jupyter Notebooks as Markdown Documents, Julia, Python or R scripts
https://jupytext.readthedocs.io
MIT License
6.6k stars 386 forks source link

Unable to unpair ipynb in jupyter notebook #1191

Closed hugokerstens closed 8 months ago

hugokerstens commented 9 months ago

When working in a md file from jupyter notebook I am unable to unpair the ipynb notebook. I tried to unpair ipynb in two ways:

In both cases, jupyter.jupytext.formats: md,ipynb is unchanged in the metadata, and the ipynb output is saved.

This issue is not present when using jupyterlab, where the two ways I described above to disable pairing work as intended.

Versions used:

jupyter                       1.0.0
jupyter_client                8.6.0
jupyter-console               6.6.3
jupyter_core                  5.5.0
jupyter-events                0.9.0
jupyter-lsp                   2.2.0
jupyter_server                2.10.1
jupyter_server_terminals      0.4.4
jupyterlab                    4.0.8
jupyterlab-pygments           0.2.2
jupyterlab_server             2.25.1
jupyterlab-widgets            3.0.9
jupytext                      1.16.0
mwouts commented 9 months ago

Oh that's unexpected. Thanks for reporting this. Indeed I can confirm the issue on Binder. Do you have the same issue if you call these commands from the command palette too?

mahendrapaipuri commented 9 months ago

I can reproduce the bug too. It is wierd that it occurs only on notebook. I am in a conference all this week. I will look into it next week unless someone wants to have a look at it before. I did not notice any obvious errors in browser console while executing these commands.

We should add UI tests for notebook as well like we do for Lab. Ref #1192

mwouts commented 9 months ago

No worries @mahendrapaipuri, the fix for this can wait - you should make the most of your conference! If I had to make a guess I would say that there have not been many extensions for Jupyter Notebook 7 yet, so using extensions there might be a less well tested area?

mahendrapaipuri commented 9 months ago

Well, JupyterLab extensions should work out-of-the-box with Notebook 7 (except for JupyterLab's launcher part). That was the design objective of Notebook 7 .So, all the extensions of JupyterLab 3 that have been upgraded to JupyterLab 4 should work with Notebook 7 (as long as we use JupyterLab's Launcher as optional dependency in the extension).

I will check next week, but it could be that notebook tracker behaving differently in JupyterLab and Notebook.

mahendrapaipuri commented 9 months ago

@hugokerstens @mwouts Could you please provide me detailed steps on how to reproduce the behavior on Lab and Notebook? Cheers!!

mwouts commented 9 months ago

Hey @mahendrapaipuri , here are the detailed steps to reproduce:

  1. Go to Binder:notebook (or launch jupyter notebook)
  2. Click on File/New Text Notebook/New MyST Markdown Notebook
  3. Click on File/Jupytext/Pair notebook with ipynb document
  4. Click again on File/Jupytext/Pair notebook with ipynb document.

Clicking a second time does not deselect the menu entry, and the notebook metadata continues to be

jupytext:
  formats: md:myst,ipynb
mahendrapaipuri commented 9 months ago

Cheers @mwouts for the instructions. I have the same behaviour with JupyterLab too. What I mean is I cannot unpair markdown notebook in the JupyterLab interface either. In the original comment @hugokerstens mentioned that the unpairing works on JupyterLab.

@mwouts Could you please test it on JupyterLab and confirm that unpairing does not work on JupyterLab too? Cheers!!