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

1 test fails #372

Open
yurivict opened this issue Apr 7, 2024 · 5 comments
Open

1 test fails #372

yurivict opened this issue Apr 7, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@yurivict
Copy link

yurivict commented Apr 7, 2024

========================================================================================= FAILURES ==========================================================================================
_________________________________________________________________________________ test_large_prefix_weight __________________________________________________________________________________

    def test_large_prefix_weight():
>       assert pytest.approx(JaroWinkler.similarity('milyarder', 'milyarderlik',prefix_weight=0.5)) == 1.0

tests/distance/test_JaroWinkler.py:13: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/common.py:364: in similarity
    _, sim, _, _ = self._validate(s1, s2, catch_exceptions=catch_exceptions, **kwargs)
tests/common.py:333: in _validate
    dist = call_and_maybe_catch(self._distance, s1, s2, catch_exceptions=catch_exceptions, **kwargs)
tests/common.py:41: in call_and_maybe_catch
    return call(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <tests.common.GenericScorer object at 0x1affcd798880>, s1 = 'milyarder', s2 = 'milyarderlik', catch_exceptions = False, kwargs = {'prefix_weight': 0.5}, symmetric = True
scores = [-0.08333333333333348, 0.0]

    def _distance(self, s1, s2, catch_exceptions=False, **kwargs):
        symmetric = self.get_scorer_flags(s1, s2, **kwargs)["symmetric"]
        tester = symmetric_scorer_tester if symmetric else scorer_tester
    
        scores = [
            call_and_maybe_catch(tester, scorer.distance, s1, s2, catch_exceptions=catch_exceptions, **kwargs)
            for scorer in self.scorers
        ]
    
        if any(isinstance(score, Exception) for score in scores):
            for score in scores:
                assert compare_exceptions(score, scores[0])
            raise scores[0]
    
        scores = sorted(scores)
>       assert pytest.approx(scores[0]) == scores[-1]
E       AssertionError

tests/common.py:265: AssertionError
========================================================================= 1 failed, 385 passed in 222.58s (0:03:42) =========================================================================
*** Error code 1

Version: 3.8.0
Python: 3.9
FreeBSD 14.0

@maxbachmann
Copy link
Member

I forgot to update the required version of rapidfuzz-cpp in the Cmake file which is used when building against the system version of the library. So I assume you are still building against the old version of rapidfuzz-cpp which had a bug.

@maxbachmann
Copy link
Member

maxbachmann commented Apr 7, 2024

Apparently the test for the system installation was broken and would just fallback to the non system version 😅

With cf788b9 it should be properly tested again

@maxbachmann maxbachmann added the bug Something isn't working label Apr 7, 2024
@maxbachmann
Copy link
Member

I did publish a new version of the library which properly requires the latest version of rapidfuzz-cpp. Please let me know if the problem continues to occur when building rapidfuzz v3.8.1 with rapidfuzz-cpp v3.0.4

@maxbachmann
Copy link
Member

maxbachmann commented Apr 7, 2024

Btw I had a quick look at https://github.com/freebsd/freebsd-ports/blob/main/devel/py-rapidfuzz/Makefile.

  1. ${PYTHON_PKGNAMEPREFIX}rapidfuzz-capi==1.0.5:devel/py-rapidfuzz-capi@${PY_FLAVOR} \ is no longer required
  2. jarowinkler-cpp>0:textproc/jarowinkler-cpp \ is no longer required
  3. https://github.com/maxbachmann/RapidFuzz this is redirected by github, but could be updated to https://github.com/rapidfuzz/RapidFuzz (the same is true for https://github.com/maxbachmann/rapidfuzz-cpp)
  4. I am surprised compiler:c++14-lang python is working, since the library requires C++17. I assume since rapidfuzz-cpp and taskflow require C++17 this is automatically bumped up 🤔

@maxbachmann
Copy link
Member

@yurivict was this resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants