<div dir="ltr"><div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sat, Oct 27, 2018 at 11:10 AM Stefan van der Walt <<a href="mailto:stefanv@berkeley.edu">stefanv@berkeley.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, 27 Oct 2018 10:27:49 +1300, Ralf Gommers wrote:<br>
> Just to make sure we're talking about the same things here: Stefan, I think<br>
> with "sparray" you mean "an n-D sparse array implementation that lives in<br>
> SciPy", nothing more specific? In that case pydata/sparse is the one<br>
> implementation, and including it in scipy.sparse would make it "sparray".<br>
> I'm currently indeed leaning towards depending on pydata/sparse rather than<br>
> including it in scipy.<br>
<br>
I want to double check: when we last spoke, it seemed as though certain<br>
refactorings inside of SciPy (specifically, sparray was mentioned) would<br>
simplify the life of pydata/sparse devs.  That no longer seems to be the<br>
case?<br></blockquote><div><br></div><div>There's no such thing as `sparray` anywhere in SciPy. There's two inactive projects to create an n-D sparse array implementation, one of which is called sparray (<a href="https://github.com/perimosocordiae/sparray">https://github.com/perimosocordiae/sparray</a>). And there's one very active project to do that same thing which is <a href="https://github.com/pydata/sparse">https://github.com/pydata/sparse</a></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
If our recommended route is to tell users to use pydata/sparse instead<br>
of SciPy (for the sparse array object), we probably want to get rid of<br>
our own internal implementation, and deprecate spmatrix </blockquote><div><br></div><div>Doc-deprecate I think; the sparse matrix classes in SciPy are very 
heavily used, so it doesn't make sense to start emitting deprecation 
warnings for them. But at some point we'll want to point users to 
pydata/sparse for new code.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">(or, build<br>
spmatrix on top of pydata/sparse)?<br></blockquote><div><br></div><div>It's the matrix vs. array semantics that are the issue, so not sure that building one on top of the other would be useful.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Once we can define a clear API for sparse arrays, we can include some<br>
algorithms that ingest those objects in SciPy.  But, I'm not sure we<br>
have an API in place that will allow handover of such objects to the<br>
existing C/FORTRAN-level code.<br></blockquote><div><br></div><div>I don't think the constructors for sparse matrix/array care about C/F order. pydata/sparse is pure Python (and uses Numba). For reusing scipy.sparse.linalg and scipy.sparse.csgraph you're right I think that that will need some careful design work. Not sure anyone has thought about that in a lot of detail yet.<br></div><div><br></div><div>There are interesting API questions probably, such as how to treat explicit zeros (that debate still isn't settled for the matrix classes IIRC). And there's an interesting transition puzzle to figure out (which also includes np.matrix). At the moment the discussion on that is spread out over many mailing list threads and Github issues, at some point we'll need to summarize that. Probably around the time that the CSR/CSC replacement that Hameer mentioned is finished.</div><div><br></div><div>Cheers,<br></div><div>Ralf</div><div><br></div><div><br></div><div><br></div></div></div></div></div>