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

nix develop is failing an ANI distance test?! #3106

Closed
ctb opened this issue Apr 6, 2024 · 1 comment · Fixed by #3126
Closed

nix develop is failing an ANI distance test?! #3106

ctb opened this issue Apr 6, 2024 · 1 comment · Fixed by #3126

Comments

@ctb
Copy link
Contributor

ctb commented Apr 6, 2024

Over in #3105, a PR which doesn't change anything about nix:

% nix develop --command bash -c "tox -e py310"

yields:

 =================================== FAILURES ===================================
___________________ test_containment_to_distance_confidence ____________________
[gw2] darwin -- Python 3.10.13 /Users/runner/work/sourmash/sourmash/.tox/py310/bin/python

    def test_containment_to_distance_confidence():
        contain = 0.1
        scaled = 100
        nkmers = 10000
        ksize = 31
        confidence = 0.99
        res = containment_to_distance(
            contain,
            ksize,
            scaled,
            confidence=confidence,
            n_unique_kmers=nkmers,
            estimate_ci=True,
        )
        print(res)
        # check results
        assert res.dist == 0.07158545548052564
        assert res.dist_low == 0.04802880300938562
        assert res.dist_high == 0.09619930040790341
        assert res.p_exceeds_threshold == False
        confidence = 0.90
        res2 = containment_to_distance(
            contain,
            ksize,
            scaled,
            n_unique_kmers=nkmers,
            confidence=confidence,
            estimate_ci=True,
        )
        print(res2)
        # check results
        assert res2.dist == res.dist
>       assert res2.dist_low == 0.05599435479247415
E       assert 0.05599435479247409 == 0.05599435479247415
E        +  where 0.05599435479247409 = ciANIResult(dist=0.07158545548052564, p_nothing_in_common=4.3171247410658655e-05, p_threshold=0.001, size_is_inaccurate=False, p_exceeds_threshold=False, dist_low=0.05599435479247409, dist_high=0.08758718871990222).dist_low

tests/test_distance_utils.py:255: AssertionError
@ctb
Copy link
Contributor Author

ctb commented Apr 24, 2024

specifically,

E       assert 0.05599435479247409 == 0.05599435479247415

which I will fix with a round.

@ctb ctb closed this as completed in #3126 Apr 24, 2024
ctb added a commit that referenced this issue Apr 24, 2024
…istance_utils.py` (#3126)

Fixes #3106

I'll merge if the relevant test passes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant