esda icon indicating copy to clipboard operation
esda copied to clipboard

Silhouette tests failing under scipy 1.13

Open martinfleis opened this issue 1 year ago • 1 comments

The scipy 1.13 release caused failures of silhouette tests.

___________________ Silhouette_Tester.test_silhouette_alist ____________________
[gw2] linux -- Python 3.9.19 /home/runner/micromamba/envs/test/bin/python3.9

self = <esda.tests.test_silhouette.Silhouette_Tester testMethod=test_silhouette_alist>

    def test_silhouette_alist(self):
        known = numpy.array(
            [
                0.0,
                0.0,
                0.22434244,
                0.0,
                0.0,
                0.0,
                -0.07589293,
                -0.07589293,
                0.0,
                0.41331324,
                0.41331324,
                0.0,
                0.0,
                0.11703681,
                0.0,
                0.11703681,
                0.27065991,
                0.27065991,
                0.27065991,
                0.27065991,
                0.0,
                0.27065991,
                0.0,
                0.0,
                -0.07441639,
                -0.07441639,
                0.0,
                0.0,
                0.0,
                0.0,
                0.41576712,
                0.41576712,
                -0.06657343,
                0.0,
                0.0,
                -0.06657343,
                0.0,
                0.0,
                0.0,
                0.0,
            ]
        )
    
        test = silhouettes.silhouette_alist(
            self.X, self.groups, self.w.to_adjlist(drop_islands=True)
        )
>       numpy.testing.assert_allclose(known, test.silhouette, rtol=RTOL, atol=ATOL)

esda/tests/test_silhouette.py:193: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

args = (<function assert_allclose.<locals>.compare at 0x7fb40e736ee0>, array([ 0.        ,  0.        ,  0.22434244,  0.     ...76712, -0.06657343,  0.        ,  0.        ,
       -0.06657343,  0.        ,  0.        ,  0.        ,  0.        ]))
kwds = {'equal_nan': True, 'err_msg': '', 'header': 'Not equal to tolerance rtol=1e-05, atol=1e-07', 'verbose': True}

    @wraps(func)
    def inner(*args, **kwds):
        with self._recreate_cm():
>           return func(*args, **kwds)
E           AssertionError: 
E           Not equal to tolerance rtol=1e-05, atol=1e-07
E           
E           Mismatched elements: 6 / 40 (15%)
E           Max absolute difference: 0.27065991
E           Max relative difference: 1.
E            x: array([ 0.      ,  0.      ,  0.224342,  0.      ,  0.      ,  0.      ,
E                  -0.075893, -0.075893,  0.      ,  0.413313,  0.413313,  0.      ,
E                   0.      ,  0.117037,  0.      ,  0.117037,  0.27066 ,  0.27066 ,...
E            y: array([ 0.      ,  0.      ,  0.224342,  0.      , -0.075893,  0.      ,
E                  -0.075893,  0.      ,  0.      ,  0.413313,  0.413313,  0.      ,
E                   0.      ,  0.      ,  0.117037,  0.117037,  0.27066 ,  0.27066 ,...

../../../micromamba/envs/test/lib/python3.9/contextlib.py:79: AssertionError

cc @ljwolf

martinfleis avatar Apr 12 '24 07:04 martinfleis

on it. will report back.

ljwolf avatar Apr 12 '24 10:04 ljwolf

@martinfleis Has this resolved itself somehow?

jGaboardi avatar Jul 20 '24 18:07 jGaboardi

No clue but it is not failing any longer, so closing.

martinfleis avatar Jul 20 '24 19:07 martinfleis