reporting: replace isa(*,’dates’) with isdates()

time-shift
Houtan Bastani 2014-05-20 14:47:37 +02:00
parent afe925cd30
commit 1435cc5096
6 changed files with 7 additions and 7 deletions

View File

@ -146,10 +146,10 @@ valid_legend_orientations = {'vertical', 'horizontal'};
assert(any(strcmp(o.legendOrientation, valid_legend_orientations)), ...
['@graph.graph: legendOrientation must be one of ' strjoin(valid_legend_orientations, ' ')]);
assert(isempty(o.shade) || (isa(o.shade, 'dates') && o.shade.ndat >= 2), ...
assert(isempty(o.shade) || (isdates(o.shade) && o.shade.ndat >= 2), ...
['@graph.graph: shade is specified as a dates range, e.g. ' ...
'''dates(''1999q1''):dates(''1999q3'')''.']);
assert(isempty(o.xrange) || (isa(o.xrange, 'dates') && o.xrange.ndat >= 2), ...
assert(isempty(o.xrange) || (isdates(o.xrange) && o.xrange.ndat >= 2), ...
['@graph.graph: xrange is specified as a dates range, e.g. ' ...
'''dates(''1999q1''):dates(''1999q3'')''.']);
assert(isempty(o.yrange) || (isfloat(o.yrange) && length(o.yrange) == 2 && ...

View File

@ -35,7 +35,7 @@ function o = writeSeriesForTable(o, fid, dates, precision)
%% Validate options passed to function
assert(fid ~= -1);
for i=1:length(dates)
assert(isa(dates{i}, 'dates'));
assert(isdates(dates{i}));
end
assert(isint(precision));

View File

@ -78,7 +78,7 @@ if ~iscell(o.range)
o.range = {o.range};
end
if isa(o.vlineAfter, 'dates')
if isdates(o.vlineAfter)
o.vlineAfter = {o.vlineAfter};
end

View File

@ -31,7 +31,7 @@ function tf = allCellsAreDates(dcell)
assert(iscell(dcell));
tf = true;
for i=1:length(dcell)
if ~isa(dcell{i}, 'dates')
if ~isdates(dcell{i})
tf = false;
return;
end

View File

@ -31,7 +31,7 @@ function tf = allCellsAreDatesRange(dcell)
assert(iscell(dcell));
tf = true;
for i=1:length(dcell)
if ~(isa(dcell{i}, 'dates') && dcell{i}.ndat >= 2)
if ~(isdates(dcell{i}) && dcell{i}.ndat >= 2)
tf = false;
return;
end

View File

@ -69,7 +69,7 @@ for i=1:length(fields)
fprintf('false');
end
elseif isobject(val)
if isa(val, 'dates')
if isdates(val)
fprintf('<dates: %s, ..., %s>', ...
date2string(val(1)), date2string(val(end)));
elseif isa(val, 'dseries')