AssertionError in running all tests script

Issue #72 new
Greg Fleishman created an issue

Hi PyCA devs,

When I run:

python -m unittest discover -v -p '*UnitTest.py'

from the Testing directory, it runs a total of 87 tests. Many are skipped, as I do not have a GPU or CUDA on this machine. There are 2 errors, however the PyCA exception for both say "CUDA support not compiled" so I'm assuming these skips and errors are not strictly problematic.

Real issue, I get one failure:

FAIL: test_SplatWorldAdjoint (AdjointUnitTest.MiscTestCase)

Traceback (most recent call last): File "/Users/fleishmang/Development/source/pyca/Testing/AdjointUnitTest.py", line 106, in test_SplatWorldAdjoint self.assertLess(abs(smallIP-regIP), 5e-5) AssertionError: 6.103515625e-05 not less than 5e-05


I really have no idea what the origin of this error could be. I'm building PyCA as a dependency for Miaomiao's Flash code. The Flash package compiles, but when I run the Flash image matching, I run into a similar error:

bash runImageMatching.sh Assertion failed: (x > -static_cast<int>(sx)), function getSafePtr, file /Users/fleishmang/Development/source/pyca/Code/Cxx/inc/base/pycaUtils.h, line 237. runImageMatching.sh: line 17: 50569 Abort trap: 6

These seem related, I'd like your input on that as well if possible.

Comments (3)

  1. Greg Fleishman reporter

    I've identified the source of the Assertion Failure as it pertains to flash: I was simply providing images with too large an intensity range for what flash currently supports, which resulted in some numerical instability, eventually causing the Assertion to fail (i.e. normalizing my inputs fixed it).

    On the other hand, the PyCA test Assertion Failure has nothing to do with my images - my guess is that some library which PyCA is using to do some numerical computations has been updated, resulting in slightly different mathematical results and a reduction in accuracy for this particular test? As long as flash is running for the time being I'm happy, so I'm not going to look into it further, but it would be nice to know what is going on.

  2. Caleb Rottman

    These unit tests are slightly broken at the moment. The quick fix would be to seed the random number generator before generating the random images/fields. But currently they only pass the tests a certain percentage of the time.

  3. Greg Fleishman reporter

    That makes sense, as despite being random images, the failure value for the IP diff was the same every time I ran it (6.103515625e-05), which I didn't really understand until now. Shame the default initialization for the random number generator produces a failure case :p

  4. Log in to comment