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

Use config in read and write functions #753

Merged
merged 4 commits into from
Mar 16, 2021
Merged

Conversation

mwouts
Copy link
Owner

@mwouts mwouts commented Mar 14, 2021

This PR adds a config argument to the jupytext.read(s) and jupytext.write(s) functions.
This should help fixing #752

What remains to be done:

  • The config is used only when saving (except for the rst2md conversion which has to be used when reading the file) that is not a good idea - the notebooks with no metadata don't store the format options, so for these notebook at least it makes sense to use the config also when reading them.
  • We should deprecate default_metadata_filter in favor of metadata_filter, etc, and also default_jupytext_formats in favor of formats (and provide backward compatibility) => The PR for that is at Normalize jupytext config options names #754

@codecov
Copy link

codecov bot commented Mar 14, 2021

Codecov Report

Merging #753 (4a474ea) into master (593bcef) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #753   +/-   ##
=======================================
  Coverage   99.10%   99.10%           
=======================================
  Files         106      106           
  Lines        9939     9948    +9     
=======================================
+ Hits         9850     9859    +9     
  Misses         89       89           
Impacted Files Coverage Δ
tests/test_metadata_filters_from_config.py 100.00% <ø> (ø)
jupytext/cli.py 96.13% <100.00%> (-0.07%) ⬇️
jupytext/combine.py 100.00% <100.00%> (ø)
jupytext/config.py 97.48% <100.00%> (-0.07%) ⬇️
jupytext/contentsmanager.py 97.82% <100.00%> (-0.02%) ⬇️
jupytext/header.py 99.35% <100.00%> (+<0.01%) ⬆️
jupytext/jupytext.py 98.38% <100.00%> (+0.06%) ⬆️
jupytext/version.py 100.00% <100.00%> (ø)
tests/test_contentsmanager.py 100.00% <100.00%> (ø)
tests/test_header.py 100.00% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 593bcef...4a474ea. Read the comment docs.

@mwouts mwouts merged commit e28497a into master Mar 16, 2021
@mwouts mwouts deleted the use_config_in_write_function branch March 16, 2021 20:51
@mwouts mwouts added this to the 1.11.0 milestone Mar 17, 2021
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

Successfully merging this pull request may close these issues.

1 participant