Skip to content

Implement samples2times and times2samples for axon_abf#85

Merged
stevevanhooser merged 9 commits intomainfrom
axon_abf_gaps
Nov 21, 2025
Merged

Implement samples2times and times2samples for axon_abf#85
stevevanhooser merged 9 commits intomainfrom
axon_abf_gaps

Conversation

@google-labs-jules
Copy link
Contributor

This change implements custom samples2times and times2samples methods for the ndr.reader.axon_abf class. These methods call readchannels_epochsamples with channel='time' to obtain the full time vector, accounting for potential gaps (sweeps) in the recording, and use interpolation to map between samples and times. A test script tools/tests/test_axon_gaps.m has been added for verification.


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

@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.

end;
end; % daqchannels2internalchannels

function t = samples2times(axon_abf_obj, channeltype, channel, epochstreams, epoch_select, s)

Check warning

Code scanning / Code Analyzer

Input argument might be unused. Consider replacing the argument with ~ instead. Warning

Input argument might be unused. Consider replacing the argument with ~ instead.
end;
end; % daqchannels2internalchannels

function t = samples2times(axon_abf_obj, channeltype, channel, epochstreams, epoch_select, s)

Check warning

Code scanning / Code Analyzer

Input argument might be unused. Consider replacing the argument with ~ instead. Warning

Input argument might be unused. Consider replacing the argument with ~ instead.
t = interp1(s_all, t_all, s, 'linear', 'extrap');
end % samples2times

function s = times2samples(axon_abf_obj, channeltype, channel, epochstreams, epoch_select, t)

Check warning

Code scanning / Code Analyzer

Input argument might be unused. Consider replacing the argument with ~ instead. Warning

Input argument might be unused. Consider replacing the argument with ~ instead.
t = interp1(s_all, t_all, s, 'linear', 'extrap');
end % samples2times

function s = times2samples(axon_abf_obj, channeltype, channel, epochstreams, epoch_select, t)

Check warning

Code scanning / Code Analyzer

Input argument might be unused. Consider replacing the argument with ~ instead. Warning

Input argument might be unused. Consider replacing the argument with ~ instead.
@github-actions
Copy link
Contributor

github-actions bot commented Nov 21, 2025

Test Results

36 tests  +2   36 ✅ +2   2s ⏱️ ±0s
 7 suites +1    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 3a9c3a4. ± Comparison against base commit 3f616e3.

This pull request removes 1 and adds 3 tests. Note that renamed tests count towards both.
test_intan_incomplete_file ‑ test_intan_incomplete_file
ndr.unittest.format.intan.TestIntanIncompleteFile ‑ testReadIncompleteFile
ndr.unittest.reader.TestAxonAbf ‑ testSamples2Times
ndr.unittest.reader.TestAxonAbf ‑ testTimes2Samples

♻️ This comment has been updated with latest results.

% in abfread, the reader reads up to s1 -1 instead of s1
data = ndr.format.axon.read_abf(filename,header,channeltype{1},channel,T(1),T(2));

if numel(channel) == 1

Check notice

Code scanning / Code Analyzer

To improve performance, use 'isscalar' instead of length comparison. Note

To improve performance, use 'isscalar' instead of length comparison.
@stevevanhooser stevevanhooser marked this pull request as ready for review November 21, 2025 17:28
@stevevanhooser stevevanhooser merged commit 8b13a3d into main Nov 21, 2025
@stevevanhooser stevevanhooser deleted the axon_abf_gaps branch November 21, 2025 17:28
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