-
Notifications
You must be signed in to change notification settings - Fork 8
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
Avoid division by zero #52
Conversation
Pretty sure we are never supposed to have (sample_counts[0] == 0) in there! But I need some time to think it through. |
Here is the h5 dump of the data used in the unit test:
It has 1 sample
|
Can you check what happens when you run the code through the command line faithpd?
Additionally, can you check that the generated tree actually makes sense?
|
Anyway, you are right that we should not be dividing by zero, but we are... Still, we have to figure out how to properly deal with this situation. @wasade Any insight on what the proper semantics should be? |
The correct faith's pd result in this case is zero. Any issue with |
Updated as per comment. |
While this fixes one instance of division by zero, it does not fix the root cause. FYI, looking into ways to address the root issue of the broken assumption. |
Opened PR #53 as an alternative implementation. |
This addresses #51
While it is not addressing the root cause (sample_counts[0] == 0), it allows to avoid undefined behaviour and allows the test to pass.