Last active
February 14, 2017 13:35
-
-
Save arogozhnikov/f85abc941754ce12988d3566f8044e11 to your computer and use it in GitHub Desktop.
Check reproducibility of an ipython notebook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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