[Numpy-discussion] Deprecate matrices in 1.15 and remove in 1.17?

Ralf Gommers ralf.gommers at gmail.com
Thu Nov 30 13:43:38 EST 2017


On Fri, Dec 1, 2017 at 7:17 AM, Matthew Rocklin <mrocklin at gmail.com> wrote:

> How would the community handle the scipy.sparse matrix subclasses?  These
> are still in common use.
>

They're not going anywhere for quite a while (until the sparse ndarrays
materialize at least). Hence np.matrix needs to be moved, not deleted. We
discussed this earlier this year:
https://mail.python.org/pipermail/numpy-discussion/2017-January/076332.html


> Somewhat related: https://github.com/scipy/scipy/issues/8162
>
> On Thu, Nov 30, 2017 at 1:13 PM, <josef.pktd at gmail.com> wrote:
>
>>
>>
>> On Thu, Nov 30, 2017 at 9:23 AM, Marten van Kerkwijk <
>> m.h.vankerkwijk at gmail.com> wrote:
>>
>>> Hi All,
>>>
>>> I wondered if the move to python3-only starting with numpy 1.17 would
>>> be a good reason to act on what we all seem to agree: that the matrix
>>> class was a bad idea, with its overriding of multiplication and lack
>>> of support for stacks of matrices.
>>
>>
I'd suggest any release in the next couple of years is fine,but the one
where we drop Python 2 support is probably the worst choice. That's one of
the few things the core Python devs got 100% right with the Python 3 move:
advocate that in the 2->3 transition packages would not make any API
changes in order to make porting the least painful.

Ralf



>
>> I don't think the matrix class was a bad idea at the time.
>>
>> numpy was the underdog, I came from GAUSS and Matlab and numpy
>> arrays were just weird, especially loosing a dimension all the time
>> and the heavy required use of np.newaxis.
>> I guess nowadays kids don't learn `matrix` languages first anymore.
>>
>> recarrays are another half-hearted feature in numpy that is mostly
>> obsolete with pandas and pandas_like DataFrames in other
>> packages.
>>
>>
>> (I don't mind the changes, but the deprecation cycle is often short,
>> especially for users like me that update numpy only about every 3 main
>> versions.)
>>
>> Josef
>>
>>
>>> For 1.17, minimum python supposedly
>>> is >=3.5, so we will be guaranteed to have the matrix multiply
>>> operator @ available, and hence there is arguably even less of a case
>>> for keeping the matrix class; removing it would allow taking out quite
>>> a bit of accumulated special-casing (the immediate reasons for writing
>>> this were gh-10123 and 10132).
>>>
>>> What do people think? If we do go in this direction, we might want to
>>> add PendingDeprecationWarning for 1.15 (maybe DeprecationWarning for
>>> python3; for python2 matrix would never disappear).
>>>
>> All the best,
>>>
>>> Marten
>>> _______________________________________________
>>> NumPy-Discussion mailing list
>>> NumPy-Discussion at python.org
>>> https://mail.python.org/mailman/listinfo/numpy-discussion
>>>
>>
>>
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion at python.org
>> https://mail.python.org/mailman/listinfo/numpy-discussion
>>
>>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20171201/6fa218ce/attachment.html>


More information about the NumPy-Discussion mailing list