Skip to content

Commit

Permalink
tiny doc cleanups
Browse files Browse the repository at this point in the history
might as well polish these while I’m here
  • Loading branch information
thetorpedodog authored Nov 15, 2023
1 parent 41b8ab4 commit abe261e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python-spec/src/somacore/query/_fast_csr.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ def to_scipy(self) -> sparse.csr_matrix:
sparse.csr_matrix((data, indices, indptr), shape=shape)
This ugliness is to bypass the O(N) scan that
:meth:`scipy.sparse._cs_matrix.__init__`
:meth:`sparse._cs_matrix.__init__`
does when a new compressed matrix is created.
See https://github.com/scipy/scipy/issues/11496 for details on the bug.
See `SciPy bug 11496 <https://github.com/scipy/scipy/issues/11496>`
for details.
"""
matrix = sparse.csr_matrix.__new__(sparse.csr_matrix)
matrix.data = self.data
Expand Down Expand Up @@ -114,6 +115,7 @@ def append(
) -> None:
"""
At accumulation time, do several things:
* re-index to positional indices, and if possible, cast to smaller dtype
to minimize memory footprint (at cost of some amount of time)
* accumulate column counts by row, i.e., build the basis of the indptr
Expand Down

0 comments on commit abe261e

Please sign in to comment.