papermill
papermill copied to clipboard
Adds input of NotebookNode object directly
What does this PR do?
User can pass an in-memory nbformat.NotebookNode
object to pm.execute_notebook
instead of requiring a path.
Related to issue https://github.com/nteract/papermill/issues/444
This adds a NotebookNodeHandler
to read the input object.
A bit of refactoring was also needed to move code that expected a string:
- Stdin/Stdout was pulled out into its own handler
- The check and warning for
.ipynb
and.json
file extensions byPapermillIO
read/write was moved intoget_handler
(this also made the code more DRY)
Happy to take feedback, thanks!
Check out this pull request onÂ
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Codecov Report
Merging #670 (17be0f5) into main (98013f0) will increase coverage by
0.17%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## main #670 +/- ##
==========================================
+ Coverage 91.72% 91.90% +0.17%
==========================================
Files 17 17
Lines 1583 1605 +22
==========================================
+ Hits 1452 1475 +23
+ Misses 131 130 -1
Impacted Files | Coverage Δ | |
---|---|---|
papermill/engines.py | 98.37% <100.00%> (+0.09%) |
:arrow_up: |
papermill/execute.py | 100.00% <100.00%> (ø) |
|
papermill/iorw.py | 81.15% <100.00%> (+0.91%) |
:arrow_up: |
papermill/parameterize.py | 98.00% <100.00%> (+0.04%) |
:arrow_up: |
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 9f02383...17be0f5. Read the comment docs.