Skip to content

Fix ndr.reader.base passing scalar time to samples2times/times2samples#86

Merged
stevevanhooser merged 3 commits intomainfrom
bugfix-ndr-reader-base-samples2times-vector
Nov 22, 2025
Merged

Fix ndr.reader.base passing scalar time to samples2times/times2samples#86
stevevanhooser merged 3 commits intomainfrom
bugfix-ndr-reader-base-samples2times-vector

Conversation

@google-labs-jules
Copy link
Contributor

Fixes a bug where ndr.reader.base.samples2times and ndr.reader.base.times2samples were passing a scalar start time to ndr.time.fun functions instead of the required time interval vector [t0 t1]. This caused errors or incorrect behavior when converting samples/times involving Inf values.

Changes:

  • Modified +ndr/+reader/base.m:
    • In samples2times, changed t0t1{1}(1) to t0t1{1}.
    • In times2samples, changed t0t1{1}(1) to t0t1{1}.

PR created automatically by Jules for task 4038498198657591777 started by @stevevanhooser

…terval

ndr.time.fun.samples2times and times2samples require a 2-element vector [t0 t1] as the second argument to correctly handle cases where the input contains Inf (which maps to t1). The previous implementation in ndr.reader.base was incorrectly passing only the start time (t0) as a scalar.

This commit fixes ndr.reader.base.samples2times and ndr.reader.base.times2samples to pass the full t0t1{1} vector.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 22, 2025

Test Results

38 tests  +2   38 ✅ +2   2s ⏱️ ±0s
 8 suites +1    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 0ccf709. ± Comparison against base commit 8b13a3d.

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Nov 22, 2025

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 24.66%. Comparing base (8b13a3d) to head (2a0a054).

Files with missing lines Patch % Lines
+ndr/+reader/base.m 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #86   +/-   ##
=======================================
  Coverage   24.66%   24.66%           
=======================================
  Files          85       85           
  Lines        4103     4103           
=======================================
  Hits         1012     1012           
  Misses       3091     3091           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

google-labs-jules bot and others added 2 commits November 22, 2025 20:38
- Modify ndr.reader.base.samples2times and times2samples to pass the full t0t1 interval vector (start and end times) instead of just the scalar start time. This is required for ndr.time.fun functions to correctly handle Inf values (end of recording).
- Add new unit test tools/tests/+ndr/+unittest/+reader/TestIntanRhd.m. This test uses the existing example.rhd data to verify:
    1. Correct functionality of samples2times and times2samples with scalar, vector, and Inf inputs.
    2. Basic functionality of readchannels_epochsamples.
    3. Proper initialization of the ndr.reader.intan_rhd reader.
@stevevanhooser stevevanhooser marked this pull request as ready for review November 22, 2025 20:40
@stevevanhooser stevevanhooser merged commit c83f7a4 into main Nov 22, 2025
@stevevanhooser stevevanhooser deleted the bugfix-ndr-reader-base-samples2times-vector branch November 22, 2025 20:40
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