Macro objects have all the parameters as initial and step dependencies. This could lead to some circular initialization error when it shouldn't. For example, model below
:MACRO: MYMACRO(A, B)
mymacro = INTEG(A, B) ~~|
:END OF MACRO:
my_var = MYMACRO(var1, var2) ~~|
var1 = INITIAL(my_var) ~~|
var2 = 0 ~~|
dependencies for my_var are translated as
@component.add(
name="my_var",
comp_type="Auxiliary",
comp_subtype="Normal",
depends_on={"_macro_mymacro_my_var": 1},
other_deps={
"_macro_mymacro_my_var": {
"initial": {"var1": 1, "var2": 1},
"step": {"var1": 1, "var2": 1},
}
},
)
which leads to a circular initialization error, when they should be translated as
@component.add(
name="my_var",
comp_type="Auxiliary",
comp_subtype="Normal",
depends_on={"_macro_mymacro_my_var": 1},
other_deps={
"_macro_mymacro_my_var": {
"initial": {"var2": 1},
"step": {"var1": 1},
}
},
)
This requires building first the macros and resolving the dependencies in the SectionBuilder level, so they can be properly accessed by the macro call builder.
FYI @mak63-dev
Macro objects have all the parameters as
initialandstepdependencies. This could lead to some circular initialization error when it shouldn't. For example, model belowdependencies for
my_varare translated aswhich leads to a circular initialization error, when they should be translated as
This requires building first the macros and resolving the dependencies in the
SectionBuilderlevel, so they can be properly accessed by the macro call builder.FYI @mak63-dev