MAINT: sparse: eye() instead of identity() #363

Closed
wants to merge 3 commits into
from

Projects

None yet

2 participants

Owner
pv commented Nov 23, 2012

sparse.identity() and sparse.eye() are almost the same thing. Confusingly, you cannot call eye() with a single parameter to get a square matrix.

This PR makes eye() accept a single parameter, and implements identity() via it. Also, makes it return dia_matrix by default (http://projects.scipy.org/scipy/ticket/1767).

I'm not 100% sure about the deprecation. I suppose identity() is used by absolutely everyone --- if this causes warnings to pop up, it'll be a nuisance.

Member
jakevdp commented Nov 23, 2012

Looks good. I am -1 on deprecation warnings for identity. With the slightly incompatible behavior of eye in the most recent released version, this could lead to surprise issues for those writing packages compatible with multiple scipy versions. The identity function is a light enough alias that we should keep it around, at least for another couple release cycles.

Owner
pv commented Nov 24, 2012

Merged without deprecation.

@pv pv closed this Nov 24, 2012
@pv pv added a commit that referenced this pull request Nov 24, 2012
@pv pv ENH: io: support mmapping in wavfile.read (pull request gh-363, Trac #…
…1455)

Thanks to bemasc for the patch.
975cb7f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment