From abe261e8a6f2eaab27f3afe3335127ffb0eaddec Mon Sep 17 00:00:00 2001 From: paul fisher Date: Wed, 15 Nov 2023 18:01:37 -0500 Subject: [PATCH] tiny doc cleanups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit might as well polish these while I’m here --- python-spec/src/somacore/query/_fast_csr.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python-spec/src/somacore/query/_fast_csr.py b/python-spec/src/somacore/query/_fast_csr.py index 9d273ee7..1049b979 100644 --- a/python-spec/src/somacore/query/_fast_csr.py +++ b/python-spec/src/somacore/query/_fast_csr.py @@ -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 ` + for details. """ matrix = sparse.csr_matrix.__new__(sparse.csr_matrix) matrix.data = self.data @@ -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