[R-pkg-team] Bug#1100292: Debian packaged Fastcluster fails its test (Was: r-cran-fastcluster: FTBFS: FAIL: test_vector (tests.fastcluster_test.test_vector))

Daniel Müllner daniel at danifold.net
Sun Apr 13 21:39:31 BST 2025


Hi all,

the error is apparently caused by a change in SciPy 1.15.0 in the 
function scipy.spatial.distance.jaccard. Quoting the documentation at 
https://docs.scipy.org/doc/scipy-1.15.2/reference/generated/scipy.spatial.distance.jaccard.html:

"Changed in version 1.15.0: Non-0/1 numeric input used to produce an ad 
hoc result. Since 1.15.0, numeric input is converted to Boolean before 
computation."

I am going to suggest a fix soon. Please stay tuned.

Best,

Daniel


Am 13.04.25 um 8:11 AM schrieb Andreas Tille:
> Control: tags -1 upstream
> Control: forwarded -1 Daniel Müllner <daniel at danifold.net>
> Thanks
> 
> Hi Daniel,
> 
> as you can see below the Debian packaged version of fastcluster fails
> its autopkgtest.  It would be great if you could comment on this issue.
> There might be chances that this problem is caused by
> 
>    numpy (version 2.2.4)
>    scipy (version 1.15.2)
> 
> Any hint how to fix the test issue would be welcome.
> 
> Kind regards
>     Andreas.
> 
> The complete information about this bug report can be found here
>     https://bugs.debian.org/1100292
> 
> Am Wed, Apr 09, 2025 at 09:24:40AM +0900 schrieb Charles Plessy:
>> Control: tag -1 help
>>
>> Hi all,
>>
>> I had a look at the build failure and could reproduce it locally.  Here is
>> an extract from Santiago's report.
>>
>> The test failure looks relevant and probably should not ignored.
>> Unfortunately, the combination of C++ and Python is very, very far from my
>> expertise.  If somebody else can have a look that would be great.
>>
>> The alternative is to release without the package and its reverse
>> dependencies, unless we know that there is no risk to inflict erroneous
>> computations on our users.
>>
>> Have a nice day,
>>
>> Charles
>>
>> ==================================================================================================================
>> Fastcluster version: 1.2.6
>> Python version: 3.13.2 (main, Feb  5 2025, 01:23:35) [GCC 14.2.0]
>> running config
>>     dh_auto_build -O--buildsystem=pybuild -O--sourcedirectory=src/python
>> I: pybuild base:311: /usr/bin/python3 setup.py build
>> /usr/lib/python3/dist-packages/setuptools/_distutils/dist.py:270:
>> UserWarning: Unknown distribution option: 'test_suite'
>>    warnings.warn(msg)
>> Fastcluster version: 1.2.6
>> Python version: 3.13.2 (main, Feb  5 2025, 01:23:35) [GCC 14.2.0]
>> running build
>> running build_py
>> copying fastcluster.py ->
>> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_fastcluster/build
>> running build_ext
>> building '_fastcluster' extension
>> creating build/temp.linux-x86_64-cpython-313
>> x86_64-linux-gnu-g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=.
>> -fstack-protector-strong -fstack-clash-protection -Wformat
>> -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2
>> -fPIC -I/usr/lib/x86_64-linux-gnu/python3-numpy/numpy/_core/include
>> -I/usr/include/python3.13 -c fastcluster_python.cpp -o
>> build/temp.linux-x86_64-cpython-313/fastcluster_python.o
>> In file included from fastcluster_python.cpp:38:
>> ../fastcluster.cpp:53:35: note: ‘#pragma message: Use fenv header.’
>>     53 | #pragma message("Use fenv header.")
>>        |                                   ^
>> x86_64-linux-gnu-g++ -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=.
>> -fstack-protector-strong -fstack-clash-protection -Wformat
>> -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2
>> -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2
>> -Wl,-z,relro -Wl,-z,now -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=.
>> -fstack-protector-strong -fstack-clash-protection -Wformat
>> -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2
>> build/temp.linux-x86_64-cpython-313/fastcluster_python.o
>> -L/usr/lib/x86_64-linux-gnu -o /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_fastcluster/build/_fastcluster.cpython-313-x86_64-linux-gnu.so
>>     dh_auto_test -O--buildsystem=pybuild -O--sourcedirectory=src/python
>> I: pybuild base:311: cd
>> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_fastcluster/build; python3.13 -m
>> unittest discover -v
>> test (tests.fastcluster_test.test) ... ok
>> test_nan (tests.fastcluster_test.test_nan) ... ok
>> test_vector (tests.fastcluster_test.test_vector) ... FAIL
>>
>> ======================================================================
>> FAIL: test_vector (tests.fastcluster_test.test_vector)
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>>    File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_fastcluster/build/tests/__init__.py",
>> line 14, in test_vector
>>      test(10)
>>      ~~~~^^^^
>>    File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_fastcluster/build/tests/vectortest.py",
>> line 236, in test
>>      test_all(n,dim)
>>      ~~~~~~~~^^^^^^^
>>    File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_fastcluster/build/tests/vectortest.py",
>> line 115, in test_all
>>      check(Z2, method, D)
>>      ~~~~~^^^^^^^^^^^^^^^
>>    File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_fastcluster/build/tests/vectortest.py",
>> line 142, in check
>>      raise AssertionError(
>>          'Not the global minimum in step {2}: {0}, {1}'.
>>          format(Z2[i,2], gmin,i), squareform(D))
>> AssertionError: ('Not the global minimum in step 0: 0.42857142857142855,
>> 0.0', array([[0.        , 0.28571429, 0.14285714, ..., 0.33333333,
>> 0.14285714,
>>          0.14285714],
>>         [0.28571429, 0.        , 0.14285714, ..., 0.57142857, 0.14285714,
>>          0.14285714],
>>         [0.14285714, 0.14285714, 0.        , ..., 0.42857143, 0.        ,
>>          0.        ],
>>         ...,
>>         [0.33333333, 0.57142857, 0.42857143, ..., 0.        , 0.42857143,
>>          0.42857143],
>>         [0.14285714, 0.14285714, 0.        , ..., 0.42857143, 0.        ,
>>          0.        ],
>>         [0.14285714, 0.14285714, 0.        , ..., 0.42857143, 0.        ,
>>          0.        ]], shape=(62, 62)))
>>
>> ----------------------------------------------------------------------
>> Ran 3 tests in 1.095s
>>
>> ==================================================================================================================
>>
>> -- 
>> Charles Plessy - - ~ ~ ~ ~ ~ ~~~~ ~ ~ ~ ~ ~ - - charles.plessy at oist.jp
>> Okinawa  Institute  of  Science  and  Technology  Graduate  University
>> Senior staff scientist ~~ Luscombe Unit ~~ https://groups.oist.jp/grsu
>> Toots from work - ~~ ~~~~ ~~ - https://fediscience.org/@charles_plessy
>>
> 



More information about the R-pkg-team mailing list