You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
======================================================================
FAIL: test_unwrap.test_wrap_around(3, 1)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/travis/build/scikit-image/scikit-image/skimage/restoration/tests/test_unwrap.py", line 104, in check_wrap_around
image_unwrap_wrap_around[index_last])
File "/home/travis/virtualenv/python2.6.9/lib/python2.6/site-packages/numpy/testing/utils.py", line 470, in assert_almost_equal
raise AssertionError(msg)
AssertionError:
Arrays are not almost equal to 7 decimals
ACTUAL: -25.132741228718345
DESIRED: 12.566370614359172
-------------------- >> begin captured stdout << ---------------------
endpoints without wrap_around: -31.4159265359 6.28318530718
endpoints with wrap_around: -25.1327412287 12.5663706144
--------------------- >> end captured stdout << ----------------------
----------------------------------------------------------------------
Ran 1133 tests in 91.295s
FAILED (SKIP=51, failures=1)
@ahojnnes, I suspect this line might be the problem, as it is the only source of randomness I can find. The same line also exists here. Any ideas? Can we limit the range of rand() with a modulo or use srand() somewhere?
It looks like the output merely changes the order (and/or sign? can't recall) of the output values, 12.566... and -25.132... I assume that both outputs are actually correct. (?) So, instead of figuring out wtf is wrong with the code, why don't we change the test to assert that the sorted arrays are equal? Or that the result is equal to A or B?
I agree it looks like an ordering issue, which may indeed be due to the rand() call. If @ahojnnes does not disagree, I say change the test to use sorted().
Actually, no, the point of the test is that the end points are equal, and we are testing the end points explicitly.
# with wrap around, the endpoints of the image should be equalassert_almost_equal(image_unwrap_wrap_around[index_first],
image_unwrap_wrap_around[index_last])
Activity
blink1073 commentedon Nov 13, 2014
@ahojnnes, I suspect this line might be the problem, as it is the only source of randomness I can find. The same line also exists here. Any ideas? Can we limit the range of
rand()with a modulo or usesrand()somewhere?jni commentedon Nov 16, 2014
idea: punt issue with more tolerant test.
It looks like the output merely changes the order (and/or sign? can't recall) of the output values, 12.566... and -25.132... I assume that both outputs are actually correct. (?) So, instead of figuring out wtf is wrong with the code, why don't we change the test to assert that the sorted arrays are equal? Or that the result is equal to A or B?
blink1073 commentedon Nov 16, 2014
I agree it looks like an ordering issue, which may indeed be due to the
rand()call. If @ahojnnes does not disagree, I say change the test to usesorted().blink1073 commentedon Nov 16, 2014
Actually, no, the point of the test is that the end points are equal, and we are testing the end points explicitly.
blink1073 commentedon Nov 16, 2014
I'm testing a few things on a local branch.
blink1073 commentedon Nov 16, 2014
Opened #1225 instead.
blink1073 commentedon Dec 12, 2014
I'm closing, as no one could reproduce locally, and it has disappeared from the Travis builds.
blink1073 commentedon Dec 12, 2014
Ugh, spoke to soon: https://travis-ci.org/blink1073/scikit-image/jobs/43854290
jni commentedon Dec 13, 2014
LOL I just knew it when you wrote this that it would come back to bite us!!! LOL
blink1073 commentedon Dec 13, 2014
yeah, yeah...
stefanv commentedon Dec 13, 2014
I just did
and inspected the valgrind log file, but I no longer see any messages related to wrapping. Perhaps someone else can also try this under Python 2.
blink1073 commentedon Dec 13, 2014
I must be missing something because I can't tell what you're using valgrind for here.
stefanv commentedon Dec 13, 2014
Making sure we're not reading from unallocated memory again, producing random results. Otherwise, why would the tests only fail sometimes?
blink1073 commentedon Dec 13, 2014
I ran it on Python 2, but have no idea how to interpret the results.
jni commentedon Dec 14, 2014
@stefanv a short tutorial blog post about valgrind would be great at this point! ;) I have no idea what it does, but it looks very intriguing indeed.
ahojnnes commentedon Dec 23, 2014
Folks, I think the sporadic test failures stopped after merging my random seed PR for the unwrapping functions. Hence, closing this issue.