-
Notifications
You must be signed in to change notification settings - Fork 9
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
Division by zero causes a test failure in unifrac #51
Comments
Does this exist with the latest version?
…On Wed, Oct 4, 2023, 13:24 Vladimir Petko ***@***.***> wrote:
=====================================================================
FAIL: test_faith_pd_none_observed
(unifrac.tests.test_api.FaithPDEdgeCasesTests.test_faith_pd_none_observed)
Traceback (most recent call last):
File "/<>/.pybuild/cpython3_3.11_unifrac/build/unifrac/tests/test_api.py",
line 718, in test_faith_pd_none_observed
self.assertAlmostEqual(actual[0], expected)
AssertionError: 6.25 != 0.0 within 7 places (6.25 difference)
This is due void su::set_proportions() dividing props[i] by
sample_count[i] which is 0.
In order to avoid undefined behaviour the value of props[i] can by
adjusted to std::numeric_limits::max()/lowest()
—
Reply to this email directly, view it on GitHub
<#51>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADTZMS7QJKGVFCAJ2UOJNDX5XAWZAVCNFSM6AAAAAA5TF7322VHI2DSMVQWIX3LMV43ASLTON2WKOZRHEZDMOJSGM2TOMY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Yes, it does.
Note: I have patched the test due to biocore/unifrac#156
|
Thats puzzling as the suite is executed by CI. Will look into it, thanks!
…On Wed, Oct 4, 2023, 17:28 Vladimir Petko ***@***.***> wrote:
yes it does
—
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADTZMVSM27KAXQKVIBW55TX5X5JJAVCNFSM6AAAAAA5TF7322VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBXHA2DCNRVG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I think it is due to some dependency - in |
@vpa1977 I need a way to reproduce this. The most likely explanation is that something in your setup is picking up something it should not.
|
Yes, it is a bit flaky, due to the UB, so it might pass in some cases[1]. [1] #52 (comment) |
This is due
void su::set_proportions()
dividing props[i] by sample_count[i] which is 0.In order to avoid undefined behaviour the value of props[i] can by adjusted to std::numeric_limits::max()/lowest()
The text was updated successfully, but these errors were encountered: