diff --git a/dppy/exotic_dpps_core.py b/dppy/exotic_dpps_core.py index ee0f80f..e4fedb5 100644 --- a/dppy/exotic_dpps_core.py +++ b/dppy/exotic_dpps_core.py @@ -118,7 +118,7 @@ def ust_sampler_aldous_broder(list_of_neighbors, root=None, visited[n0] = True nb_nodes_in_tree = 1 - tree_edges = np.zeros((nb_nodes - 1, 2), dtype=np.int) + tree_edges = np.zeros((nb_nodes - 1, 2), dtype=int) while nb_nodes_in_tree < nb_nodes: diff --git a/dppy/random_matrices.py b/dppy/random_matrices.py index 0b7db3f..bdd54d4 100644 --- a/dppy/random_matrices.py +++ b/dppy/random_matrices.py @@ -334,7 +334,7 @@ def mu_ref_unif_unit_circle_sampler_quindiag(beta=2, size=10, raise ValueError('`beta` must be positive integer.\ Given: {}'.format(beta)) - alpha = np.zeros(size, dtype=np.complex_) + alpha = np.zeros(size, dtype=np.complex128) # nu = 1 + beta*(N-1, N-2, ..., 0) for i, nu in enumerate(1 + beta * np.arange(size - 1, -1, step=-1)): @@ -343,7 +343,7 @@ def mu_ref_unif_unit_circle_sampler_quindiag(beta=2, size=10, rho = np.sqrt(1 - np.abs(alpha[:-1])**2) - xi = np.zeros((size - 1, 2, 2), dtype=np.complex_) # xi[0,..,N-1] + xi = np.zeros((size - 1, 2, 2), dtype=np.complex128) # xi[0,..,N-1] xi[:, 0, 0], xi[:, 0, 1] = alpha[:-1].conj(), rho xi[:, 1, 0], xi[:, 1, 1] = rho, -alpha[:-1] @@ -352,14 +352,14 @@ def mu_ref_unif_unit_circle_sampler_quindiag(beta=2, size=10, # xi[N-1] = alpha[N-1].conj() if size % 2 == 0: # even L = sp.block_diag(xi[::2, :, :], - dtype=np.complex_) + dtype=np.complex128) M = sp.block_diag([1.0, *xi[1::2, :, :], alpha[-1].conj()], - dtype=np.complex_) + dtype=np.complex128) else: # odd L = sp.block_diag([*xi[::2, :, :], alpha[-1].conj()], - dtype=np.complex_) + dtype=np.complex128) M = sp.block_diag([1.0, *xi[1::2, :, :]], - dtype=np.complex_) + dtype=np.complex128) return la.eigvals(L.dot(M).toarray()) diff --git a/tests/test_beta_ensembles_samplers.py b/tests/test_beta_ensembles_samplers.py index 3a222c6..0fdb2f5 100644 --- a/tests/test_beta_ensembles_samplers.py +++ b/tests/test_beta_ensembles_samplers.py @@ -42,7 +42,7 @@ def limiting_distribution_adequation(samples, f_th = [quad(limiting_distribution, a, b)[0] for a, b in zip(bins[:-1], bins[1:])] - _, pval = chisquare(f_obs=f_emp, f_exp=f_th) + _, pval = chisquare(f_obs=f_emp, f_exp=f_th, sum_check=False) msg = 'pval = {}'.format(pval) diff --git a/tests/test_finite_dpps_samplers.py b/tests/test_finite_dpps_samplers.py index cbd6f90..4b3d1b9 100644 --- a/tests/test_finite_dpps_samplers.py +++ b/tests/test_finite_dpps_samplers.py @@ -90,7 +90,9 @@ def doubleton_adequation(dpp, samples, tol=0.05): for doubl in doubletons] marginal_emp = np.array(counts) / len(samples) - _, pval = chisquare(f_obs=marginal_emp, f_exp=marginal_th) + _, pval = chisquare(f_obs=marginal_emp, + f_exp=marginal_th, + sum_check=False) msg = 'pval = {}, emp = {}, th = {}'.format(pval, marginal_emp,