Test#53
Conversation
… selected source - Implemented logic to adjust peak indices using either the original signal or centroid method. - Enhanced peak detection accuracy by allowing for dynamic peak repositioning within specified bounds.
feat(peak_finder): add optional re-centering of peak indices based on…
There was a problem hiding this comment.
Pull Request Overview
This PR updates the package version from 1.0.0 to 1.0.1 and adds peak re-centering functionality to the peak analysis module, allowing peaks to be adjusted based on either the original signal or centroid calculation.
- Adds optional peak re-centering logic with support for "original" and "centroid" index sources
- Updates package version to 1.0.1 in both
__init__.pyandpyproject.toml
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/funcnodes_span/peak_analysis.py | Adds peak re-centering functionality using argmax or centroid methods |
| src/funcnodes_span/init.py | Updates version number to 1.0.1 |
| pyproject.toml | Updates version number to 1.0.1 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| f = min(len(_y) - 1, int(f_idx)) | ||
| if f <= i: | ||
| continue | ||
| if index_source == "original" and on is not None: |
There was a problem hiding this comment.
The condition checks on is not None but the variable on is not defined in the visible scope. This will raise a NameError when index_source == "original".
| if index_source == "original" and on is not None: | |
| if index_source == "original": |
| continue | ||
| if index_source == "original" and on is not None: | ||
| # Use argmax on the original (or differently processed) signal within bounds | ||
| local_argmax = int(np.argmax(_y[i : f + 1])) + i |
There was a problem hiding this comment.
Using _y for argmax calculation when the comment mentions 'original signal', but _y appears to be the processed signal. The variable name and logic don't match the intended behavior described in the comment.
| local_argmax = int(np.argmax(_y[i : f + 1])) + i | |
| local_argmax = int(np.argmax(on[i : f + 1])) + i |
No description provided.