-
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
Opening non Notebook related scripts automatically adds metadata #110
Comments
Hello @andrethrill ! Well, currently there is no such option. But I would like to offer one! What would you think of a
|
Your example is also a good example for #105: the YAML header is way too long, and such long headers typically introduce irrelevant noise in version control. |
Thanks for your answer.
Just to be sure we are talking about the same thing: With that approach, if the user opens a native python script, does not do any action with jupytext, does his python edits and hit save, only the python script gets saved (no .ipynb) without any extra metadata contents (no header and no cell metadata)? Otherwise, if the user changes that new parameter to False then it will become a regular notebook and both .py and .ipynb are saved? If the answers are yes to both than it sounds perfect. But I'm not sure this is exactly what you are suggesting? Thinking differently: I don't know if it's feasible because it requires reading the file in advance but what about, if the user opens a script that has no jupytext metadata (=native python script) the regular jupyter editor fires up? This way, Not interfering with the default jupyter behaviour. |
Well, @andrethrill , it's a good thing that you describe very precisely your expectations!
|
Hello @andrethrill , I have started working on this in the v0.8.4 branch. Jupytext will set and use the following metadata to filter header or cell metadata:
|
Hi @mwouts, Thanks for your support.
As far as my understanding goes, I believe the behaviour should be the same from jupyter and jupytext.
This makes sense to me. The reasoning behind me opening this issue was seeing if it was possible to make jupytext as less intrusive (read, not changing default behaviour) as possible in functionalities (such as editing pure python scripts) that go outside of Jupytext core (notebooks). At the same time I also see the option of editing script as notebooks with good eyes :)
That's awesome. Thank you so much once again for your support! |
Hello @andrethrill , I have prepare a pre-release version with this feature, available with
The documentation for the metadata filtering is here. Could you please test, and let me know if that works well for you. Comments on the documentation may also be useful ! |
- Changed `additional_metadata_on_text_files` to `freeze_metadata` - Option added to the command line
- Changed `additional_metadata_on_text_files` to `freeze_metadata` - Option added to the command line
Available in v0.8.4. Note that in that version the option name has changed! It is now named |
@mwouts I had the chance to give it a try now. So far it looks awesome! It fits perfectly the use of my team. Thank you for your support :) |
Imagine I have a non-notebook related script which contents are:
If I open in it using the jupyter interface, after installing jupytext, it opens as if it were a notebook. Then if I do some minor edits and save it, its contents become:
Is there a way to avoid jupytext interfering with native python scripts?
The text was updated successfully, but these errors were encountered: