TDAmeritrade / stumpy

STUMPY is a powerful and scalable Python library for modern time series analysis

Home Page:https://stumpy.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve `ignore_trivial` docstring

seanlaw opened this issue · comments

It has come to our attention that the docstring for ignore_trivial may be too vague. We should consider improving the docs for this

Not sure if the following observation helps, but IIRC there was a [similar] discussion before around it and so I thought it might be a good idea to just think about it again....

We can see this block of code in the beginning of the function stump.

stumpy/stumpy/stump.py

Lines 662 to 665 in 58ccc69

if T_B is None:
ignore_trivial = True
T_B = T_A
T_B_subseq_isconstant = T_A_subseq_isconstant

So, if a user does stumpy.stump(T, m, ignore_trivial=False), they do not get a warning because ignore_trivial is forced to be set to True BEFORE the program reaches the following line

ignore_trivial = core.check_ignore_trivial(T_A, T_B, ignore_trivial)

Should we raise a warning in that if-block (before line 663)?

Should we raise a warning in that if-block

We probably should. And mention this in the docstring