<?xml version="1.0" encoding="utf-8"?> 
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us">
    <generator uri="https://gohugo.io/" version="0.152.2">Hugo</generator><title type="html"><![CDATA[Sparse on Blog]]></title>
    
    
    
            <link href="https://blog.scientific-python.org/tags/sparse/" rel="alternate" type="text/html" title="html" />
            <link href="https://blog.scientific-python.org/tags/sparse/atom.xml" rel="self" type="application/atom" title="atom" />
    <updated>2026-04-04T04:32:36+00:00</updated>
    
    
    
    
        <id>https://blog.scientific-python.org/tags/sparse/</id>
    
        
        <entry>
            <title type="html"><![CDATA[Developer Summit 1: Sparse Arrays]]></title>
            <link href="https://blog.scientific-python.org/scientific-python/dev-summit-1-sparse/?utm_source=atom_feed" rel="alternate" type="text/html" />
            
                <link href="https://blog.scientific-python.org/scientific-python/2022-czi-grant/?utm_source=atom_feed" rel="related" type="text/html" title="Scientific Python awarded CZI grant to improve communications infrastructure &amp; accessibility" />
                <link href="https://blog.scientific-python.org/scientific-python/alt-text-workshop-summary/?utm_source=atom_feed" rel="related" type="text/html" title="Team up! Alt text and cross-project community" />
                <link href="https://blog.scientific-python.org/scientific-python/gsod-2022-proposal/?utm_source=atom_feed" rel="related" type="text/html" title="Scientific Python GSoD 2022 Proposal" />
            
                <id>https://blog.scientific-python.org/scientific-python/dev-summit-1-sparse/</id>
            
            
            <published>2023-07-09T10:07:40-04:00</published>
            <updated>2023-07-09T10:07:40-04:00</updated>
            
            
            <content type="html"><![CDATA[<blockquote>Sparse Arrays at the May Developer Summit in Seattle</blockquote><p>(May 22-26, 2023, Seattle WA) &ndash;
The first <a href="https://blog.scientific-python.org/scientific-python/dev-summit-1/">Scientific Python Developer Summit</a> provided an opportunity
for core developers from the scientific Python ecosystem to come together to:</p>
<ol>
<li>improve joint infrastructure</li>
<li>better coordinate core projects</li>
<li>work on a shared strategic plan</li>
</ol>
<p>Related notes/sites:</p>
<ul>
<li><a href="https://hackmd.io/iEtdfbxfSbGwOAJTXmqyIQ?view">Worklog</a>.</li>
<li><a href="https://scientific-python.org/summits/developer/2023/">Planning Meeting Notes and Info</a>.</li>
</ul>
<p>One of the focuses of the summit was Sparse Arrays, and specifically their implementation in SciPy.
This post attempts to recap what happened with &ldquo;sparse&rdquo; at the summit
and a glimpse of plans for our continuing work. The Sparse Array working group
holds <a href="https://scientific-python.org/calendars">open follow-up meetings</a>, currently scheduled every two weeks,
to continue the momentum and move this project forward.</p>
<p>At the Summit, we focused on improving the newly added Sparse Array API
in SciPy, that lets users manipulate sparse data with NumPy
semantics (before, SciPy used NumPy&rsquo;s 2D-only Matrix API, but that is <a href="https://stackoverflow.com/questions/53254738/deprecation-status-of-the-numpy-matrix-class">slated for deprecation</a>).
Our goal at the summit was to give focused energy to the effort,
bring new people on board, and connect downstream users with the development
effort. We also worked to create a working group for this project that would
last beyond the summit itself.</p>
<p>The specific PRs and Issues involved in <code>scipy.sparse</code> are detailed in the
<a href="https://hackmd.io/1Q2832LDR_2Uv_-cV-wnYg">Summit 2023 scipy.sparse Report</a>,
with more detailed description appearing in the
<a href="https://hackmd.io/iEtdfbxfSbGwOAJTXmqyIQ?view">Summit Worklog</a>.
Some big picture take-aways are:</p>
<ul>
<li>Reorganized how to check for matrix/array/format info. This involved
adding a <code>format</code> attribute describing which format of sparse storage is used,
changing functions <code>issparse</code>/<code>isspmatrix</code> as well as shifting
the class hierarchy to allow easy <code>isinstance</code> checking.
The interface going forward includes:
<ul>
<li><code>issparse(A)</code>: True when a sparse array or matrix.</li>
<li><code>isinstance(A, sparray)</code>: True when a sparse array.</li>
<li><code>isspmatrix(A)</code>: True when a sparse matrix.
To check the format of a sparse array or matrix use <code>A.format == &quot;csr&quot;</code> or similar.</li>
</ul>
</li>
<li>Made decisions about how to approach the &ldquo;creation functions&rdquo; for sparse arrays.
The big-picture approach is to introduce new functions with an <code>_array</code> suffix which
construct sparse arrays. The old names will continue to create sparse matrix until
post-deprecation removal.
Some specific changes made include:
<ul>
<li>Add the creation function <code>diags_array(A)</code> (and planned for <code>eye_array</code>, <code>random_array</code> and others).</li>
<li>Create a <code>sparse.linalg.matrix_power</code> function for positive integer matrix power of a sparse array</li>
</ul>
</li>
<li>Made progress toward 1D sparse arrays. The data structures for 1d may be quite different from 2d.
A prototype <code>coo_array</code> allowed exploration of possible n-d arrays, though that is not a short-term goal.</li>
<li>Explored feasibility and usefulness of defining <code>__array_ufunc__</code> and other <code>__array_*__</code> protocols for sparse arrays</li>
<li>Made clearer distinction between private and public methods for sparse arrays</li>
<li>Improved documentation for sparse arrays</li>
</ul>
<p>Our goal is to have a working set of sparse array construction functions
and a 1d sparse array class (focusing on <code>coo_array</code> first) in plenty of
time for intensive testing before SciPy v1.12. This will then allow us to
focus on creating migration documents and tools as well as helping downstream
libraries make the shift to sparse arrays. We hope to enable the removal of
deprecated sparse matrix interfaces in favor of the array interface. For this
to happen we will need most downstream users to shift to the sparse array API.
We intend to help them do that.</p>
<p>Our work continues with a community call every <a href="https://scientific-python.org/calendars">two weeks on Fridays.</a>
Near term work is to:</p>
<ul>
<li>Continue improving sparse creation functions: diags, eye, random and others.</li>
<li>Deprecate some matrix-specific functionality</li>
<li>General performance improvements</li>
<li>Adapting scikit-learn to support sparse arrays (to be discussed with scikit-learn&rsquo;s maintainers)</li>
</ul>
]]></content>
            
                 
                    
                 
                    
                         
                        
                            
                             
                                <category scheme="taxonomy:Tags" term="summit" label="Summit" />
                             
                                <category scheme="taxonomy:Tags" term="scientific-python" label="Scientific-Python" />
                             
                                <category scheme="taxonomy:Tags" term="scipy.sparse" label="scipy.sparse" />
                             
                                <category scheme="taxonomy:Tags" term="sparse" label="Sparse" />
                            
                        
                    
                
            
        </entry>
    
</feed>
