Repository navigation
Closed
Description
Seems very related to #1197.
But this just happened on my machine again. I noticed that I had left a "skip if python 3.4" as it as happening then too.
__________________________________________test_wrap_around[3-1] __________________________________________
[gw6] linux -- Python 3.6.5 /home/mark/miniconda3/envs/skpre/bin/python
ndim = 3, axis = 1
@skipif(sys.version_info[:2] == (3, 4),
reason="Doesn't work with python 3.4. See issue #3079")
@testing.parametrize("ndim, axis", dim_axis)
def test_wrap_around(ndim, axis):
> check_wrap_around(ndim, axis)
skimage/restoration/tests/test_unwrap.py:123:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
ndim = 3, axis = 1
def check_wrap_around(ndim, axis):
# create a ramp, but with the last pixel along axis equalling the first
elements = 100
ramp = np.linspace(0, 12 * np.pi, elements)
ramp[-1] = ramp[0]
image = ramp.reshape(tuple([elements if n == axis else 1
for n in range(ndim)]))
image_wrapped = np.angle(np.exp(1j * image))
index_first = tuple([0] * ndim)
index_last = tuple([-1 if n == axis else 0 for n in range(ndim)])
# unwrap the image without wrap around
with warnings.catch_warnings():
# We do not want warnings about length 1 dimensions
warnings.simplefilter("ignore")
image_unwrap_no_wrap_around = unwrap_phase(image_wrapped, seed=0)
print('endpoints without wrap_around:',
image_unwrap_no_wrap_around[index_first],
image_unwrap_no_wrap_around[index_last])
# without wrap around, the endpoints of the image should differ
assert_(abs(image_unwrap_no_wrap_around[index_first] -
image_unwrap_no_wrap_around[index_last]) > np.pi)
# unwrap the image with wrap around
wrap_around = [n == axis for n in range(ndim)]
with warnings.catch_warnings():
# We do not want warnings about length 1 dimensions
warnings.simplefilter("ignore")
image_unwrap_wrap_around = unwrap_phase(image_wrapped, wrap_around,
seed=0)
print('endpoints with wrap_around:',
image_unwrap_wrap_around[index_first],
image_unwrap_wrap_around[index_last])
# with wrap around, the endpoints of the image should be equal
assert_almost_equal(image_unwrap_wrap_around[index_first],
> image_unwrap_wrap_around[index_last])
E AssertionError:
E Arrays are not almost equal to 7 decimals
E ACTUAL: -12.566370614359172
E DESIRED: 25.132741228718345
skimage/restoration/tests/test_unwrap.py:113: AssertionError
------------------------------------------ Captured stdout call ------------------------------------------
endpoints without wrap_around: -18.8495559215 18.8495559215
endpoints with wrap_around: -12.5663706144 25.1327412287Metadata
Metadata
Assignees
Labels
No labels
Activity
cdluminate commentedon Oct 17, 2018
I encountered the same problem with python 3.6 and skimage 0.14.1
hmaarrfk commentedon Oct 17, 2018
Do you have an interpretation of what is going on?
cdluminate commentedon Oct 17, 2018
@hmaarrfk No idea. I re-ran the test and the failure disappeared...
hmaarrfk commentedon Oct 17, 2018
Ah i thought maybe you encountered it in a meaningful data analysis pipeline.
hmaarrfk commentedon Oct 17, 2018
This is some issue with some
piphase wraparound:rfezzani commentedon Oct 18, 2021
This seems fixed after dropping python < 3.6 support.