Commit b3c47556 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

reporting: replace isa(*,’dseries’) with isdseries()

parent 48b0784a
......@@ -156,7 +156,7 @@ assert(isempty(o.yrange) || (isfloat(o.yrange) && length(o.yrange) == 2 && ...
o.yrange(1) < o.yrange(2)), ...
['@graph.graph: yrange is specified an array with two float entries, ' ...
'the lower bound and upper bound.']);
assert(isempty(o.data) || isa(o.data, 'dseries'), ['@graph.graph: data must ' ...
assert(isempty(o.data) || isdseries(o.data), ['@graph.graph: data must ' ...
'be a dseries']);
assert(isempty(o.seriesToUse) || iscellstr(o.seriesToUse), ['@graph.graph: ' ...
'seriesToUse must be a cell array of string(s)']);
......
......@@ -31,7 +31,7 @@ function o = writeSeriesForGraph(o, fid, xrange)
%% Validate options provided by user
if isempty(o.graphVline) && isempty(o.graphHline)
assert(~isempty(o.data) && isa(o.data, 'dseries'), ['@report_series.writeSeriesForGraph: must ' ...
assert(~isempty(o.data) && isdseries(o.data), ['@report_series.writeSeriesForGraph: must ' ...
'provide data as a dseries']);
end
......
......@@ -42,11 +42,11 @@ assert(isint(precision));
%% Validate options provided by user
assert(ischar(o.tableSubSectionHeader), '@report_series.writeSeriesForTable: tableSubSectionHeader must be a string');
if isempty(o.tableSubSectionHeader)
assert(~isempty(o.data) && isa(o.data, 'dseries'), ...
assert(~isempty(o.data) && isdseries(o.data), ...
'@report_series.writeSeriesForTable: must provide data as a dseries');
if ~isempty(o.tableDataRhs)
assert(~isempty(o.tableDataRhs) && isa(o.tableDataRhs, 'dseries'), ...
assert(~isempty(o.tableDataRhs) && isdseries(o.tableDataRhs), ...
'@report_series.writeSeriesForTable: must provide tableDataRhs as a dseries');
assert(iscell(dates) && length(dates) == 2, ...
'@report_series.writeSeriesForTable: must provide second range with tableDataRhs');
......
......@@ -98,7 +98,7 @@ assert(isint(o.precision), '@report_table.report_table: precision must be an int
assert(isempty(o.range) || length(o.range) <=2 && allCellsAreDatesRange(o.range), ...
['@report_table.report_table: range is specified as a dates range, e.g. ' ...
'''dates(''1999q1''):dates(''1999q3'')''.']);
assert(isempty(o.data) || isa(o.data, 'dseries'), ...
assert(isempty(o.data) || isdseries(o.data), ...
'@report_table.report_table: data must be a dseries');
assert(isempty(o.seriesToUse) || iscellstr(o.seriesToUse), ...
'@report_table.report_table: seriesToUse must be a cell array of string(s)');
......
......@@ -72,7 +72,7 @@ for i=1:length(fields)
if isdates(val)
fprintf('<dates: %s, ..., %s>', ...
date2string(val(1)), date2string(val(end)));
elseif isa(val, 'dseries')
elseif isdseries(val)
if numel(val) == 1
fprintf('<dseries: %s>', val.name{1});
else
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment