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

Error handling #989

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Error handling #989

wants to merge 4 commits into from

Conversation

wasade
Copy link
Member

@wasade wasade commented Dec 3, 2024

Fixes #982 by allowing a user to specify hasnan as a raisable state, e.g.:

with errstate(hasnan='raise'):
    table = Table(...)

The default behavior is to ignore as that was the prior implicit behavior.

Support for hasinf was also added. This PR includes also includes some normalization of strings in err.py and an expanded set of tests to assert raise behaviors.

cc @AmandaBirmingham

Copy link

@AmandaBirmingham AmandaBirmingham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I was unaware of the with errstate functionality; is there documentation for it somewhere? I couldn't find it in this repo or on biom-format.org.

@wasade
Copy link
Member Author

wasade commented Dec 12, 2024

It's documented here. I'm unsure at the moment why it doesn't appear on the website. To be honest, I think much of the documentation system may have been setup by @gregcaporaso 12-13 years ago, and it could certainly use a refresh. The approach @qiyunzhu has taken with scikit-bio is quite pleasing. @AmandaBirmingham, do you by chance have interest in examining whether some small changes in the documentation system may be viable?

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.

Throw error if trying to create a biom table containing NaNs
2 participants