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
[MAINT] Use rng fixture for setting up np.random.RandomState() - part 2 #4054
Conversation
if sys.version_info < (3, 7): # fall back to random state for 3.6 | ||
np.random.RandomState(42) | ||
beta = np.random.rand(nx * ny * nz, X.shape[1]) | ||
tseries_rand = scale(np.random.rand(nx * ny * nz, nt), axis=1) | ||
else: | ||
randome_state = np.random.default_rng(0) | ||
beta = randome_state.random((nx * ny * nz, X.shape[1])) | ||
tseries_rand = scale(randome_state.random((nx * ny * nz, nt)), axis=1) | ||
rng = _rng() | ||
beta = rng.random((nx * ny * nz, X.shape[1])) | ||
tseries_rand = scale(rng.random((nx * ny * nz, nt)), axis=1) |
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.
Regarding this, we should actually upgrade the fixture to use np.random.default_rng
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.
indeed
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.
Could not spot anything wrong
👋 @ymzayek Thanks for creating a PR! Until this PR is ready for review, you can include the [WIP] tag in its title, or leave it as a github draft. Please make sure it is compliant with our contributing guidelines. In particular, be sure it checks the boxes listed below.
For new features:
For bug fixes:
We will review it as quick as possible, feel free to ping us with questions if needed. |
Codecov Report
@@ Coverage Diff @@
## main #4054 +/- ##
==========================================
+ Coverage 91.48% 91.60% +0.11%
==========================================
Files 143 143
Lines 16076 16072 -4
Branches 3340 3339 -1
==========================================
+ Hits 14707 14722 +15
+ Misses 823 804 -19
Partials 546 546
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 6 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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, thx.
merging thenn |
Changes proposed in this pull request:
np.random.RandomState()
- part 1 #4052