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

Improve ignore_trivial docstring #930

Open
seanlaw opened this issue Oct 24, 2023 · 2 comments
Open

Improve ignore_trivial docstring #930

seanlaw opened this issue Oct 24, 2023 · 2 comments

Comments

@seanlaw
Copy link
Contributor

seanlaw commented Oct 24, 2023

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

@NimaSarajpoor
Copy link
Collaborator

NimaSarajpoor commented Oct 25, 2023

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)?

@seanlaw
Copy link
Contributor Author

seanlaw commented Oct 25, 2023

Should we raise a warning in that if-block

We probably should. And mention this in the docstring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants