On Sat, Oct 12, 2024 at 6:23 PM Marten van Kerkwijk <m...@astro.utoronto.ca>
wrote:

> Hi Dan, others,
>
> Great news that the sparse array implementation is getting there!
> The continued existence of np.matrix has in large part been because of
> sparse matrices, so in some sense the decision depends also on what
> happens to those.
>

+1, this is the critical point. Deprecating `np.matrix` effectively
deprecates SciPy's sparse matrices, which is the wrong way around. We
cannot force SciPy's hand like that, the deprecations in `scipy.sparse`
should come first.

But generally I'm in favour of just deprecating and removing matrix, as
> I don't see any advantages.


Agreed here as well. Once the deprecation of `np.matrix` goes through, just
removing it makes sense to me. There is little value in moving it to an
external package (scipy won't move to that as a dependency, nor would I
expect any other maintained packages to make that move), and it will force
keeping workarounds within NumPy that somehow have to couple to that new
package.

Cheers,
Ralf



> But admittedly I'm biased: I was the one
> that added the PendingDeprecationWarning, and attempted to consolidate
> at least all the tests in matrixlib to make eventual deprecation easier...
>
> Regardless, since there have been 7 years of PendingDeprecationWarning,
> I think changing that to a regular DeprecationWarning should not
> surprise anybody, at least not if they had built a package based on
> np.matrix.
>
> It is maybe good to add that it is less easy to split of matrix into its
> own package than it was for the financial routines: because matrix
> overrides some pretty basic assumptions of arrays (mostly how shapes
> behave), there are bits of special-casing for np.matrix throughout the
> rest of the code, which we would want to remove if np.matrix is no
> longer part of numpy.  I.e., moving it might mean having to define
> ``matrix.__array_function__`` and override those functions. This means a
> new package would need a bit of a champion.
>
> All the best,
>
> Marten
> _______________________________________________
> NumPy-Discussion mailing list -- numpy-discussion@python.org
> To unsubscribe send an email to numpy-discussion-le...@python.org
> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> Member address: ralf.gomm...@gmail.com
>
_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to