TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: nbsnapshot – Snapshot testing for Jupyter notebooks

2 pointsby edublancasalmost 3 years ago
I want to share a project I&#x27;ve been working on to facilitate Jupyter notebook testing (https:&#x2F;&#x2F;github.com&#x2F;edublancas&#x2F;nbsnapshot).<p>When analyzing data in a Jupyter notebook, I unconsciously memorize &quot;rules of thumb&quot; to determine if my results are correct. For example, I might print some summary statistics and become skeptical of some outputs if they deviate too much from what I&#x27;ve seen historically. For more complex analysis, I often create diagnostic plots (e.g., a histogram) and check them whenever new data arrives.<p>Since I constantly repeat the same process, I figured I&#x27;d code a small library to streamline this process. nbsnapshot benchmarks cell&#x27;s outputs with historical results and raises an error if the output deviates from an expected range (by default, 3 standard deviations from the mean).<p>To learn more, check out the blog post (https:&#x2F;&#x2F;ploomber.io&#x2F;blog&#x2F;snapshot-testing&#x2F;).<p>I quickly put together this as a proof of concept and would love to learn if this sounds useful for other notebook users so I spend more time working on it. Please share your feedback!

no comments

no comments