Skip to content

Fix last trough assignment#99

Open
sejalpunwatkar wants to merge 4 commits into
physiopy:masterfrom
sejalpunwatkar:fix/check-troughs-bug
Open

Fix last trough assignment#99
sejalpunwatkar wants to merge 4 commits into
physiopy:masterfrom
sejalpunwatkar:fix/check-troughs-bug

Conversation

@sejalpunwatkar

@sejalpunwatkar sejalpunwatkar commented Mar 19, 2026

Copy link
Copy Markdown

Partially addresses #88 (closes item 2 regarding utils/check_troughs). Naming convention in item 1 is outstanding.

This PR fixes a small bug in the check_troughs function where the final trough was not being correctly assigned due to a == comparison instead of =. No other functionality has been changed.

Proposed Changes

  • Fixed the assignment bug in all_troughs[-1] line in check_troughs function
  • Ensured the function now correctly handles the final trough assignment
  • No other code changes or logic updates were made

Change Type

  • bugfix (+0.0.1)
  • minor (+0.1.0)
  • major (+1.0.0)
  • refactoring (no version update)
  • test (no version update)
  • infrastructure (no version update)
  • documentation (no version update)
  • other

Checklist before review

  • I added everything I wanted to add to this PR.
  • [Code or tests only] I wrote/updated the necessary docstrings.
  • [Code or tests only] I ran and passed tests locally.
  • [Documentation only] I built the docs locally.
  • My contribution is harmonious with the rest of the code: I'm not introducing repetitions.
  • My code respects the adopted style, especially linting conventions.
  • The title of this PR is explanatory on its own, enough to be understood as part of a changelog.
  • I added or indicated the right labels.
  • I added information regarding the timeline of completion for this PR.
  • Please, comment on my PR while it's a draft and give me feedback on the development!

@sejalpunwatkar

Copy link
Copy Markdown
Author

@smoia I've fixed the assignment bug in check_troughs and the pre-commit checks are green. Just letting you know this is ready for your review whenever you have a spare moment!

@smoia smoia requested a review from kristinazvolanek April 17, 2026 16:01
@smoia smoia moved this to Waiting for review in Software development May 21, 2026
@smoia smoia moved this from Waiting for review to In review in Software development May 21, 2026

@kristinazvolanek kristinazvolanek left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Sejal,

Thank you for working on this! Sorry for the delay on the review. The code update looks great, but since we're making modifications, we can improve the rest of the code too! I have a few requested changes before we merge.

 1. Could you please make the title more specific to the actual change and remove the semicolon? This title will appear in the release changelog. Something like, "Fix last trough assignment" would work.

 2. This PR does not fully close #88, since that issue contains two separate items. Could you update the PR description to reflect that it partially addresses #88? Specifically:

  • It closes item 2 (utils/check_troughs)
  • Item 1 (phys2neurokit conversion naming) is still outstanding

Alternatively, could you open a new issue for phys2neurokit conversion naming? Then we can close #88

  1. Issue #88 also suggests adding edge case handling at the start of check_troughs. Could you add the following (you can check the issue for more info)?

Handle edge cases

if peaks is None or len(peaks) == 0:
return np.array([])
if len(peaks) == 1:
return np.array([])

Thank you! Please let me know if anything is unclear.

@sejalpunwatkar

Copy link
Copy Markdown
Author

Hi @kristinazvolanek ,Thanks for the review!I will update the PR title and description to reflect that this partially addresses #88. I will also add the edge-case handling at the start of check_troughs as requested.I'll push the changes shortly and let you know when it's ready!

@sejalpunwatkar sejalpunwatkar changed the title Fix: Correct assignment bug in check_troughs Fix last trough assignment Jun 20, 2026
@sejalpunwatkar

Copy link
Copy Markdown
Author

Hi @kristinazvolanek,

I have pushed the changes with the edge-case handling added to the start of the check_troughs function. I also updated the PR title and adjusted the description to clarify that this only partially addresses #88.

Everything is ready for your review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

3 participants