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 convenience function for executing notebooks #573

Merged
merged 2 commits into from Apr 25, 2017

Conversation

Projects
None yet
2 participants
@takluyver
Copy link
Member

takluyver commented Apr 21, 2017

Using the ExecutePreprocessor API is slightly awkward if you want to execute a notebook from a Python script. This provides a more convenient executenb function to do it.

Prompted by takluyver/nbparameterise#4

@takluyver takluyver added this to the 5.2 milestone Apr 21, 2017

@takluyver takluyver referenced this pull request Apr 21, 2017

Closed

Timeout #4

@mpacer

This comment has been minimized.

Copy link
Member

mpacer commented Apr 21, 2017

LGTM

@mpacer

This comment has been minimized.

Copy link
Member

mpacer commented Apr 21, 2017

Hmm actually do you have any thoughts on how the API would expose the ability to pass configuration values (e.g., other preprocessors that would be run before running nbexecute)? I feel like that could also be useful from the perspective of nbparameterize.

@mpacer

This comment has been minimized.

Copy link
Member

mpacer commented Apr 21, 2017

If you don't want to make that part of this PR, no worries, and I'll just merge as is.

@takluyver

This comment has been minimized.

Copy link
Member Author

takluyver commented Apr 24, 2017

how the API would expose the ability to pass configuration values (e.g., other preprocessors that would be run before running nbexecute)?

At least for the case of other preprocessors running before execution, I would suggest running them before calling the function. There's no need to design a new API for running a series of operations in order, because code already defines a series of operations to run in order. ;-)

# Complex
do_y(..., pre_function=do_x)

# Simple
do_x(...)
do_y(...)

We may want to provide similar convenience functions for other preprocessors, so they're easy to call from Python code. But I'd take that on a case-by-case basis.

I notice that this branch has a merge conflict, so I'll resolve those.

@mpacer

This comment has been minimized.

Copy link
Member

mpacer commented Apr 25, 2017

Fair enough and fair enough. LGTM, merging.

@mpacer mpacer merged commit 2285e3f into jupyter:master Apr 25, 2017

1 check passed

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

@mpacer mpacer added to_changelog and removed to_changelog labels May 24, 2017

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