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

Make consistent behavior when denom is 0 and add docstrings #206

Draft
wants to merge 2 commits into
base: lnk-metric
Choose a base branch
from

Conversation

cmalinmayor
Copy link
Collaborator

@DragaDoncila I was going to just add docstrings and type annotations, and then I noticed that the behavior was inconsistent between the different metrics for what happens when the denomintor is 0.

In this PR I change them all to warn and return np.nan, whereas previously the TRA raised a RuntimeError, the LNK warned and returned np.nan, and the DET did not check. I don't think I have strong opinions about which of these options is better, other than that checking for a zero denominator is good, so this is just a suggestion of one possible solution.

I didn't fix the tests, since I wanted your opinion on what the "correct" solution is first. Feel free to just pull the bits of code you want and treat this as a review rather than a PR - I just already wrote the code so I figured I would provide it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant