Error with 'sine' branch of scikit-guess; some tests don't run or fail - version 0.0.2a0
I’ve downloaded the zip archive for scikit-guess version 0.0.2a0 (the sine branch)...
I cannot run sin_fit without generating an error; all data I’ve tried generates the same error.
Specifically.. (The x,y arrays are from the French paper translation.)
Python 3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import skg import numpy as np xdata = np.array([-1.983, -1.948, -1.837, -1.827, -1.663, -0.815, -0.778, -0.754, -0.518, 0.322, 0.418, 0.781, 0.931, 1.510, 1.607], dtype = np.float64) ydata = np.array([0.936, 0.810, 0.716, 0.906, 0.247, -1.513, -1.901, -1.565, -1.896, 0.051, 0.021, 1.069, 0.862, 0.183, 0.311], dtype = np.float64) a0, omega0, phi0, b0 = skg.sin_fit(xdata,ydata) Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/scikit_guess-0.0.2a0-py3.8.egg/skg/sin.py", line 106, in sin_fit File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/scikit_guess-0.0.2a0-py3.8.egg/skg/cluster1d.py", line 93, in cluster1d File "<__array_function__ internals>", line 5, in argpartition File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 820, in argpartition return _wrapfunc(a, 'argpartition', kth, axis=axis, kind=kind, order=order) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 61, in _wrapfunc return bound(*args, **kwds) ValueError: kth(=-1) out of bounds (1)
Python 3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import skg skg.test() ======================================================================================================= test session starts ======================================================================================================= platform darwin -- Python 3.8.0, pytest-5.2.1, py-1.8.0, pluggy-0.13.0 rootdir: /Users/msever/Documents/finance plugins: dash-2.1.0, remotedata-0.3.2 collected 0 items
====================================================================================================== no tests ran in 0.02s ====================================================================================================== ERROR: file or package not found: skg.tests (missing init.py?)
<ExitCode.USAGE_ERROR: 4>
(Also, if I run tests from the scikit-guess-sine folder using „python3.8 setup.py test“, I get 965 passed, 345 warnings, 80 error in 5.03s).
I just want to add, at line 93 (error) in cluster1d.py
If I run: m = argpartition(ds, -sensitivity), then variable m evaluates to []
So, evaluating that line in cluster1d.py will throw that error... m = argpartition(ds, -sensitivity)[-sensitivity:].min()