Skip to content
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

remove np.random as RandomState #217

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
rng = np.random.RandomState(random_state)
else:
if random_state is None:
rng = np.random
rng = np.random.RandomState()

Check warning on line 130 in src/pyuoi/datasets/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/pyuoi/datasets/__init__.py#L130

Added line #L130 was not covered by tests
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
Loading