Skip to content

Add time_channel field to getchannelsepoch return structure#91

Merged
stevevanhooser merged 6 commits intomainfrom
time-channel-fix-9252553676688051570
Dec 13, 2025
Merged

Add time_channel field to getchannelsepoch return structure#91
stevevanhooser merged 6 commits intomainfrom
time-channel-fix-9252553676688051570

Conversation

@google-labs-jules
Copy link
Contributor

Updated ndr.reader.base and subclasses to include time_channel in getchannelsepoch return value. This ensures that all channels reference a valid time channel (defaulted to index 1, where a time channel t1 is added).


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

…e_channel

Modified `ndr.reader.base` and several subclasses (`ced_smr`, `intan_rhd`, `neo`, `spikegadgets_rec`) to ensure that `getchannelsepoch` returns a channel structure that includes the `time_channel` field.
Specifically:
- Updated `ndr.reader.base.getchannelsepoch` to include `time_channel` in the empty struct.
- Updated `ndr.reader.ced_smr.getchannelsepoch`, `ndr.reader.intan_rhd.getchannelsepoch`, `ndr.reader.neo.getchannelsepoch`, and `ndr.reader.spikegadgets_rec.getchannelsepoch` to:
    1. Include `time_channel` in the struct.
    2. Explicitly add a time channel `t1` at index 1.
    3. Set `time_channel` to 1 for all channels.
@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 Dec 12, 2025

Test Results

44 tests  ±0   44 ✅ ±0   2s ⏱️ ±0s
 9 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 9d247b2. ± Comparison against base commit f0594f1.

♻️ This comment has been updated with latest results.

github-actions bot and others added 2 commits December 12, 2025 22:48
…e_channel with specific logic

Modified `ndr.reader.base` and several subclasses to ensure that `getchannelsepoch` returns a channel structure that includes the `time_channel` field.
Specifically:
- Updated `ndr.reader.base.getchannelsepoch` to include `time_channel` in the empty struct.
- Updated `ndr.reader.ced_smr.getchannelsepoch` to set `time_channel` to the channel ID found in the header.
- Updated `ndr.reader.intan_rhd.getchannelsepoch` to add two time channels (`t1`, `t2`) and map `auxiliary_in` channels to `t2` (time channel 2) and others to `t1` (time channel 1).
- Updated `ndr.reader.neo.getchannelsepoch` and `ndr.reader.spikegadgets_rec.getchannelsepoch` to add a time channel `t1` and set `time_channel` to 1.
- Ensured struct field consistency in `spikegadgets_rec` concatenation.
intan_rhd_obj,...
channel_type_entry,...
channel(p));
if strcmpi(newchannel.type,'auxiliary_in'),

Check notice

Code scanning / Code Analyzer

Extra comma is unnecessary. Note

Extra comma is unnecessary.
channel(p));
if strcmpi(newchannel.type,'auxiliary_in'),
newchannel.time_channel = 2;
else,

Check notice

Code scanning / Code Analyzer

Extra comma is unnecessary. Note

Extra comma is unnecessary.
newchannel.time_channel = 2;
else,
newchannel.time_channel = 1;
end;

Check notice

Code scanning / Code Analyzer

Extra semicolon is unnecessary. Note

Extra semicolon is unnecessary.
channels = rmfield(channels, remove);

% Add time channel
if isempty(channels),

Check notice

Code scanning / Code Analyzer

Extra comma is unnecessary. Note

Extra comma is unnecessary.
% Add time channel
if isempty(channels),
channels = struct('name','t1','type','time','time_channel',1);
else,

Check notice

Code scanning / Code Analyzer

Extra comma is unnecessary. Note

Extra comma is unnecessary.
[channels.time_channel] = deal(1);
time_channel = struct('name','t1','type','time','time_channel',1);
channels = [time_channel; channels(:)];
end;

Check notice

Code scanning / Code Analyzer

Extra semicolon is unnecessary. Note

Extra semicolon is unnecessary.
github-actions bot and others added 2 commits December 13, 2025 14:01
…Intan logic

Modified `ndr.reader.base` and several subclasses to ensure `getchannelsepoch` returns a channel structure with the `time_channel` field.
Specifically:
- Updated `ndr.reader.base.getchannelsepoch` to include `time_channel`.
- Updated `ndr.reader.intan_rhd.getchannelsepoch` to conditionally add a second time channel (`t2`) at index 2 only if auxiliary input channels are present in the header. `auxiliary_in` channels use `time_channel` 2, others use 1.
- Updated `ndr.reader.ced_smr.getchannelsepoch` to set `time_channel` to the channel ID.
- Updated `ndr.reader.neo` and `ndr.reader.spikegadgets_rec` to default `time_channel` to 1 and add `t1`.

channels(1) = struct('name','t1','type','time','time_channel',1);

if isfield(header,'aux_input_channels') & ~isempty(header.aux_input_channels),

Check notice

Code scanning / Code Analyzer

Extra comma is unnecessary. Note

Extra comma is unnecessary.

if isfield(header,'aux_input_channels') & ~isempty(header.aux_input_channels),
channels(2) = struct('name','t2','type','time','time_channel',2);
end;

Check notice

Code scanning / Code Analyzer

Extra semicolon is unnecessary. Note

Extra semicolon is unnecessary.
@stevevanhooser stevevanhooser marked this pull request as ready for review December 13, 2025 15:53
@stevevanhooser stevevanhooser merged commit b579098 into main Dec 13, 2025
@stevevanhooser stevevanhooser deleted the time-channel-fix-9252553676688051570 branch December 13, 2025 15:53
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