Skip to content
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

--set-formats fails if old metadata present #163

Closed
goerz opened this issue Jan 30, 2019 · 2 comments
Closed

--set-formats fails if old metadata present #163

goerz opened this issue Jan 30, 2019 · 2 comments

Comments

@goerz
Copy link

goerz commented Jan 30, 2019

Consider the notebook at https://raw.githubusercontent.com/qucontrol/krotov/3ff0bc3b9a4d591ec699a6b3e92ba41f7fd10bc3/docs/notebooks/02_example_lambda_system_rwa_complex_pulse.ipynb

It contains a metadata blob that the older version of jupytext added when editing the file in vim with jupytext.vim:

"jupytext": {
   "main_language": "python",
   "text_representation": {
    "extension": ".md",
    "format_name": "markdown",
    "format_version": "1.0",
    "jupytext_version": "0.8.6"
 }

If I run

jupytext --set-formats ipynb,py:light 02_example_lambda_system_rwa_complex_pulse.ipynb`

I get

[jupytext] Reading 02_example_lambda_system_rwa_complex_pulse.ipynb
[jupytext] Updating notebook metadata with {'jupytext': {'formats': 'ipynb,py:light'}}
[jupytext] Error: Notebook path '02_example_lambda_system_rwa_complex_pulse.ipynb' was expected to have extension '.md'

and the notebook file is not updated with new metadata. It works if I remove the 'jupytext metadata from the ipynb file manually, before running the command.

Do I understand the current README correctly, that "jupytext": {"formats": "ipynb,py"}, is the only metadata that jupytext v.1.0.0 will put in the notebook? If so, it should probably remove the legacy metadata from the notebook.

@mwouts
Copy link
Owner

mwouts commented Jan 31, 2019

Do I understand the current README correctly, that "jupytext": {"formats": "ipynb,py"}, is the only metadata that jupytext v.1.0.0 will put in the notebook? If so, it should probably remove the legacy metadata from the notebook.

Yes, that's the idea. Actually this is almost working, but not yet completely true on version 1.0.0-rc1, so I'll add one more test to cover and fix this...

@mwouts
Copy link
Owner

mwouts commented Feb 5, 2019

@goerz, I have just published 1.0.0-rc2:

pip install jupytext --upgrade --pre

I think we're getting closer to 1.0.0. Can you confirm it solves this issue? Thanks

@mwouts mwouts closed this as completed in 5bdf967 Feb 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants