Skip to content

Commit 7b16355

Browse files
committed
Add regression test for aux time tables; correct CHANGELOG entry
The cellstr(curTimeNames) change in split and resample fixes a MATLAB R2025b failure, not an Octave one: table() rejects a single char name for 'VariableNames', which broke splitting and resampling data whose Aux holds a table with its own time column (such as a derived HRV series). Add SplitTest/testAuxTableWithTimeColumn, which fails without the fix, and describe the bug correctly in the CHANGELOG.
1 parent 22a0e3d commit 7b16355

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎+pf2_base/+tests/+unit/SplitTest.m‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,5 +365,20 @@ function testSplitDataValuesAreFromOriginal(testCase)
365365
testCase.verifyEqual(seg.HbO, expectedHbO, 'AbsTol', 1e-15, ...
366366
'Extracted HbO should exactly match original data slice');
367367
end
368+
369+
function testAuxTableWithTimeColumn(testCase)
370+
% An aux signal stored as a table with its own time column
371+
% (e.g. a derived HRV series). Splitting and resampling rebuild
372+
% its time table, which R2025b's table() rejected when given a
373+
% single char variable name.
374+
data = testCase.processedData;
375+
t = (data.time(1):1:data.time(end))';
376+
data.Aux.hrv = table(t, 60 + randn(numel(t), 1), ...
377+
'VariableNames', {'time', 'RMSSD'});
378+
seg = pf2.data.split(data, data.time(1) + 20, data.time(1) + 80);
379+
testCase.verifyTrue(isfield(seg, 'Aux'), 'split dropped the Aux field');
380+
rs = pf2.data.resample(data, 0.5);
381+
testCase.verifyTrue(isfield(rs, 'Aux'), 'resample dropped the Aux field');
382+
end
368383
end
369384
end

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Groundwork for running headless single-subject processing under GNU Octave.
2828
- `pf2_base.tests.integration.FullPipelineTest/testDifferentMethods` builds its method combinations with the Pipeline API and runs them through a `ProcessingContext`, so it no longer skips on machines without the named methods in their library or changes the global method selection.
2929
- `pf2_base.normalizeMarkerDict` parses `{code, label}` cell dictionaries element by element, so numeric codes keep one row each under Octave.
3030
- `pf2_base.external.zp2sos` orders complex roots with `sortrows` instead of `sort(..., 'ComparisonMethod', 'real')`, which Octave lacks; the resulting second-order sections are identical.
31-
- `pf2.data.resample` and `pf2.data.split` pass aux time-column names to `table` as a cell array, which Octave requires.
31+
- `pf2.data.split` and `pf2.data.resample` failed on aux signals stored as tables with their own time column (for example a derived HRV series): MATLAB R2025b's `table` rejects a single char name for `'VariableNames'`. The time-column name is now passed as a cell array. v1.1.0 is affected the same way.
3232
- `pf2.import.importHitachiMES` no longer requests the unused second output of `strsplit`, and `pf2.data.split` assigns its time-size variables directly; both failed under Octave.
3333
- `loadDeviceCfg` and `pf2_base.gui.updateCurrentDevice` assign whole table columns instead of growing them by indexed assignment, and no longer call `sprintf` on a categorical or `nansum` on a logical.
3434
- `bvoxy` declares its positional `coefs` and `isOD` options before its name-value parameters. Argument handling under MATLAB is unchanged.

0 commit comments

Comments
 (0)