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

Infer script extension based on Jupyter kernel - 'auto' extension #93

Closed
z-m-k opened this issue Oct 6, 2018 · 7 comments
Closed

Infer script extension based on Jupyter kernel - 'auto' extension #93

z-m-k opened this issue Oct 6, 2018 · 7 comments

Comments

@z-m-k
Copy link

z-m-k commented Oct 6, 2018

If I provide a list of let's say: "ipynb,jl,py" it would be great if jupytext inferred which script extensions to create based on the kernel specified in ipynb.

@mwouts
Copy link
Owner

mwouts commented Oct 6, 2018

Sure, we could do that. What would you think of using a keyword like script or auto for this (or any other that you would suggest)? That would allow to preserve the current functionality, which may be useful to people who mix multiple languages in a notebook.

@z-m-k
Copy link
Author

z-m-k commented Oct 6, 2018

Yes, auto would work best for this.

mwouts added a commit that referenced this issue Oct 6, 2018
@mwouts
Copy link
Owner

mwouts commented Oct 6, 2018

I have implemented this on branch v0.8.0. Would you like to test it? You should be able to use 'auto' in all the options that accepts extensions. See for instance the tests: https://github.com/mwouts/jupytext/blob/v0.8.0/tests/test_contentsmanager.py#L440

@z-m-k
Copy link
Author

z-m-k commented Oct 8, 2018

auto works, but auto:percent ends up in :light formatting.

@z-m-k
Copy link
Author

z-m-k commented Oct 8, 2018

More precisely with notebook metadata:

  "jupytext": {
    "formats": "ipynb,auto:percent"
  }

The script metadata is as follows:

#   jupytext:
#     formats: ipynb,auto:percent,py:light

@mwouts
Copy link
Owner

mwouts commented Oct 8, 2018

Thanks @z-m-k for the feedback. I confirm that I also observe the same behavior. I'll soon add a few more tests, and correct this.

mwouts added a commit that referenced this issue Oct 9, 2018
Format is not appended to 'formats' when extension is not present there #93  #95
Format name and extension in 'text_representation' section
mwouts added a commit that referenced this issue Oct 9, 2018
@mwouts mwouts changed the title Multiple default formats Infer script extension based on Jupyter kernel - 'auto' extension Oct 10, 2018
mwouts added a commit that referenced this issue Oct 10, 2018
@mwouts mwouts mentioned this issue Oct 10, 2018
mwouts added a commit that referenced this issue Oct 10, 2018
mwouts added a commit that referenced this issue Oct 10, 2018
Format is not appended to 'formats' when extension is not present there #93  #95
Format name and extension in 'text_representation' section
mwouts added a commit that referenced this issue Oct 10, 2018
mwouts added a commit that referenced this issue Oct 10, 2018
@mwouts
Copy link
Owner

mwouts commented Oct 10, 2018

@z-m-k the new release (v0.8.0) should have a good support for the auto extension. Please reopen if that is not the case! Thanks

@mwouts mwouts closed this as completed Oct 10, 2018
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