Fix ndr.reader.base passing scalar time to samples2times/times2samples#86
Conversation
…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.
|
👋 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 For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
- 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.
Fixes a bug where
ndr.reader.base.samples2timesandndr.reader.base.times2sampleswere passing a scalar start time tondr.time.funfunctions instead of the required time interval vector[t0 t1]. This caused errors or incorrect behavior when converting samples/times involvingInfvalues.Changes:
+ndr/+reader/base.m:samples2times, changedt0t1{1}(1)tot0t1{1}.times2samples, changedt0t1{1}(1)tot0t1{1}.PR created automatically by Jules for task 4038498198657591777 started by @stevevanhooser