-
Notifications
You must be signed in to change notification settings - Fork 391
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
Normalize jupytext config options names #754
Conversation
I'll be happy to have some user feedback on this PR... @chrisjsewell , @JohnPaton , @matthew-brett , @grst do you think that renaming e.g. Installing the dev version can be done with
(prefix the above with NB: Using the previous names is still an option, but using them will cause a |
I think this is neater, and also that the deprecation warning is fine, as long as the old names stay supported for several versions to give people time to switch |
Hi Marc, I really like this change, I was always struggling to remember how this setting was called. While we are at it, wouldn't it be more natural to use a TOML list directly instead of splitting a string? I.e. # always pair ipynb notebooks to py:percent files
formats = ['ipynb', 'py:percent']
# Pair notebooks in subfolders of 'notebooks' to scripts in subfolders of 'scripts'
[formats]
"notebooks/" = "ipynb"
"scripts/" = "py:percent"
"/path/to/mixed" = ["py:percent", "ipynb"] Regarding the deprecation warning (or should it be a FutureWarning?): I think the earlier the better to give the users time to switch. When strictly obeying semantic versioning, the old version would need to be supported until eventually jupytext 2.0 is released. |
Thank you @JohnPaton and @grst for your feedback! Yes Gregor I agree, we can give a try to using explicit lists... I'll let you know how it goes. Thanks also for the other suggestions, yes sure I can use |
- default_jupytext_formats -> formats - default_notebook_metadata_filter -> notebook_metadata_filter - default_cell_metadata_filter -> cell_metadata_filter - default_cell_markers -> cell_markers Previous option names are supported but will cause a DeprecationWarning
…r" in the tests and documentation
…e tests and documentation
to get rid of the 'Sampling from a set deprecated' warning
…nfig names are used
8189a40
to
681d377
Compare
@grst I have taken most of your suggestion above regarding the However I am not sure to see what you meant with |
Codecov Report
@@ Coverage Diff @@
## master #754 +/- ##
==========================================
- Coverage 99.10% 99.10% -0.01%
==========================================
Files 106 106
Lines 9939 10012 +73
==========================================
+ Hits 9850 9922 +72
- Misses 89 90 +1
Continue to review full report at Codecov.
|
FYI, if you want to use a different config in a subfolder, then you can simply create another |
This was just to show that such constructs would be easy and legible using TOML dicts/lists. I don't think it's something used very frequently, and, as you said, putting a separate config in that folder covers that case already. |
This PR goes a bit further than #753 and normalizes the names of the options in the
jupytext.toml
file, to match the metadata seen in the Jupytext notebooks. In particular:default_jupytext_formats
becomesformats
default_notebook_metadata_filter
becomesnotebook_metadata_filter
default_cell_metadata_filter
becomescell_metadata_filter
default_cell_markers
becomescell_markers
Previous option names are still supported but will cause a
DeprecationWarning
.