refactor: migrate to new NumPy RNG API#1148
Open
mmustafasenoglu wants to merge 1 commit into
Open
Conversation
Closes stumpy-dev#1112 Updates stumpy core files to use the new NumPy random number generator API (np.random.default_rng()) instead of the legacy API. Changes: - floss.py: np.random.seed() + np.random.randint() → default_rng().integers() - scraamp.py: np.random.permutation() → default_rng().permutation() - scrump.py: np.random.permutation() → default_rng().permutation() - core.py: Updated docstring examples to use new API Note: This PR only updates the core stumpy files. Test files and docstrings will be updated in a follow-up PR.
|
Review these changes at https://app.gitnotebooks.com/stumpy-dev/stumpy/pull/1148 |
seanlaw
reviewed
Jul 8, 2026
seanlaw
left a comment
Contributor
There was a problem hiding this comment.
@mmustafasenoglu Thank you for your interest. This issue #1112 is currently being worked on in PR #1147. As you'll be able to see, it will require much more effort and consideration than simply replacing the old RNG with the new one.
Contributor
|
Also, in the future, it would be great if you can keep the original PR checklist template and, following the instructions, run the unit tests locally before submitting the PR (as there are numerous failed tests). Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1112
Updates stumpy core files to use the new NumPy random number generator API (
np.random.default_rng()) instead of the legacy API.Changes
floss.py:np.random.seed()+np.random.randint()→default_rng().integers()scraamp.py:np.random.permutation()→default_rng().permutation()scrump.py:np.random.permutation()→default_rng().permutation()core.py: Updated docstring examples to use new APINote
This PR only updates the core stumpy files. Test files and docstrings will be updated in a follow-up PR as recommended by the issue description.
References