dchaley / deepcell-imaging

Tools & guidance to scale DeepCell imaging on Google Cloud Batch
8 stars 2 forks source link

Parameterize offset in OpenCV chaos testing #170

Closed dchaley closed 7 months ago

dchaley commented 7 months ago

This PR extends the OpenCV chaos testing by parameterizing the offset (or anchor point) in the footprint. In other words, randomize footprints, and also randomize which point is the center. This illuminates interesting edge cases around asymmetry. 🙃

I identified bugs by parameterizing the comparison. I formalized those specific tests in test_reconstruction.py, deriving the expectations by hand in this spreadsheet. I changed the code until the tests passed … and kept doing that until I stopped finding bugs.

One of the bugs was an interesting heisenbug, commit c3b0028 fixed an out-of-bounds error. I saw tests succeed & fail non-deterministically on the same input data, I turned bounds checking back on and saw some things were wrong. This was helpful as it highlighted some errors 😎

After a few rounds I committed the comparison test itself.

Fixes #138