Skip to content

Commit 0d34dd6

Browse files
Fix numpy.float deprecation, close #75 close #76 (#77)
* Fix the np.float depreciation issue * bump package version -> 0.3.3 --------- Co-authored-by: Jiatao Li <[email protected]>
1 parent cb4577f commit 0d34dd6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

dppy/exact_sampling.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,7 @@ def k_dpp_eig_vecs_selector(eig_vals, eig_vecs, size,
12821282
N, k = eig_vecs.shape[0], size
12831283

12841284
# as in np.linalg.matrix_rank
1285-
tol = np.max(eig_vals) * N * np.finfo(np.float).eps
1285+
tol = np.max(eig_vals) * N * np.finfo(float).eps
12861286
rank = np.count_nonzero(eig_vals > tol)
12871287
if k > rank:
12881288
raise ValueError('size k={} > rank={}'.format(k, rank))

dppy/intermediate_sampling.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def temp_func_with_root_in_desired_expected_size(x):
268268

269269
alpha_star, opt_result = brentq(
270270
temp_func_with_root_in_desired_expected_size,
271-
a=10.0 * np.finfo(np.float).eps,
271+
a=10.0 * np.finfo(float).eps,
272272
b=1.0,
273273
full_output=True)
274274

@@ -619,7 +619,7 @@ def temp_func_with_root_in_desired_expected_size(x):
619619
return np.sum(1.0 - 1.0 / (x * eigvals_L_hat + 1.0)) - desired_expected_size
620620

621621
alpha_hat, opt_result = brentq(temp_func_with_root_in_desired_expected_size,
622-
a=10.0 * np.finfo(np.float).eps,
622+
a=10.0 * np.finfo(float).eps,
623623
b=4.0,
624624
full_output=True)
625625

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# Versions should comply with PEP440. For a discussion on single-sourcing
2525
# the version across setup.py and the project code, see
2626
# https://packaging.python.org/en/latest/single_source_version.html
27-
version='0.3.2',
27+
version='0.3.3',
2828

2929
description='DPPy is a Python library for exact and approximate sampling of Determinantal Point Processes.',
3030
long_description=long_description,

0 commit comments

Comments
 (0)