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

Throw error if trying to create a biom table containing NaNs #982

Open
AmandaBirmingham opened this issue Oct 4, 2024 · 0 comments · May be fixed by #989
Open

Throw error if trying to create a biom table containing NaNs #982

AmandaBirmingham opened this issue Oct 4, 2024 · 0 comments · May be fixed by #989

Comments

@AmandaBirmingham
Copy link

Currently, the code allows a user to create a biom table that contains NaNs. However, trying to use such a table frequently leads to obscure errors: the equality test doesn't work (because NaN != NaN), transform doesn't work for sparse representations (because 0/NaN is set to 0, not NaN, because transform doesn't touch zero entries in sparse matrix), and sometimes even doing an explicit NaN-aware compare (where you check whether the same positions contain NaN in two tables) fails (for a non-NaN-related reason :) because matrix.data's order is different depending on whether it was instantiated as sparse or not. (@wasade indicates that the usual way to handle NaNs in a biom table is to set them to zero, which makes these issues go away.)

Since NaNs can't be truly supported in the current code, as a user, I would like it a lot if I just got an error up front if I tried to make a biom table that contained a NaN, rather than hitting an inscrutable issue downstream.

wasade added a commit to wasade/biom-format that referenced this issue Dec 3, 2024
wasade added a commit to wasade/biom-format that referenced this issue Dec 3, 2024
wasade added a commit to wasade/biom-format that referenced this issue Dec 3, 2024
@wasade wasade linked a pull request Dec 3, 2024 that will close this issue
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 a pull request may close this issue.

1 participant