Skip to content

Commit f833273

Browse files
committed
Merge branch 'bugfix/refactoring'
2 parents 430dd5e + 31b4cd6 commit f833273

File tree

6 files changed

+9
-5
lines changed

6 files changed

+9
-5
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ __pycache__
99

1010
# Ignore virtual environment.
1111
venv
12+
13+
# Ignore coverage files.
14+
.coverage

rfflearn/cpu/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
ImportWarning)
6969

7070
# Import shap-related modules if `shap` is available.
71-
if (importlib.util.find_spec("matplotlib") is not None) and (importlib.util.find_spec("shap") is not None):
71+
if all(importlib.util.find_spec(name) is not None for name in ["matplotlib", "shap"]):
7272

7373
# Import explainer module.
7474
explainer = importlib.import_module("explainer")

rfflearn/cpu/rfflearn_cpu_common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ def box_muller_method(xs, ys):
8484
return np.array([zs1, zs2])
8585

8686
# Generate sobol sequence engine and throw away the first several values.
87-
sampler = scipy.stats.qmc.Sobol(dim_in, scramble=True, seed=np.random.randint(0, np.iinfo(np.int32).max))
87+
int32_max = np.iinfo(np.int32).max
88+
sampler = scipy.stats.qmc.Sobol(dim_in, scramble=True, seed=np.random.randint(0, int32_max))
8889
sampler.fast_forward(QUASI_MC_SKIP)
8990

9091
# Generate uniform random matrix.

rfflearn/cpu/rfflearn_cpu_regression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44

55
# Declare published functions and variables.
6-
__all__ = ["RFFRegression", "ORFRegression", "QRFRegression"]
6+
__all__ = ["RFFRegressor", "ORFRegressor", "QRFRegressor"]
77

88
# Import 3rd-party packages.
99
import sklearn.linear_model

rfflearn/gpu/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
ImportWarning)
6060

6161
# Import shap-related modules if `shap` is available.
62-
if (importlib.util.find_spec("matplotlib") is not None) and (importlib.util.find_spec("shap") is not None):
62+
if all(importlib.util.find_spec(name) is not None for name in ["matplotlib", "shap"]):
6363

6464
# Import explainer module.
6565
explainer = importlib.import_module("explainer")

rfflearn/rfflearn_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
Common functions/variables of rfflearn.
33
"""
44

5-
__version__ = "2024.10.27"
5+
__version__ = "2024.10.28"
66

77
# vim: expandtab tabstop=4 shiftwidth=4 fdm=marker

0 commit comments

Comments
 (0)