-
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
Is there a list of which formats offer roundtripping ? #426
Comments
Hello @stuaxo , thanks for asking. The three main formats, i.e. These formats are documented here. Given a text file, or an
For this, you can give a try to the notebook metadata filter. Uncheck the 'include metadata' entry in the Jupytext menu, or execute:
|
That looks good, is there a list that maps extensions to the format names somewhere ? When I started I was trying notebook -> py, does that mean I was using the light format ? |
That's a good idea! I'll update the PR. Basically,
|
Thanks. |
Hi @mwouts , Thank you for creating Re-opening this issue to avoid redundancy in a newly created relevant issue. For example, I am converting an # jupytext installed via conda: `conda install conda-forge::jupytext=1.3.3`
jupytext --to Rmd test.ipynb Then I am converting back from jupytext --to ipynb test.Rmd and doing git diff to check fidelity of conversion in the roundtrip of the
This gives me a minor diff in principle, only some metadata. However this messes with automatic ❓ Is there a way to set parameters when converting for an identical roundtrip My initial {
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Hello world"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"cat(\"Hello world\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "R",
"language": "R",
"name": "ir"
},
"language_info": {
"codemirror_mode": "r",
"file_extension": ".r",
"mimetype": "text/x-r-source",
"name": "R",
"pygments_lexer": "r",
"version": "3.6.1"
}
},
"nbformat": 4,
"nbformat_minor": 4
} My jupytext regenerated {
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Hello world"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"cat(\"Hello world\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "R",
"language": "R",
"name": "ir"
}
},
"nbformat": 4,
"nbformat_minor": 4
} My diff is the following: },
"language_info": {
"codemirror_mode": "r",
"file_extension": ".r",
"mimetype": "text/x-r-source",
"name": "R",
"pygments_lexer": "r",
"version": "3.6.1" Let me know if you need more information for investigating this. |
Hello @cgpu , could you please give a try to the
What you see above is the effect of Jupytext's default filter for the metadata, which excludes the Alternatively, you can also have a look at the metadata filters and set |
Thank you for the heads up, I used it as suggested |
I tried jupytext initially, with
.py
, but I noticed, when roundtripping to ipynb, that multiple newlines can result in code cells splitting up.Now I'm trying .md, as I could see this in github, though it turns out to be not completely ideal as github shows all the metadata at the top.
What is the best format to use that can handle a round trip ?
The text was updated successfully, but these errors were encountered: