guilgautier / DPPy

Python toolbox for sampling Determinantal Point Processes
https://dppy.readthedocs.io
MIT License
219 stars 52 forks source link

`np.float` was a deprecated alias for the builtin `float`. #75

Closed qumaciel closed 2 weeks ago

qumaciel commented 1 month ago

Describe the bug np.float was a deprecated alias for the builtin float. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

To Reproduce Steps to reproduce the behavior:

import numpy as np
from dppy.finite_dpps import FiniteDPP

rng = np.random.RandomState(1)

r, N = 5, 10
# Random feature vectors
Phi = rng.randn(r, N)
DPP = FiniteDPP('likelihood', **{'L': Phi.T.dot(Phi)})

k = 4
for _ in range(10):
    DPP.sample_exact_k_dpp(size=k, random_state=rng)

print(DPP.list_of_samples)

Expected behavior DPP.sample_exact_k_dpp(size=k, random_state=rng) to work.

Screenshots There is a call to np.float in dppy/exact_sampling.py and two calls in dppy/intermediate_sampling.py

image

guilgautier commented 1 month ago

Thanks @qumaciel for raising the issue and @leejamesss for the PR! Please note that a v1-dev branch had been initialized ; the proposed suggestion will also be incorporated.