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

sample_entropy not matching data types #27

Open
fstinner opened this issue May 24, 2023 · 2 comments
Open

sample_entropy not matching data types #27

fstinner opened this issue May 24, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@fstinner
Copy link

I always get error messages with the function "sample_entropy" that the types at _numba_sampen are not the correct ones:
"No matching definition for argument type(s) readonly array(float64, 1d, C), int64, float64".

I was able to fix the error by hard specifying the data types:
Old:
if metric == "chebyshev" and x.size < 5000: return _numba_sampen(x, order=order, r=0.2 * x.std(ddof=0))

New:
if metric == "chebyshev" and x.size < 5000: return _numba_sampen(x.astype(np.float64), order=np.int32(order), r=np.float64(0.2 * x.std(ddof=0)))

@raphaelvallat raphaelvallat self-assigned this May 26, 2023
@raphaelvallat raphaelvallat added the bug Something isn't working label May 26, 2023
@raphaelvallat
Copy link
Owner

Hi @fstinner,

  1. Can you share an example code that would produce the error?
  2. That's surprising because we already enforce that x is a float64. But better safe than sorry, please feel free to submit the above modifications as a PR!

@sderooij
Copy link

sderooij commented Sep 5, 2023

I had the same issue @fstinner's solution solved it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants