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

Adds input of NotebookNode object directly #670

Merged
merged 15 commits into from Aug 12, 2022

Conversation

dcnadler
Copy link
Contributor

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 #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 by PapermillIO read/write was moved into get_handler (this also made the code more DRY)

Happy to take feedback, thanks!

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov
Copy link

codecov bot commented Jun 28, 2022

Codecov Report

Merging #670 (17be0f5) into main (98013f0) will increase coverage by 0.17%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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%) ⬆️
papermill/execute.py 100.00% <100.00%> (ø)
papermill/iorw.py 81.15% <100.00%> (+0.91%) ⬆️
papermill/parameterize.py 98.00% <100.00%> (+0.04%) ⬆️

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.

Copy link
Member

@rohitsanj rohitsanj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for the clean refactor.

@rohitsanj rohitsanj merged commit a3f530e into nteract:main Aug 12, 2022
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.

None yet

2 participants