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

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

Closed
qumaciel opened this issue Jul 3, 2024 · 1 comment
Closed

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

qumaciel opened this issue Jul 3, 2024 · 1 comment

Comments

@qumaciel
Copy link

qumaciel commented Jul 3, 2024

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

@qumaciel qumaciel changed the title np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. np.float was a deprecated alias for the builtin float. Jul 3, 2024
@guilgautier
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants