From 41548df963aa78ed7d98b64a195e417006d347f7 Mon Sep 17 00:00:00 2001
From: Houtan Bastani <houtan@dynare.org>
Date: Tue, 20 May 2014 14:50:28 +0200
Subject: [PATCH] =?UTF-8?q?reporting:=20replace=20isa(*,=E2=80=99dseries?=
 =?UTF-8?q?=E2=80=99)=20with=20isdseries()?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 matlab/reports/@graph/graph.m                       | 2 +-
 matlab/reports/@report_series/writeSeriesForGraph.m | 2 +-
 matlab/reports/@report_series/writeSeriesForTable.m | 4 ++--
 matlab/reports/@report_table/report_table.m         | 2 +-
 matlab/reports/display_reporting_object.m           | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/matlab/reports/@graph/graph.m b/matlab/reports/@graph/graph.m
index 5f4a2343c4..6873043975 100644
--- a/matlab/reports/@graph/graph.m
+++ b/matlab/reports/@graph/graph.m
@@ -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)']);
diff --git a/matlab/reports/@report_series/writeSeriesForGraph.m b/matlab/reports/@report_series/writeSeriesForGraph.m
index 61afce9a9b..93c08de4ef 100644
--- a/matlab/reports/@report_series/writeSeriesForGraph.m
+++ b/matlab/reports/@report_series/writeSeriesForGraph.m
@@ -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
 
diff --git a/matlab/reports/@report_series/writeSeriesForTable.m b/matlab/reports/@report_series/writeSeriesForTable.m
index a3999c5666..2ef3e88458 100644
--- a/matlab/reports/@report_series/writeSeriesForTable.m
+++ b/matlab/reports/@report_series/writeSeriesForTable.m
@@ -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');
diff --git a/matlab/reports/@report_table/report_table.m b/matlab/reports/@report_table/report_table.m
index 70b17c9ffb..3fc1e2a7d3 100644
--- a/matlab/reports/@report_table/report_table.m
+++ b/matlab/reports/@report_table/report_table.m
@@ -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)');
diff --git a/matlab/reports/display_reporting_object.m b/matlab/reports/display_reporting_object.m
index e8ae950e4a..9db3bd770d 100644
--- a/matlab/reports/display_reporting_object.m
+++ b/matlab/reports/display_reporting_object.m
@@ -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
-- 
GitLab