-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
API: interpolate.BarycentricInterpolator: transition to Generator (SPEC 7) #21812
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
Conversation
CI failure looks unrelated |
Could you post on the forum? Either for this change or for adopting SPEC7 project-wide |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo two nits and a general question:
So the random_state=
kwarg is going to be removed at some point, across the whole scipy codebase I presume. Is there a timeline already? Would be nice to have it spelled out explicitly somewhere. Backwards compat break procedures and all that. This is of course not blocking for this PR.
P.S. I was today's year old to first see an __init__
with a decorator :-). If it works, it does I suppose.
[docs only]
It is spelled out by the SPEC except the duration of SciPy's deprecation cycle being two releases long. For us, that means:
|
Co-authored-by: Matt Haberland <mhaberla@calpoly.edu>
Interesting. Applying the decorator to the class looks like it almost worked, but the decorator appears not to preserve a |
gh-21833 shows a few other classes with initializers that accept
With that in mind, it might not be worth the time to generalize the decorator to replace the documentation here. If you edit the documentation manually, would putting the decorator back on the |
Sounds reasonable, done |
Failures are unrelated; saw those in gh-21867. |
[skip ci] Co-authored-by: Jake Bowhay <60778417+j-bowhay@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@j-bowhay This looks pretty good, but there are no uses of rng
in the tests - were the tests not seeded before? I guess that hasn't bitten us with random failures, but do you agree it would be good to include it (at least to make sure it's working)?
The permutation is to prevent underflow/overflow during the computation, the seeding shouldn't impact the results as basically any permutation will do but I will add it to a test as I agree it would be good to have for coverage |
Transitions interpolate.barycentric_interpolator according to SPEC007.