Renamed dynDates class as dates.
parent
3dbb9bd6a2
commit
2bb645ec70
|
@ -115,12 +115,12 @@ 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, 'dynDates') && o.shade.ndat >= 2), ...
|
||||
['@graph.graph: shade is specified as a dynDates range, e.g. ' ...
|
||||
'''dynDates(''1999q1''):dynDates(''1999q3'')''.']);
|
||||
assert(isempty(o.xrange) || (isa(o.xrange, 'dynDates') && o.xrange.ndat >= 2), ...
|
||||
['@graph.graph: xrange is specified as a dynDates range, e.g. ' ...
|
||||
'''dynDates(''1999q1''):dynDates(''1999q3'')''.']);
|
||||
assert(isempty(o.shade) || (isa(o.shade, 'dates') && 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), ...
|
||||
['@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 && ...
|
||||
o.yrange(1) < o.yrange(2)), ...
|
||||
['@graph.graph: yrange is specified an array with two float entries, ' ...
|
||||
|
|
|
@ -18,6 +18,6 @@ function ds = getData(o, dates)
|
|||
% You should have received a copy of the GNU General Public License
|
||||
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
assert(~isempty(o.data) && size(o.data, 2) == 1 && isa(dates, 'dynDates'));
|
||||
assert(~isempty(o.data) && size(o.data, 2) == 1 && isa(dates, 'dates'));
|
||||
ds = o.data(dates);
|
||||
end
|
|
@ -4,7 +4,7 @@ function h = getLine(o, xrange)
|
|||
%
|
||||
% INPUTS
|
||||
% o [series] series object
|
||||
% xrange [dynDates] range of x values for line
|
||||
% xrange [dates] range of x values for line
|
||||
%
|
||||
% OUTPUTS
|
||||
% h [handle] handle to line
|
||||
|
@ -58,7 +58,7 @@ assert(~(strcmp(o.graphLineStyle, 'none') && isempty(o.graphMarker)), ['@series.
|
|||
'you must provide at least one of graphLineStyle and graphMarker']);
|
||||
|
||||
% Validate xrange
|
||||
assert(isempty(xrange) || isa(xrange, 'dynDates'));
|
||||
assert(isempty(xrange) || isa(xrange, 'dates'));
|
||||
|
||||
% Zero tolerance
|
||||
assert(isfloat(o.zerotol), '@series.write: zerotol must be a float');
|
||||
|
|
|
@ -5,7 +5,7 @@ function o = write(o, fid, dates, precision, yrsForAvgs)
|
|||
% INPUTS
|
||||
% o [series] series object
|
||||
% fid [int] file id
|
||||
% dates [dynDates] dates for series slice
|
||||
% dates [dates] dates for series slice
|
||||
% precision [float] precision with which to print the data
|
||||
% yrsForAvgs [bool] the years for which to compute averages
|
||||
%
|
||||
|
@ -35,7 +35,7 @@ function o = write(o, fid, dates, precision, yrsForAvgs)
|
|||
|
||||
%% Validate options passed to function
|
||||
assert(fid ~= -1);
|
||||
assert(isa(dates, 'dynDates'));
|
||||
assert(isa(dates, 'dates'));
|
||||
assert(isint(precision));
|
||||
|
||||
%% Validate options provided by user
|
||||
|
|
|
@ -79,9 +79,9 @@ assert(islogical(o.annualAverages), '@table.table: annualAverages must be true o
|
|||
assert(islogical(o.showHlines), '@table.table: showHlines must be true or false');
|
||||
assert(islogical(o.showVlines), '@table.table: showVlines must be true or false');
|
||||
assert(isint(o.precision), '@table.table: precision must be an int');
|
||||
assert(isempty(o.range) || (isa(o.range, 'dynDates') && o.range.ndat >= 2), ...
|
||||
['@table.table: range is specified as a dynDates range, e.g. ' ...
|
||||
'''dynDates(''1999q1''):dynDates(''1999q3'')''.']);
|
||||
assert(isempty(o.range) || (isa(o.range, 'dates') && o.range.ndat >= 2), ...
|
||||
['@table.table: range is specified as a dates range, e.g. ' ...
|
||||
'''dates(''1999q1''):dates(''1999q3'')''.']);
|
||||
assert(isempty(o.data) || isa(o.data, 'dynSeries'), ...
|
||||
'@table.table: data must be a dynSeries');
|
||||
assert(isempty(o.seriesToUse) || iscellstr(o.seriesToUse), ...
|
||||
|
|
|
@ -66,8 +66,8 @@ for i=1:length(fields)
|
|||
fprintf('false');
|
||||
end
|
||||
elseif isobject(val)
|
||||
if isa(val, 'dynDates')
|
||||
fprintf('<dynDates: %s, ..., %s>', ...
|
||||
if isa(val, 'dates')
|
||||
fprintf('<dates: %s, ..., %s>', ...
|
||||
val(1).format, val(end).format);
|
||||
elseif isa(val, 'dynSeries')
|
||||
if numel(val) == 1
|
||||
|
|
Loading…
Reference in New Issue