On Mon, Oct 14, 2024 at 9:10 AM Nathan <nathan.goldb...@gmail.com> wrote:

> Here's a github code search for the string "np.matrix":
>
> https://github.com/search?q=%22np.matrix%22&type=code
>
> First, if you narrow down to just Python code, there are almost 60
> thousand results, which is quite high, much higher than we we're
> comfortable with for outright removals for NumPy 2.0.
>
> Compared with code searches I did in service of the NumPy 2.0 API changes,
> this returns a lot of repositories in the flavor of "someone's homework
> assignments" rather than "core scientific python package" or "package owned
> by a billion dollar corporation".
>
> So, it's good that "important" packages don't seem to use np.matrix much,
> but also it's bad given that the code that *does* seem to use it is
> probably infrequently or poorly tested, and will require a lengthy
> deprecation period to catch, if the authors are inclined to do anything
> about it at all.
>
> In that case, I think moving things to an external pypi package along with
> a long-lived shim in NumPy that points people to the pypi package is
> probably the least disruptive thing to do, if we're going to do anything.
>
>
Putting the code on PyPI and leaving a shim behind would be the way to go.
If nothing else it will serve to educate users as to the best current usage
of NumPy. And speaking of education, we might want to do something similar
with RandomState. It is amazing how many folks still think of it as the
natural way to get random numbers in NumPy even though the preferred
Generator based rng has been out for seven years. I think a large part of
that problem comes from classrooms, books, and articles that still use
RandomState, and the remainder from people who were unaware of the new
capabilities. I think we could also make that transition in most of the
NumPy testing code.

Chuck
_______________________________________________
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