-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Leading comments for interpreter and encoding in scripts are not preserved #241
Comments
Hello @matteoipri , thanks for reporting this. I would have expected the two lines to be preserved by Jupytext, cf. this test. Also, if I open in jupyter notebook a script
then I get a notebook with the following
Can you compare to what you get? Do you have any custom configuration option set on Jupytext? |
Hi @mwouts, thanks for your reply. It triggered some more tests on my side. I confirm that the test you suggest works as expected. The error is that I did not disclose my full test script. In order to avoid the pop-up asking for which kernel to use with the notebook, I add the YAML header to my scripts, like in the following:
This script, once opened as notebook and saved again looks like this:
I also just noticed that I am running two outdated versions: JupyterLab 0.35.5 (instead of 0.35.6) and jupytext 1.1.2 (instead of 1.1.3). Thanks |
I see! Thanks for the additional details - I'll add one more test to be sure this gets fixed. |
Great, thanks! |
Hi,
I have a repository with Python scripts that I want to run as notebooks in JupyterLab.
My workflow with jupytext is the following:
All my scripts begin with the following two lines:
The Notebooks are opened exactly as I want them by jupytext, i.e. the cells are split at the points I want and those two lines are not present in the notebook.
Anyway, when I save my changes in the notebook those two lines are deleted from the python script, while I would like to still have them in the scripts.
Why are those two lines not preserved?
Is there a way to have them preserved?
Thanks
PS: this extension is awesome!
The text was updated successfully, but these errors were encountered: