-
Notifications
You must be signed in to change notification settings - Fork 332
Fixed #1006 RuntimeWarning divide by zero encountered in divide
#1012
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
Open
NimaSarajpoor
wants to merge
9
commits into
TDAmeritrade:main
Choose a base branch
from
NimaSarajpoor:fix-divide-by-zero-warning
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
47884e6
Add test to catch warning divide-by-zero raised by process_diagonal
NimaSarajpoor 1977825
Add code to resolve warning
NimaSarajpoor 096b332
set std of non-finite subseq to np.nan to avoid divide by 0 warning
NimaSarajpoor f154e2e
add test for divide-by-zero warning
NimaSarajpoor f1e250a
add test to capture divide-by-zero warning in ostinato
NimaSarajpoor 09b7fa8
Fix the divide-by-zero warning caused by passing processed data to stump
NimaSarajpoor 4084415
add test for ostinatoed to capture divide by zero warning and fix code
NimaSarajpoor c5cc377
Rename test functions for sake of consistency
NimaSarajpoor 5e056d3
minor change to fix the computed joint matrix profile
NimaSarajpoor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since
Q
andTs[i]
are UNPROCESSED,QT[idx]
can get meaningless value for a non-finite subsequence that starts atidx
. Better to just replace them withnp.nan
. So, for example, we can do something like this after computingQT
(QT = core.sliding_dot_product(Q, Ts[i])
):Note that
QT[idx]
will be ignored though eventually once it comes to computing its corresponding value in the distance profile viacore.calculate_distance_profile
(see a few lines below). In other words, we do not need the "post-processing of QT" but I think it makes code clearer.Any concerns?
[Update]
Note: Since we pass inputs with non-finite values to
core.calculate_distance_profile
(Not onlyQT
but alsoM_T
), maybe I should better stop here and try to address #1011 first. Then come back and resume the work on this PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the need to replace the ugly
Ts[Ts_idx][subseq_idx : subseq_idx + m]
withQ
. That's fine butdoesn't seem to require any post-processing when either
Q
orT
containnp.nan
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad! You are right. No need for post-processing
QT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@seanlaw
I did an experiment and shared the result in #1011. We can either work on that and then come back here. Or, on the second thought, we can still merge this (after I resolve the merge conflicts), and then work on #1011.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we have a merge conflict here anyways, let's fix #1011 first and then come back here and strikethrough the comment:
so that we are focused on this issue/PR instead of being distracted by jumping back and forth. I am getting confused by having so many things open and so it feels disorganized