From f534235eae8bfddad0af78996db090268c5f9145 Mon Sep 17 00:00:00 2001 From: Jesse Livezey Date: Wed, 18 Oct 2023 16:48:30 -0400 Subject: [PATCH] remove np.random as RandomState --- setup.py | 2 +- src/pyuoi/datasets/__init__.py | 2 +- src/pyuoi/decomposition/NMF.py | 2 +- src/pyuoi/linear_model/base.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index aa65745..747fb25 100644 --- a/setup.py +++ b/setup.py @@ -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']}, diff --git a/src/pyuoi/datasets/__init__.py b/src/pyuoi/datasets/__init__.py index 9d3ec6b..d13394e 100644 --- a/src/pyuoi/datasets/__init__.py +++ b/src/pyuoi/datasets/__init__.py @@ -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 diff --git a/src/pyuoi/decomposition/NMF.py b/src/pyuoi/decomposition/NMF.py index 3b49e33..52e105a 100644 --- a/src/pyuoi/decomposition/NMF.py +++ b/src/pyuoi/decomposition/NMF.py @@ -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) diff --git a/src/pyuoi/linear_model/base.py b/src/pyuoi/linear_model/base.py index 20dd316..ca93d16 100644 --- a/src/pyuoi/linear_model/base.py +++ b/src/pyuoi/linear_model/base.py @@ -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