-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[MNT]: Replace numpy.random in tests by default_rng #23224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
#19706 changed user-facing examples. The fear there is that users are sitting on older versions of matplotlib and numpy and get an error when they copy the example code. Here the scope is limited to tests. We require numpy 1.17+ for the current codebase and that also applies to tests. People working on matplotlib cannot fall into the numpy-too-old trap. |
I am 50/50 if the tests pass with the new generator (seems like a bunch of work and code changes for a low pay-off if numpy is not going to deprecate the old API) and ππ» if this change requires any tests to be changed (because changing tests is a bad idea on principle). |
I'm fine with closing. But then we should add a note as a follow up to #23221 that existing tests should be kept with the old API. |
I honestly neutral on this. Despite my concerns, Jody is right that this is an easy first issue and people are at least as likely to find another test and copy-paste-edit rather than read the docs and write one from scratch so it will be easier on everyone if our tests all follow the documentation. We should at least find out if it breaks stuff before before closing. |
I tried this with one test and it fails because generated data is not the same. A lot of tests in that module that use random data are also using |
Isn't that because you didn't change the |
π€¦ββοΈ now updated, but the test still fails. |
Yes, it appears that |
My 2 cents: If this cannot be simply replaced, it's not worth the effort. |
I think the consensus here is that, because the new generator does not give the same numbers, we should not go forward with the replacement.
So I am going to close. Obviously re-open if you disagree. |
It should be noted that numpy specifically chose *not* to deprecate the old
method because it would disrupt many unit tests across many projects that
simply needed a consistent sequence of pseudo-random numbers.
β¦On Sun, Mar 31, 2024 at 10:24β―AM Ruth Comer ***@***.***> wrote:
I think the consensus here is that, because the new generator does not
give the same numbers, we should not go forward with the replacement.
@tacaswell <https://github.com/tacaswell> ππ» if this change requires
any tests to be changed
@timhoffm <https://github.com/timhoffm> If this cannot be simply
replaced, it's not worth the effort.
So I am going to close. Obviously re-open if you disagree.
β
Reply to this email directly, view it on GitHub
<#23224 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACHF6AMXYXN6YSM52WJCRLY3AMAHAVCNFSM5YHVZHRKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBSHA3TMOBXHAYA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Uh oh!
There was an error while loading. Please reload this page.
as documented in #23221.
To be checked: Is this the same algorithm as before? If not tests would fail and we should not replace the existing calls.
The text was updated successfully, but these errors were encountered: