800189371b
Adds make_figure (2-panel learning curves + per-phase slopes, colorblind-safe Box-B2/Box-A2 palette) -> results/figure_learning.png; analysis/writeup.md (figure + methods + results summary); and tdcs_export_all/run_export exporting every data variation into an organized export/ tree (curated_all, scenarios/9, anchors/3 with tDCS factor, phases/9 + MANIFEST). Adds tExport tests. Suite 36/36. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
34 lines
1.4 KiB
Matlab
34 lines
1.4 KiB
Matlab
classdef tExport < matlab.unittest.TestCase
|
|
%TEXPORT Tests for tdcs_export_all (organized CSV export of all variations).
|
|
|
|
methods (Test)
|
|
|
|
function testExportTreeAndContents(testCase)
|
|
outRoot = tempname;
|
|
files = tdcs_export_all(outRoot);
|
|
testCase.verifyGreaterThanOrEqual(numel(files), 22); % 1 + 9 + 3 + 9
|
|
|
|
% curated: 12 animals
|
|
Tc = readtable(fullfile(outRoot, 'curated_all.csv'), 'TextType', 'string');
|
|
testCase.verifyEqual(numel(unique(Tc.subject)), 12);
|
|
|
|
% scenario mergeB2_full: Box-B2 has 5 subjects
|
|
Sb = readtable(fullfile(outRoot, 'scenarios', 'mergeB2_full.csv'), 'TextType', 'string');
|
|
nB2 = numel(unique(Sb.subject(Sb.group == "Electrode-Box-B2")));
|
|
testCase.verifyEqual(nB2, 5);
|
|
|
|
% anchor file carries a binary tDCS factor with both levels
|
|
A = readtable(fullfile(outRoot, 'anchors', 'mergeA2_B2vsA2.csv'));
|
|
testCase.verifyEqual(sort(unique(A.tDCS))', [0 1]);
|
|
|
|
% phases folder holds 3 merges x 3 phases = 9 files, each with dayp
|
|
ph = dir(fullfile(outRoot, 'phases', '*.csv'));
|
|
testCase.verifyEqual(numel(ph), 9);
|
|
P = readtable(fullfile(outRoot, 'phases', 'mergeA2_phase_6-13.csv'));
|
|
testCase.verifyTrue(ismember('dayp', P.Properties.VariableNames));
|
|
testCase.verifyGreaterThanOrEqual(min(P.dayp), 0);
|
|
end
|
|
|
|
end
|
|
end
|