Skip to content

Commit

Permalink
Merge pull request #217 from JesseLivezey/randomstate-update
Browse files Browse the repository at this point in the history
remove np.random as RandomState
  • Loading branch information
JesseLivezey authored Oct 18, 2023
2 parents 64a3eab + f534235 commit dc03389
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def finalize_options(self):
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
package_dir={'': 'src'},
packages=find_packages() +
packages=find_packages() +
find_packages(where="src"),
package_data={'pyuoi': ['data/*.h5']},

Expand Down
2 changes: 1 addition & 1 deletion src/pyuoi/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def make_classification(n_samples=100, n_features=20, n_informative=2,
rng = np.random.RandomState(random_state)
else:
if random_state is None:
rng = np.random
rng = np.random.RandomState()
else:
rng = random_state
n_not_informative = n_features - n_informative
Expand Down
2 changes: 1 addition & 1 deletion src/pyuoi/decomposition/NMF.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def __initialize(self, **kwargs):

# initialize random state
if random_state is None:
self._rand = np.random
self._rand = np.random.RandomState()
else:
if isinstance(random_state, int):
self._rand = np.random.RandomState(random_state)
Expand Down
2 changes: 1 addition & 1 deletion src/pyuoi/linear_model/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def __init__(self, n_boots_sel=24, n_boots_est=24, selection_frac=0.9,
self.random_state = np.random.RandomState(random_state)
else:
if random_state is None:
self.random_state = np.random
self.random_state = np.random.RandomState()
else:
self.random_state = random_state

Expand Down

0 comments on commit dc03389

Please sign in to comment.