Skip to content

Commit

Permalink
save executed notebooks on azure too
Browse files Browse the repository at this point in the history
  • Loading branch information
dfm committed May 4, 2019
1 parent b226cc9 commit ab77944
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ steps:
git rm -rf .
git add -f paper/exoplanet.pdf
git add -f paper/figures/*.pdf
git add -f paper/figures/*_exec.ipynb
git add -f paper/figures/notebook_errors.log
git -c user.name='azure' -c user.email='azure' commit -m "building the paper"
git push -q -f https://$(GITHUB_USER):$(GITHUB_API_KEY)@github.com/dfm/exoplanet $(Build.SourceBranchName)-pdf >/dev/null 2>&1
displayName: 'Upload the paper'
condition: always()
5 changes: 5 additions & 0 deletions paper/figures/run_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from __future__ import division, print_function

import os
import re
import sys
import glob
Expand Down Expand Up @@ -32,6 +33,10 @@
msg += e.traceback
print(msg)
errors.append(msg)
finally:
with open(os.path.splitext(filename)[0] + "_exec.ipynb",
mode="wt") as f:
nbformat.write(notebook, f)

txt = "\n\n".join(errors)
ansi_escape = re.compile(r'\x1B\[[0-?]*[ -/]*[@-~]')
Expand Down

0 comments on commit ab77944

Please sign in to comment.