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

Add remove regex default to TemplateExporter, don't remove cells with outputs but no source #616

Merged
merged 7 commits into from Jul 11, 2017

Conversation

Projects
None yet
3 participants
@mpacer
Copy link
Member

mpacer commented Jun 28, 2017

Closes #615.

This enables RegexRemovePreprocessor in the TemplateExporter.

It also changes its behaviour to not remove cells that do have output even if they match the regular expression (which, by default, is the empty string).

@tillahoffmann is this consistent with your original intended use of this preprocessor (keeping in mind that tag-based input filtering should also be possible soon)?

@tillahoffmann
Copy link
Contributor

tillahoffmann left a comment

Looks great! One small comment.

"""
Preprocessing to apply to each notebook. See base.py for details.
Checks that a cell matches the pattern and that (if a code cell)

This comment has been minimized.

@tillahoffmann

tillahoffmann Jun 29, 2017

Contributor

The comment here doesn't quite match the code below: The function checks that the cell does not match the pattern or is a code cell with output.

As an aside, are there any other cell types that can have output? We might just be able to check not pattern.match(cell.source) or cell.get('outputs'). Then cell.get('outputs') will evaluate to false if the key doesn't exist or the list is empty.

This comment has been minimized.

@mpacer

mpacer Jun 29, 2017

Author Member

No other cell types have outputs, so we should be in the clear.

@minrk minrk merged commit bff8219 into jupyter:master Jul 11, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@mpacer mpacer modified the milestone: 5.3 Aug 1, 2017

@mpacer mpacer added unlogged and removed unlogged labels Aug 31, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment