Skip to content

Commit

Permalink
ENH: Use NumPy's Generator class as a replacement for RandomState
Browse files Browse the repository at this point in the history
Use NumPy's `Generator` class as a replacement for `RandomState` for
random variarte generation methods.

Documentation:
https://numpy.org/doc/stable/reference/random/generated/numpy.random.seed.html
  • Loading branch information
jhlegarreta committed Mar 24, 2024
1 parent 3b1e8d0 commit 3d8081d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/eddymotion/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def fit(
align_kwargs = align_kwargs or {}

if seed or seed == 0:
np.random.seed(20210324 if seed is True else seed)
np.random.default_rng(20210324 if seed is True else seed)

if "num_threads" not in align_kwargs and omp_nthreads is not None:
align_kwargs["num_threads"] = omp_nthreads
Expand Down

0 comments on commit 3d8081d

Please sign in to comment.