-
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
Suggestion: --sync as default when script is older than notebook #254
Comments
Excellent question... Thanks for asking! Well... when we initially implemented paired notebooks we said that
We preferred that implementation over timestamp priorities because we were not confident that we could trust timestamps. Notice that the check on timestamps is only a safeguard here, and aims at protecting the users who have turned off Jupytext for a while, and then on again, from having their notebooks reverting to the obsolete version contained in the script... As you noticed, the
Does that sound OK? Obviously, if you had a strong argument in the opposite direction, we could consider adding an option for the contents manager to load the input cells from the most recent file and reproduce in Jupyter the same behavior as with the Last but not least, your example is a particular case of #231. Would you like an
and get a paired notebook that Jupyter can open? If so, can you tell me if you usually pass any option to |
Good explanation, these choices make sens. If My opinion about that execute bit is no jupytext shouldn't handle this part. The use case here is pretty simple because it's only with jupyter. However, jupytext being multi language, wouldn't it be misleading for the user (for parameters for instance as mentioned in #231) ? I think it's clearer having to call the specific tool (i.e. Jupyter here) and to pass all the options there. It's only one line in a script (two if synced) and makes it highly readable. |
Thanks @Chichilele for your comments. It's very interesting for me to debate about these points, and determine what can be useful (or not) for users!
Interesting. I think that I mostly agree - executing notebooks is a different thing that converting them to alternative formats. Still... I'd appreciate to have a simple way to generate a paired notebook with outputs from a text document. Maybe "simple" here could just mean "well documented", using the three commands that you mention. Or maybe we could use pipes to avoid writing the document multiple times on disk... we'll discuss this later on at #231 ! |
After building a notebook from python script:
the notebook is not usable in jupyter. Error from jupytext extension:
This error is clearly understandable (thanks!). However it happens only if the notebook is more recent than the python script. If the notebook is older (the otherway around), it is synced to the python script.
So it's necessary to do what's advised in the error or (my pref):
Wouldn't it be better to have the same behavior in both ways ? If not I'd be interested to learn why :-).
Thank you for this tool !!
The text was updated successfully, but these errors were encountered: