Closed ejorgensen-wl closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 97.42%. Comparing base (
3077d0d
) to head (9e0b2ce
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@ejorgensen-wl Thanks again for identifying this bug. The decision to do:
was decided a long time ago and, in hindsight, that was a poor choice. Instead, I think we could've/should've been more specific and done:
if max_matches is None: # pragma: no cover
max_matches = P.shape[-1]
P.shape[-1]
is an integer that would be the same as the maximum number of subsequences in T
(i.e., the standard T - m + 1
number of subsequences) that are possible and is a more explicit number than np.inf
, which isn't even an integer (it's a floating point value!).
What do you think about this remedy instead? Would this work?
@ejorgensen-wl Thanks again for identifying this bug. The decision to do:
was decided a long time ago and, in hindsight, that was a poor choice. Instead, I think we could've/should've been more specific and done:
if max_matches is None: # pragma: no cover max_matches = P.shape[-1]
P.shape[-1]
is an integer that would be the same as the maximum number of subsequences inT
(i.e., the standardT - m + 1
number of subsequences) that are possible and is a more explicit number thannp.inf
, which isn't even an integer (it's a floating point value!).What do you think about this remedy instead? Would this work?
That's an excellent and much cleaner solution than what I was thinking, thanks! I implemented your suggestions in my latest commit.
That's an excellent and much cleaner solution than what I was thinking, thanks! I implemented your suggestions in my latest commit.
@ejorgensen-wl Thank you for your patience and for working through this with us! We really appreciate the PR. Once the tests all pass, I'll merge the PR (unless you had anything further to add?).
I like it as is - thanks!
@ejorgensen-wl Thank you again for the excellent PR! I hope you will consider contributing more!
This fix addresses issue #1014 by not slicing the
query_matches
ifmax_matches
is set toNone
formotifs
(which in turn calls_motifs
withmax_matches=np.inf
.I made an initial effort to add testing, but I'm sure there are better ways to do so.
Pull Request Checklist
black
(i.e.,python -m pip install black
orconda install -c conda-forge black
)flake8
(i.e.,python -m pip install flake8
orconda install -c conda-forge flake8
)pytest-cov
(i.e.,python -m pip install pytest-cov
orconda install -c conda-forge pytest-cov
)black .
in the root stumpy directoryflake8 .
in the root stumpy directory./setup.sh && ./test.sh
in the root stumpy directory