TomasLenc / acf_tools

Utilities for working with autocorrelation to capture periodicity in a signal.
GNU General Public License v3.0
2 stars 0 forks source link

fix fit_aperiodic silent fail when input type "single" #8

Closed TomasLenc closed 1 year ago

TomasLenc commented 1 year ago

The fit_aperiodic() function silently failed because of a stupid try/catch statement that didn't catch all errors.

For example, when the input was single precision float, the function didn't crash loudly but simply didn't assign the output parameter - super cryptic to debug.

I've fixed the try/catch statement so all errors are treated.

Also added explicit check for input format being "double", with informative error message to the user.