Repository navigation
Fixed #1111 Add branching logic for sdp #1200
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
6
commits into
stumpy-dev:main
Choose a base branch
from
NimaSarajpoor:sdp_branching_logic
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 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b2221b1
add branching logic to sdp func in core
NimaSarajpoor 5450557
add test function to improve coverage
NimaSarajpoor 61bd5b7
Merge branch 'stumpy-dev:main' into sdp_branching_logic
NimaSarajpoor d01573d
Use closure to allow user to set the values of some variables
NimaSarajpoor a3538d1
avoid using hard-coded value
NimaSarajpoor 6a48340
improve docstrings
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
Prev
Previous commit
improve docstrings
- Loading branch information
commit 6a48340f03af4c90fd160e3329ee5e34ac4451fb
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -655,23 +655,41 @@ def make_sliding_dot_product(boundaries=None, default_func=None): | |
|
|
||
| Parameters | ||
| ---------- | ||
| boundaries : nested list | ||
| boundaries : nested list, default None | ||
| A list of items, where each item is a list of 3 elements: | ||
| * index 0: (LB_m, UB_m) | ||
| * index 1: (LB_n, UB_n) | ||
| * index 2: func | ||
| where, fucn is the sdp function for computing | ||
| the sliding dot product of ``Q`` and ``T``, when | ||
| m=len(Q) falls into [LB_m, UB_m], and n=len(T) falls | ||
| into [LB_n, UB_n]. | ||
| m=len(Q) falls into range [LB_m, UB_m], and n=len(T) | ||
| falls into range [LB_n, UB_n]. | ||
| When this is None (default), it will automatically be set to | ||
| the following value: | ||
| [ | ||
| [ | ||
| (3, config.STUMPY_NJIT_SDP_Q_LENGTH), | ||
| (3, np.inf), | ||
| sdp._njit_sliding_dot_product, | ||
| ] | ||
| ] | ||
|
|
||
| default_func : class 'function' | ||
| A callable object for | ||
| default_func : class 'function', default None | ||
| A callable object that is used for computing | ||
| the sliding dot product between a query `Q` and | ||
| time series `T`. This is used when len(Q) and len(T) | ||
| values do not fall into any boundary provided | ||
| in `boundaries`. When None (default), this will | ||
| automatically be set to `sdp._pyfftw_sliding_dot_product` | ||
| if available. If not, it will be automatically set to | ||
| `sdp._sliding_dot_product`. | ||
|
|
||
| Returns | ||
| ------- | ||
| output : numpy.ndarray | ||
| Sliding dot product between `Q` and `T`. | ||
| sliding_dot_product : callable | ||
| A callable object that computes the sliding dot product between ``Q`` | ||
| and ``T`` using different methods based on len(Q) and len(T). It | ||
| internally checks the boundary in `boundaries` and choose a function | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "chooseS" |
||
| """ | ||
| stumpy_default_func = sdp._sliding_dot_product | ||
| if sdp.PYFFTW_IS_AVAILABLE: # pragma: no cover | ||
|
|
@@ -712,7 +730,8 @@ def sliding_dot_product(Q, T): | |
| out : numpy.ndarray | ||
| Sliding dot product between ``Q`` and ``T``. | ||
| """ | ||
| m, n = len(Q), len(T) | ||
| m = len(Q) | ||
| n = len(T) | ||
| if m == n: | ||
| return np.array([np.dot(Q, T)]) | ||
|
|
||
|
|
||
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.
funcnotfucn