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

Updates to timepoint thresh #62

Merged
merged 5 commits into from
Mar 21, 2024
Merged

Updates to timepoint thresh #62

merged 5 commits into from
Mar 21, 2024

Conversation

iguinn
Copy link
Collaborator

@iguinn iguinn commented Mar 21, 2024

  • Added multi_time_point_thresh. This functions similarly to interpolated_time_point_thresh, but is designed for finding multiple timepoints simultaneously. Due to vectorization, the old functions were actually capable of this, but this function differs in two ways:
    1. Instead of feeding it a search direction, you give it a polarity (positive for upward going and negative for downward going) and it figures out the search direction for you. This approach was taken so that you can give it a list of timepoints, start at t_50, and then have it search forward and then backward to identify the timepoints. To get a similar behavior, you would have had to individually choose the search direction for each timepoint
    2. Optimized for finding multiple timepoints. For example, assume we are starting at tp50 and looking for a set of tpN. Using the old functions vectorized, they would start at tp50 for each timepoint individually. With this one, we start at tp50, and then search upward to find the first tpN, and then search from there to find the next, and so on; this avoids researching samples that we have already looked at.
  • Fixed bug in timepoint threshold that made it stop one sample early when searching to the right
  • Added some more intuitive interpolation options. Before they were set to give the the timepoint you would find if you used the intperloating upsampler. This resulted in strange cases like "nearest-neighbor" returning half-way between samples, and "floor" returning the sample after the threshold crossing; there's a logic to it, but it's confusing. Now there are some more intuitive options:
    • 'b' and 'a' for before and after, to get the sample before and after the crossing
    • 'r' for round, to get the closest sample to the crossing

@iguinn
Copy link
Collaborator Author

iguinn commented Mar 21, 2024

I will note that due to this issue #61 I did not add a test for the new function. This is somewhat of an urgent change because I intend to use it for the ANN

Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 8.75000% with 73 lines in your changes are missing coverage. Please review.

Project coverage is 61.38%. Comparing base (a8d6012) to head (676e0de).
Report is 4 commits behind head on main.

❗ Current head 676e0de differs from pull request most recent head 758c7c9. Consider uploading reports for the commit 758c7c9 to get more accurate results

Files Patch % Lines
src/dspeed/processors/time_point_thresh.py 7.59% 73 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #62      +/-   ##
==========================================
- Coverage   62.79%   61.38%   -1.42%     
==========================================
  Files          46       46              
  Lines        2997     3071      +74     
==========================================
+ Hits         1882     1885       +3     
- Misses       1115     1186      +71     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@iguinn iguinn merged commit ada9ff1 into legend-exp:main Mar 21, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant