Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

ENH: Use NumPy's Generator class as a replacement for RandomState #141

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

jhlegarreta
Copy link
Collaborator

@jhlegarreta jhlegarreta commented Mar 24, 2024

Use NumPy's Generator class as a replacement for RandomState for random variarte generation methods.

RandomState was deprecated in NumPy 1.17.0.

Take advantage of the commit to document better the use of the seed parameter.

Documentation:
https://numpy.org/doc/stable/reference/random/new-or-different.html#what-s-new-or-different
https://numpy.org/doc/stable/reference/random/generated/numpy.random.seed.html

@jhlegarreta jhlegarreta force-pushed the UseNumpyRandomGenerator branch from 3d8081d to 464c288 Compare March 24, 2024 16:16
@jhlegarreta jhlegarreta force-pushed the UseNumpyRandomGenerator branch 2 times, most recently from d77d289 to eae871f Compare March 24, 2024 17:47
Copy link
Member

@oesteban oesteban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nitpick following @arokem's suggestion

Use NumPy's `Generator` class as a replacement for `RandomState` for
random variarte generation methods.

`RandomState` was deprecated in NumPy 1.17.0.

Take advantage of the commit to document better the use of the `seed`
parameter.

Documentation:
https://numpy.org/doc/stable/reference/random/new-or-different.html#what-s-new-or-different
https://numpy.org/doc/stable/reference/random/generated/numpy.random.seed.html
@jhlegarreta jhlegarreta force-pushed the UseNumpyRandomGenerator branch from eae871f to b0e53e4 Compare March 28, 2024 13:48
@oesteban oesteban merged commit afc5270 into nipreps:main Mar 28, 2024
7 checks passed
@jhlegarreta jhlegarreta deleted the UseNumpyRandomGenerator branch March 28, 2024 14:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants