Skip to content

Params sanitation: the periodicities have to be set so, that there at least order of them

When a user creates a Fremen model, there is no check, that the number of candidate periodicities is at least the order of the model, which on training leads to:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jan/miniconda3/envs/test/lib/python3.8/site-packages/chronolib/fremen.py", line 85, in fit
    selected = np.argpartition(-alphas, self.order)[:self.order]
  File "<__array_function__ internals>", line 180, in argpartition
  File "/home/jan/miniconda3/envs/test/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 845, in argpartition
    return _wrapfunc(a, 'argpartition', kth, axis=axis, kind=kind, order=order)
  File "/home/jan/miniconda3/envs/test/lib/python3.8/site-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc
    return bound(*args, **kwds)
ValueError: kth(=5) out of bounds (2)