dseries issueshttps://git.dynare.org/Dynare/dseries/-/issues2023-05-23T17:22:49Zhttps://git.dynare.org/Dynare/dseries/-/issues/55Make subsref robust to deeper levels of nesting2023-05-23T17:22:49ZJohannes PfeiferMake subsref robust to deeper levels of nestingExecuting
```
load data_series.mat
ts = dseries(data_series,'1999Q1');
o = x13(ts);
o.transform('function','log');
o.automdl('savelog','amd');
o.x11('save','(d10)');
% run
o.run();
```
stores results in a `dseries` object in `o.results....Executing
```
load data_series.mat
ts = dseries(data_series,'1999Q1');
o = x13(ts);
o.transform('function','log');
o.automdl('savelog','amd');
o.x11('save','(d10)');
% run
o.run();
```
stores results in a `dseries` object in `o.results.d10`. However, trying to read out the subfield `o.results.d10.data` does not work as expected. Instead of a double, it will still return a `dseries`. The problem seems to derive from `subsref` only expecting two levels of nesting. This, by the way, also creates an infinite recursion problem in the Matlab variable editor, as shown in the screenshot.
![image](/uploads/da523510a35c57b65dddacdb36f50494/image.png)
[data_series.mat](/uploads/25ee186c37cf504f9c0b515bff8b5881/data_series.mat)https://git.dynare.org/Dynare/dseries/-/issues/51Allow specifying xls_sheet2023-09-27T15:16:54ZJohannes PfeiferAllow specifying xls_sheetCurrently, `load_data.m` contains
```
if isglobalinbase('options_')
% Check that the object is instantiated within a dynare session so that options_ global structure exists.
% Should provide latter a mechanism to pass...Currently, `load_data.m` contains
```
if isglobalinbase('options_')
% Check that the object is instantiated within a dynare session so that options_ global structure exists.
% Should provide latter a mechanism to pass range and sheet to dseries constructor...
range = evalin('base','options_.xls_range');
sheet = evalin('base','options_.xls_sheet');
else
% By default only the (whole) first sheet is loaded.
range = [];
sheet = [];
end
```
This does not work with `makedataset` in `mom.run`, because `xls_sheet` is a subfield of `options_mom_`, which is not even a global variable.7.xStéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.eu