IRIS-Solutions-Team / IRIS-Toolbox

[IrisToolbox] for Macroeconomic Modeling
Other
90 stars 41 forks source link

grouping function issue #382

Closed Usukhbayar13 closed 10 months ago

Usukhbayar13 commented 10 months ago

function g = prepareGrouping(this, g, type, opt)

add = cell(1, 0);

if startsWith(type, "s", "ignoreCase", true) g.Type = 'shock'; ixType = this.Quantity.Type==31 | this.Quantity.Type==32; if opt.IncludeExtras add = { ... model.CONTRIBUTION_INIT_CONST_DTREND, ... model.CONTRIBUTION_NONLINEAR, ... }; end

elseif startsWith(type, "m", "ignoreCase", true) g.Type = 'measurement'; ixType = this.Quantity.Type==1;

end

g.List = [this.Quantity.Name(ixType), add]; g.Label = [this.Quantity.Label(ixType), add]; g.IsLog = access(this, "is-log");

end

I use this code with iris 14 to grouping shocks. But "access" function is not working on IRIS 23. How the 'access' changed in IRIS23?

jaromir-benes commented 10 months ago

Hi - the "access" function is working in the latest Iris - you can check this by simply running

access(m, "is-log")

on the command line for any model....

Can you please give me more details about the error message you get when calling "prepareGrouping"?

J

On Wed, Aug 16, 2023 at 9:51 AM Usukhbayar13 @.***> wrote:

function g = prepareGrouping(this, g, type, opt)

add = cell(1, 0);

if startsWith(type, "s", "ignoreCase", true) g.Type = 'shock'; ixType = this.Quantity.Type==31 | this.Quantity.Type==32; if opt.IncludeExtras add = { ... model.CONTRIBUTION_INIT_CONST_DTREND, ... model.CONTRIBUTION_NONLINEAR, ... }; end

elseif startsWith(type, "m", "ignoreCase", true) g.Type = 'measurement'; ixType = this.Quantity.Type==1;

end

g.List = [this.Quantity.Name(ixType), add]; g.Label = [this.Quantity.Label(ixType), add]; g.IsLog = access(this, "is-log");

end

I use this code with iris 14 to grouping shocks. But "access" function is not working on IRIS 23. How the 'access' changed in IRIS23?

— Reply to this email directly, view it on GitHub https://github.com/IRIS-Solutions-Team/IRIS-Toolbox/issues/382, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCVKKSWKQTEJVCKFYXNKPTXVR3XVANCNFSM6AAAAAA3SDZCBI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Usukhbayar13 commented 10 months ago

here is the error message: Incorrect number or types of inputs or outputs for function 'access'.

Error in model/prepareGrouping (line 30) g.IsLog = access(this, "is-log");

Error in grouping (line 143) this = prepareGrouping(m, this, type, opt);

g = grouping(m,'shock');

jaromir-benes commented 10 months ago

What release/commit of Iris is this?

On Wed, Aug 16, 2023 at 11:37 AM Usukhbayar13 @.***> wrote:

here is the error message: Incorrect number or types of inputs or outputs for function 'access'.

Error in model/prepareGrouping (line 30) g.IsLog = access(this, "is-log");

Error in grouping (line 143) this = prepareGrouping(m, this, type, opt);

— Reply to this email directly, view it on GitHub https://github.com/IRIS-Solutions-Team/IRIS-Toolbox/issues/382#issuecomment-1680283165, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCVKKSIJTJTGO3JZX46YZ3XVSIGFANCNFSM6AAAAAA3SDZCBI . You are receiving this because you commented.Message ID: @.***>

Usukhbayar13 commented 10 months ago

maybe the problem was on model file. When I use 'Model.fromFile' instead of 'model' , it works. thanks for reply

jaromir-benes commented 10 months ago

Yes, exactly - you need to use the new "Model" objects, not the old "model" (mind the capitalization, same goes for plan versus Plan, tseries versus Series). Best, J

On Wed, Aug 16, 2023 at 12:28 PM Usukhbayar13 @.***> wrote:

maybe the problem was on model file. I use 'Model.fromFile' instead of 'model' on model file, it works. thanks

— Reply to this email directly, view it on GitHub https://github.com/IRIS-Solutions-Team/IRIS-Toolbox/issues/382#issuecomment-1680354385, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCVKKSAKVQWEF54VQJCBR3XVSOFDANCNFSM6AAAAAA3SDZCBI . You are receiving this because you commented.Message ID: @.***>