reporting: change series class name to report_series to avoid conflict with control systems toolbox function series
parent
95fea041ef
commit
600ae070fb
|
@ -1,9 +1,9 @@
|
|||
function display(o)
|
||||
%function display(o)
|
||||
% Display a Series object
|
||||
% Display a Report_Series object
|
||||
%
|
||||
% INPUTS
|
||||
% o [series] series object
|
||||
% o [report_series] report_series object
|
||||
%
|
||||
% OUTPUTS
|
||||
% none
|
|
@ -1,9 +1,9 @@
|
|||
function h = getLine(o, xrange)
|
||||
%function h = getLine(o, xrange)
|
||||
% Create the series
|
||||
% Create the report_series
|
||||
%
|
||||
% INPUTS
|
||||
% o [series] series object
|
||||
% o [report_series] report_series object
|
||||
% xrange [dynDates] range of x values for line
|
||||
%
|
||||
% OUTPUTS
|
||||
|
@ -30,15 +30,15 @@ function h = getLine(o, xrange)
|
|||
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
%% Validate options provided by user
|
||||
assert(~isempty(o.data) && isa(o.data, 'dynSeries'), ['@series.getLine: must ' ...
|
||||
assert(~isempty(o.data) && isa(o.data, 'dynSeries'), ['@report_series.getLine: must ' ...
|
||||
'provide data as a dynSeries']);
|
||||
|
||||
% Line
|
||||
assert(ischar(o.graphLineColor), '@series.getLine: graphLineColor must be a string');
|
||||
assert(ischar(o.graphLineColor), '@report_series.getLine: graphLineColor must be a string');
|
||||
valid_line_style = {'none', '-', '--', ':', '-.'};
|
||||
assert(any(strcmp(o.graphLineStyle, valid_line_style)), ...
|
||||
['@series.getLine: graphLineStyle must be one of ' strjoin(valid_line_style, ' ')]);
|
||||
assert(isfloat(o.graphLineWidth), ['@series.getLine: graphLineWidth must be a ' ...
|
||||
['@report_series.getLine: graphLineStyle must be one of ' strjoin(valid_line_style, ' ')]);
|
||||
assert(isfloat(o.graphLineWidth), ['@report_series.getLine: graphLineWidth must be a ' ...
|
||||
'positive number']);
|
||||
|
||||
% GraphMarker
|
||||
|
@ -46,22 +46,22 @@ valid_graphMarker = {'+', 'o', '*', '.', 'x', 's', 'square', 'd', 'diamond', ...
|
|||
'^', 'v', '>', '<', 'p', 'pentagram', 'h', 'hexagram', ...
|
||||
'none'};
|
||||
assert(isempty(o.graphMarker) || any(strcmp(o.graphMarker, valid_graphMarker)), ...
|
||||
['@series.getLine: graphMarker must be one of ' strjoin(valid_graphMarker)]);
|
||||
['@report_series.getLine: graphMarker must be one of ' strjoin(valid_graphMarker)]);
|
||||
|
||||
assert(ischar(o.graphMarkerEdgeColor), '@series.getLine: graphMarkerEdgeColor must be a string');
|
||||
assert(ischar(o.graphMarkerFaceColor), '@series.getLine: graphMarkerFaceColor must be a string');
|
||||
assert(isfloat(o.graphMarkerSize), ['@series.getLine: graphMarkerSize must be a ' ...
|
||||
assert(ischar(o.graphMarkerEdgeColor), '@report_series.getLine: graphMarkerEdgeColor must be a string');
|
||||
assert(ischar(o.graphMarkerFaceColor), '@report_series.getLine: graphMarkerFaceColor must be a string');
|
||||
assert(isfloat(o.graphMarkerSize), ['@report_series.getLine: graphMarkerSize must be a ' ...
|
||||
'positive number']);
|
||||
|
||||
% Marker & Line
|
||||
assert(~(strcmp(o.graphLineStyle, 'none') && isempty(o.graphMarker)), ['@series.getLine: ' ...
|
||||
assert(~(strcmp(o.graphLineStyle, 'none') && isempty(o.graphMarker)), ['@report_series.getLine: ' ...
|
||||
'you must provide at least one of graphLineStyle and graphMarker']);
|
||||
|
||||
% Validate xrange
|
||||
assert(isempty(xrange) || isa(xrange, 'dynDates'));
|
||||
|
||||
% Zero tolerance
|
||||
assert(isfloat(o.zerotol), '@series.write: zerotol must be a float');
|
||||
assert(isfloat(o.zerotol), '@report_series.write: zerotol must be a float');
|
||||
|
||||
%%
|
||||
if isempty(xrange) || xrange == o.data.time
|
||||
|
@ -70,7 +70,7 @@ else
|
|||
ds = o.data(xrange);
|
||||
end
|
||||
|
||||
% if graphing data that is within zerotol, set to zero, create series and
|
||||
% if graphing data that is within zerotol, set to zero, create report_series and
|
||||
% get line:
|
||||
thedata = ds.data;
|
||||
stz = bsxfun(@and, ...
|
|
@ -1,15 +1,15 @@
|
|||
function o = series(varargin)
|
||||
%function o = series(varargin)
|
||||
% Series Class Constructor
|
||||
function o = report_series(varargin)
|
||||
%function o = report_series(varargin)
|
||||
% Report_Series Class Constructor
|
||||
%
|
||||
% INPUTS
|
||||
% varargin 0 args : empty series object
|
||||
% 1 arg : must be series object (return a copy of arg)
|
||||
% varargin 0 args : empty report_series object
|
||||
% 1 arg : must be report_series object (return a copy of arg)
|
||||
% > 1 args: option/value pairs (see structure below for
|
||||
% options)
|
||||
%
|
||||
% OUTPUTS
|
||||
% o [series] series object
|
||||
% o [report_series] report_series object
|
||||
%
|
||||
% SPECIAL REQUIREMENTS
|
||||
% none
|
||||
|
@ -57,13 +57,13 @@ o.tableRowColor = 'white';
|
|||
o.zerotol = 1e-6;
|
||||
|
||||
if nargin == 1
|
||||
assert(isa(varargin{1}, 'series'),['@series.series: with one arg you ' ...
|
||||
'must pass a series object']);
|
||||
assert(isa(varargin{1}, 'report_series'),['@report_series.report_series: with one arg you ' ...
|
||||
'must pass a report_series object']);
|
||||
o = varargin{1};
|
||||
return;
|
||||
elseif nargin > 1
|
||||
if round(nargin/2) ~= nargin/2
|
||||
error(['@series.series: options must be supplied in name/value ' ...
|
||||
error(['@report_series.report_series: options must be supplied in name/value ' ...
|
||||
'pairs.']);
|
||||
end
|
||||
|
||||
|
@ -76,11 +76,11 @@ elseif nargin > 1
|
|||
if ~isempty(ind)
|
||||
o.(optNames{ind}) = pair{2};
|
||||
else
|
||||
error('@series.series: %s is not a recognized option.', pair{1});
|
||||
error('@report_series.report_series: %s is not a recognized option.', pair{1});
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
% Create series object
|
||||
o = class(o, 'series');
|
||||
% Create report_series object
|
||||
o = class(o, 'report_series');
|
||||
end
|
|
@ -34,9 +34,9 @@ switch S.type
|
|||
case fieldnames(A)
|
||||
B.(S.subs) = V;
|
||||
otherwise
|
||||
error(['@series.subsasgn: field ' S.subs 'does not exist']);
|
||||
error(['@report_series.subsasgn: field ' S.subs 'does not exist']);
|
||||
end
|
||||
otherwise
|
||||
error('@series.subsasgn: syntax error');
|
||||
error('@report_series.subsasgn: syntax error');
|
||||
end
|
||||
end
|
|
@ -31,12 +31,12 @@ switch S(1).type
|
|||
A = feval(S(1).subs, A);
|
||||
end
|
||||
otherwise
|
||||
error(['@series.subsref: unknown field or method: ' S(1).subs]);
|
||||
error(['@report_series.subsref: unknown field or method: ' S(1).subs]);
|
||||
end
|
||||
case {'()', '{}'}
|
||||
error(['@series.subsref: ' S(1).type ' indexing not supported.']);
|
||||
error(['@report_series.subsref: ' S(1).type ' indexing not supported.']);
|
||||
otherwise
|
||||
error('@series.subsref: impossible case')
|
||||
error('@report_series.subsref: impossible case')
|
||||
end
|
||||
|
||||
S = shiftS(S);
|
|
@ -3,15 +3,15 @@ function o = write(o, fid, dates, precision, yrsForAvgs)
|
|||
% Write Table Row
|
||||
%
|
||||
% INPUTS
|
||||
% o [series] series object
|
||||
% o [report_series] report_series object
|
||||
% fid [int] file id
|
||||
% dates [dynDates] dates for series slice
|
||||
% dates [dynDates] dates for report_series slice
|
||||
% precision [float] precision with which to print the data
|
||||
% yrsForAvgs [bool] the years for which to compute averages
|
||||
%
|
||||
%
|
||||
% OUTPUTS
|
||||
% o [series] series object
|
||||
% o [report_series] report_series object
|
||||
%
|
||||
% SPECIAL REQUIREMENTS
|
||||
% none
|
||||
|
@ -39,24 +39,24 @@ assert(isa(dates, 'dynDates'));
|
|||
assert(isint(precision));
|
||||
|
||||
%% Validate options provided by user
|
||||
assert(ischar(o.tableSubSectionHeader), '@series.write: tableSubSectionHeader must be a string');
|
||||
assert(ischar(o.tableSubSectionHeader), '@report_series.write: tableSubSectionHeader must be a string');
|
||||
if isempty(o.tableSubSectionHeader)
|
||||
assert(~isempty(o.data) && isa(o.data, 'dynSeries'), ...
|
||||
'@series.write: must provide data as a dynSeries');
|
||||
'@report_series.write: must provide data as a dynSeries');
|
||||
end
|
||||
|
||||
assert(ischar(o.tableNegColor), '@series.write: tableNegColor must be a string');
|
||||
assert(ischar(o.tablePosColor), '@series.write: tablePosColor must be a string');
|
||||
assert(ischar(o.tableRowColor), '@series.write: tableRowColor must be a string');
|
||||
assert(islogical(o.tableShowMarkers), '@series.write: tableShowMarkers must be true or false');
|
||||
assert(islogical(o.tableAlignRight), '@series.write: tableAlignRight must be true or false');
|
||||
assert(isfloat(o.tableMarkerLimit), '@series,write: tableMarkerLimit must be a float');
|
||||
assert(ischar(o.tableNegColor), '@report_series.write: tableNegColor must be a string');
|
||||
assert(ischar(o.tablePosColor), '@report_series.write: tablePosColor must be a string');
|
||||
assert(ischar(o.tableRowColor), '@report_series.write: tableRowColor must be a string');
|
||||
assert(islogical(o.tableShowMarkers), '@report_series.write: tableShowMarkers must be true or false');
|
||||
assert(islogical(o.tableAlignRight), '@report_series.write: tableAlignRight must be true or false');
|
||||
assert(isfloat(o.tableMarkerLimit), '@report_series,write: tableMarkerLimit must be a float');
|
||||
|
||||
%% Write Output
|
||||
dataString = ['%.' num2str(precision) 'f'];
|
||||
precision = 10^precision;
|
||||
|
||||
fprintf(fid, '%% Table Row (series)\n');
|
||||
fprintf(fid, '%% Table Row (report_series)\n');
|
||||
if ~isempty(o.tableRowColor)
|
||||
fprintf(fid, '\\rowcolor{%s}', o.tableRowColor);
|
||||
end
|
|
@ -18,5 +18,5 @@ function o = addSeries(o, varargin)
|
|||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
o.objArray = o.objArray.addObj(series(varargin{:}));
|
||||
o.objArray = o.objArray.addObj(report_series(varargin{:}));
|
||||
end
|
Loading…
Reference in New Issue