jamesturk / jellyfish

🪼 a python library for doing approximate and phonetic matching of strings.
https://jamesturk.github.io/jellyfish/
MIT License
2.04k stars 157 forks source link

Failing jaro_winkler_similarity_longto on python 3.10 and 3.11 (Fedora 36 x86_64) #163

Closed mbaldessari closed 1 year ago

mbaldessari commented 2 years ago

I get the following when running the python only test suite on Fedora with both python 3.10.5 and 3.11.0rc1:

+ cd jellyfish-0.9.1
+ PYTHONPATH=.
+ pytest-3 jellyfish/test.py
============================= test session starts ==============================
platform linux -- Python 3.11.0rc1, pytest-7.1.2, pluggy-1.0.0
rootdir: /builddir/build/BUILD/jellyfish-0.9.1
collected 155 items

jellyfish/test.py .........F............................................ [ 34%]
........................................................................ [ 81%]
.............................                                            [100%]

=================================== FAILURES ===================================
______ test_jaro_winkler_similarity_longtol[python-dixon-dicksonx-0.813] _______

jf = <module 'jellyfish._jellyfish' from '/builddir/build/BUILD/jellyfish-0.9.1/jellyfish/_jellyfish.py'>
s1 = 'dixon', s2 = 'dicksonx', value = 0.813

    @pytest.mark.parametrize("s1,s2,value", _load_data("jaro_winkler_longtol"), ids=str)
    def test_jaro_winkler_similarity_longtol(jf, s1, s2, value):
        value = float(value)
>       assertAlmostEqual(jf.jaro_winkler_similarity(s1, s2, True), value, places=3)

jellyfish/test.py:43:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

a = 0.8303030303030302, b = 0.813, places = 3

    def assertAlmostEqual(a, b, places=3):
>       assert abs(a - b) < (0.1 ** places)
E       assert 0.017303030303030265 < (0.1 ** 3)
E        +  where 0.017303030303030265 = abs((0.8303030303030302 - 0.813))

jellyfish/test.py:10: AssertionError
=========================== short test summary info ============================
FAILED jellyfish/test.py::test_jaro_winkler_similarity_longtol[python-dixon-dicksonx-0.813]
======================== 1 failed, 154 passed in 0.17s =========================
papoteur-mga commented 2 years ago

Same issue here with Mageia cauldron and python 3.10.

ghost commented 1 year ago

I'd look for an issue with those platforms, I've confirmed tests are passing on four other platforms, including on Python 3.11rc2 which I just added to CI. Perhaps there are hints in the compiler output?

jamesturk commented 1 year ago

Going to close this out as tests are all passing on 3.10 and 3.11 for the various builds we support, feel free to reopen if there are reproducible failures that you can submit a test for.