Skip to content

Instantly share code, notes, and snippets.

@arogozhnikov
Last active February 14, 2017 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arogozhnikov/f85abc941754ce12988d3566f8044e11 to your computer and use it in GitHub Desktop.
Save arogozhnikov/f85abc941754ce12988d3566f8044e11 to your computer and use it in GitHub Desktop.
Check reproducibility of an ipython notebook
# to be executed from different notebook!
def check_notebook_reproducibility(filename):
md5s = []
for attempt in [1, 2]:
!jupyter nbconvert --to notebook --inplace --execute $filename --ExecutePreprocessor.timeout=86400
result = !md5sum $filename
md5s.append(result)
print result
a, b = md5s
assert a == b, 'hashes are different'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment