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

<RuntimeWarning: invalid value encountered in sqrt> #54

Closed
Huii opened this issue Jul 30, 2020 · 1 comment
Closed

<RuntimeWarning: invalid value encountered in sqrt> #54

Huii opened this issue Jul 30, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Huii
Copy link

Huii commented Jul 30, 2020

Thank you very much for this create library, first of all!

The following code in the "distance" function in features.py:

    diff_sig = np.diff(signal)
    return np.sum([np.sqrt(1 + diff_sig ** 2)])

should be changed to:

    diff_sig = np.diff(signal)
    diff_sigFloat = diff_sig.astype(float)
    return np.sum([np.sqrt(1 + diff_sigFloat ** 2)])

The reason for that is that otherwise an integer overflow might occur for larger numbers, which results in negative numbers, which, in turn, results in an "invalid value" error.

@lmfernandes96
Copy link
Contributor

Hi Hui!

Thank you for your interest in TSFEL.

We have followed your suggestion and fixed the bug in the Pull Request #55.
Thank you for contributing to the library, if you find more problems feel free to contact us!

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

No branches or pull requests

3 participants