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

[0.21.0] test_ellipse_parameter_stability sometimes fails #7061

Open
olebole opened this issue Jul 10, 2023 · 2 comments
Open

[0.21.0] test_ellipse_parameter_stability sometimes fails #7061

olebole opened this issue Jul 10, 2023 · 2 comments
Labels

Comments

@olebole
Copy link
Contributor

olebole commented Jul 10, 2023

Description:

When building the Debian package of version 0.21.0, I observed that under certain conditions, I see the test_ellipse_parameter_stability fails, similarly to #6995:

_______________________ test_ellipse_parameter_stability _______________________

    def test_ellipse_parameter_stability():
        """The fit should be modified so that a > b
        """
    
        for angle in np.arange(0, 180 + 1, 1):
            # generate rotation matrix
            theta = np.deg2rad(angle)
            c = np.cos(theta)
            s = np.sin(theta)
            R = np.array([
                [c, -s],
                [s, c]]
            )
    
            # generate points on ellipse
            t = np.linspace(0, 2 * np.pi, 20)
            a = 100
            b = 50
            points = np.array([a * np.cos(t), b * np.sin(t)])
            points = R @ points
    
            # fit model to points
            ellipse_model = EllipseModel()
            ellipse_model.estimate(points.T)
            _, _, a_prime, b_prime, theta_prime = ellipse_model.params
    
>           assert_almost_equal(theta_prime, theta)

skimage/measure/tests/test_fit.py:247: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (2.356194490192345, 0.7853981633974483), kwds = {}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Arrays are not almost equal to 7 decimals
E            ACTUAL: 2.356194490192345
E            DESIRED: 0.7853981633974483

This happens on several platforms, including amd64, arm64, arm32, i386, s390x i.e. both 32 and 64 bit, big and little endian.

However, on some machines the test succeeds, and I could not find out what the difference is. Two example build logs for arm64:

On Debian experimental, most builds failed, while on Debian sid many builds seem to succeed (not all are finished yet).

It is hard to see what difference could cause this; from the package list one difference is that the failing arm64 had the atlas library installed, while the succeeding one had openblas+lapack. If you can point me to a specific package, I can check the version difference.

Way to reproduce:

No response

Version information:

* Python 3.11.4
* Debian Linux, Kernel 6.3.0, several platforms
* skimage 0.21.0
* numpy 1.24.2
Copy link

Hello scikit-image core devs! There hasn't been any activity on this issue for more than 180 days. I have marked it as "dormant" to make it easy to find.
To our contributors, thank you for your contribution and apologies if this issue fell through the cracks! Hopefully this ping will help bring some fresh attention to the issue. If you need help, you can always reach out on our forum
If you think that this issue is no longer relevant, you may close it, or we may do it at some point (either way, it will be done manually).

@lagru
Copy link
Member

lagru commented Mar 16, 2024

Thanks for the report @olebole and sorry for the later response. To be honest this test seems to be problematic / unstable to me judging from other similar issues. I hope that we can maybe address the test or code in question and make it more stable. See #7348.

@lagru lagru removed the 😴 Dormant no recent activity label Mar 16, 2024
github-actions bot pushed a commit to guix-ru/guix that referenced this issue May 26, 2024
As it's flaky, see scikit-image/scikit-image#7061

* gnu/packages/python-science.scm (python-scikit-image)[arguments]: Add
 #:test-flags.

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

No branches or pull requests

3 participants