Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_rank_filter can fail #4361

Closed
hmaarrfk opened this issue Dec 14, 2019 · 1 comment
Closed

test_rank_filter can fail #4361

hmaarrfk opened this issue Dec 14, 2019 · 1 comment

Comments

@hmaarrfk
Copy link
Member

Description

============== FAILURES ===================================

________________ TestRank.test_rank_filter[windowed_histogram] _________________

self = <skimage.filters.rank.tests.test_rank.TestRank object at 0x10c856580>

filter = 'windowed_histogram'

    @parametrize('filter', all_rank_filters)

    def test_rank_filter(self, filter):

        @test_parallel(warnings_matching=['Possible precision loss'])

        def check():

            expected = self.refs[filter]

            result = getattr(rank, filter)(self.image, self.selem)

            if filter == "entropy":

                # There may be some arch dependent rounding errors

                # See the discussions in

                # https://github.com/scikit-image/scikit-image/issues/3091

                # https://github.com/scikit-image/scikit-image/issues/2528

                assert_allclose(expected, result, atol=0, rtol=1E-15)

            elif filter == "otsu":

                # OTSU May also have some optimization dependent failures

                # See the discussions in

                # https://github.com/scikit-image/scikit-image/issues/3091

                # Pixel 3, 5 was found to be problematic. It can take either

                # a value of 41 or 81 depending on the specific optimizations

                # used.

                assert result[3, 5] in [41, 81]

                result[3, 5] = 81

                # Pixel [19, 18] is also found to be problematic for the same

                # reason.

                assert result[19, 18] in [141, 172]

                result[19, 18] = 172

                assert_array_equal(expected, result)

            else:

                assert_array_equal(expected, result)

    

>       check()

../../venv/lib/python3.8/site-packages/skimage/filters/rank/tests/test_rank.py:86: 

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

../../venv/lib/python3.8/site-packages/skimage/_shared/testing.py:246: in inner

    result = func(*args, **kwargs)

../../venv/lib/python3.8/site-packages/skimage/filters/rank/tests/test_rank.py:61: in check

    expected = self.refs[filter]

../../venv/lib/python3.8/site-packages/numpy/lib/npyio.py:260: in __getitem__

    return format.read_array(bytes,

../../venv/lib/python3.8/site-packages/numpy/lib/format.py:710: in read_array

    version = read_magic(fp)

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

fp = <zipfile.ZipExtFile name='windowed_histogram.npy' mode='r'>

    def read_magic(fp):

        """ Read the magic string to get the version of the file format.

    

        Parameters

        ----------

        fp : filelike object

    

        Returns

        -------

        major : int

        minor : int

        """

        magic_str = _read_bytes(fp, MAGIC_LEN, "magic string")

        if magic_str[:-2] != MAGIC_PREFIX:

            msg = "the magic string is not correct; expected %r, got %r"

>           raise ValueError(msg % (MAGIC_PREFIX, magic_str[:-2]))

E           ValueError: the magic string is not correct; expected b'\x93NUMPY', got b'\x00\x00\x00\x00\x00\x00'

https://travis-ci.org/scikit-image/scikit-image/jobs/624812341?utm_medium=notification&utm_source=github_status

Way to reproduce

# Place the full code we need to recreate your issue here
# upload all necessary images to github too!

Version information

# Paste the output of the following python commands
from __future__ import print_function
import sys; print(sys.version)
import platform; print(platform.platform())
import skimage; print("scikit-image version: {}".format(skimage.__version__))
import numpy; print("numpy version: {}".format(numpy.__version__))
# your output here
@grlee77
Copy link
Contributor

grlee77 commented May 6, 2021

Closed by #5175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants