reporting: tests: show functionality of tableDataRhs option

time-shift
Houtan Bastani 2014-01-02 15:35:41 +01:00
parent 52492afe6e
commit e301eeb206
2 changed files with 16 additions and 8 deletions

View File

@ -1,5 +1,5 @@
function rep = CountryTablePage(rep, countryAbbr, countryName, db_q, dc_q, trange, vline_after)
% Copyright (C) 2013 Dynare Team
function rep = CountryTablePage(rep, countryAbbr, countryName, db_q, dc_q, db_a, dc_a, trange, vline_after)
% Copyright (C) 2013-2014 Dynare Team
%
% This file is part of Dynare.
%
@ -42,8 +42,10 @@ otherThree = {'EA6','LA6','RC6'};
notForOtherThree = {'BLT_', 'UNR_', 'UNR_BAR_', 'UNR_GAP_'};
rep = rep.addTable('title', countryName, ...
'range', trange, ...
'vlineAfter', vline_after);
'range', {trange, dates('2012a'):dates('2014a')}, ...
'vlineAfter', {vline_after dates('2014q4')});
for i=1:length(seriesNames)
if any(strcmp(countryAbbr, otherThree)) && ...
@ -51,11 +53,16 @@ for i=1:length(seriesNames)
continue
end
db_q = db_q.tex_rename([seriesNames{i}{1} countryAbbr], seriesNames{i}{2});
rep = rep.addSeries('data', db_q{[seriesNames{i}{1} countryAbbr]});
rep = rep.addSeries('data', db_q{[seriesNames{i}{1} countryAbbr]}, ...
'tableDataRhs', db_a{[seriesNames{i}{1} countryAbbr]});
delta = db_q{[seriesNames{i}{1} countryAbbr]}-dc_q{[seriesNames{i}{1} countryAbbr]};
delta = delta.tex_rename('$\Delta$');
deltaa = db_a{[seriesNames{i}{1} countryAbbr]}-dc_a{[seriesNames{i}{1} countryAbbr]};
deltaa = delta.tex_rename('$\Delta$');
rep = rep.addSeries('data', delta, ...
'tableShowMarkers', true, ...
'tableAlignRight', true);
'tableAlignRight', true, ...
'tableDataRhs', deltaa);
end
end

View File

@ -1,5 +1,5 @@
function runDynareReport(dc_a, dc_q, db_a, db_q)
% Copyright (C) 2013 Dynare Team
% Copyright (C) 2013-2014 Dynare Team
%
% This file is part of Dynare.
%
@ -120,7 +120,8 @@ for i=1:length(shortNames)
rep = rep.addPage('title', 'Jan1 vs Jan2', ...
'titleFormat', '\large\bfseries');
rep = rep.addSection();
rep = CountryTablePage(rep, shortNames{i}, longNames{i}, db_q, dc_q, trange, dates('2012q2'));
rep = CountryTablePage(rep, shortNames{i}, longNames{i}, db_q, dc_q, ...
db_a, dc_a, trange, dates('2012q2'));
end
%% Residual Reports