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 nbclient instead in ixmp.testing.run_notebook() #371

Merged
merged 3 commits into from Sep 15, 2020

Conversation

khaeru
Copy link
Member

@khaeru khaeru commented Sep 15, 2020

run_notebook() used the built-in Python subprocess module to run tutorial and test notebooks, write the results to a file, and then read the finished notebook. This process recently began to cause test & CI failures, e.g. in #370.

The Jupyter ecosystem now has a first-class package nbclient that executes notebooks programmatically; this PR:

  • adjusts the function to use this package.
  • replaces nbformat with nbclient as a requirement for the 'tests' extra set. (nbclient itself depends on nbformat.)
  • moves and update codecov.yml; in the ci/ directory, it was not being detected by the Codecov CLI tool.

How to review

  • Note that the CI checks all pass.

PR checklist

  • Add or expand tests. N/A
  • Add, expand, or update documentation.
  • Update release notes. N/A

@khaeru khaeru added the ci Continuous integration label Sep 15, 2020
@khaeru khaeru self-assigned this Sep 15, 2020
@codecov
Copy link

codecov bot commented Sep 15, 2020

Codecov Report

Merging #371 into master will decrease coverage by 0.0%.
The diff coverage is 100.0%.

@@           Coverage Diff            @@
##           master    #371     +/-   ##
========================================
- Coverage    96.8%   96.8%   -0.1%     
========================================
  Files          46      46             
  Lines        5255    5253      -2     
========================================
- Hits         5088    5086      -2     
  Misses        167     167             
Impacted Files Coverage Δ
ixmp/testing.py 78.2% <100.0%> (-0.2%) ⬇️

@khaeru
Copy link
Member Author

khaeru commented Sep 15, 2020

It was necessary to work around jupyter/nbclient#85; this was done according to jupyter/nbconvert#1372 (comment). The workaround should be removed once that issue is fixed in a version of nbclient ≥ 0.5.1.

@khaeru khaeru merged commit f47abe8 into iiasa:master Sep 15, 2020
@khaeru khaeru deleted the feature/nbclient branch September 15, 2020 15:14
@khaeru khaeru mentioned this pull request Sep 15, 2020
3 tasks
khaeru added a commit to khaeru/message_ix that referenced this pull request Sep 16, 2020
khaeru added a commit to khaeru/message_ix that referenced this pull request Sep 16, 2020
khaeru added a commit to iiasa/message_ix that referenced this pull request Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant