Migrated from SciPy sparse matrix to sparse array #993
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR switched the internal representation of BIOM from
scipy.sparse.*_matrix
to*_array
. This is a major change. It is being made following NumPy and SciPy's migration from (sparse) matrix to (sparse) array (source, source), the Scientific Python community's priority (source), and recommendations from colleagues. It has been discussed with @wasade .The migration guideline was followed.
This PR does not introduce public-facing changes to the API. All current functionality remains functional. However, if one extracts sparse data from a BIOM table (e.g., via
table.matrix_data
ortable.data('S1', 'sample', dense=False)
) and perform subsequent analyses on it, they may notice changes. Therefore, we might consider updating the minor version (e.g., 2.2, instead of 2.1.17).We need to make sure notable downstream packages are not affected by this change. I have confirmed that scikit-bio is not affected. But let me ping @antgonza and @ebolyen too.
There is still an obstacle: Sparse array was introduced to SciPy 1.8.0, which required a minimum of Python 3.10. Therefore, we need to drop Python 3.9 support (EOL: 2025-10) before adopting this change.