Closed ScottDelbecq closed 3 years ago
Ok, this is a corner case that VariableList.from_problem()
does not handle, but how is it a problem for FAST-OAD?
I mean, in a FAST-OAD computation, your 3 components would be FAST-OAD modules, and their inputs and outputs would be all promoted.
Can we have the same problem in a real case usage of FAST-OAD?
This issue will not impact the computation and thus the problem results. However, I find it confusing to have an output in the generated input file. The only place where this occurs in FAST-OAD is here when the use_xfoil
option is set to True
.
This leads to have data:aerodynamics:aircraft:landing:CL_max_clean_2D
in the generated input file despite that it is then overwritten by the computation.
This will occur each time we want to connect a non promoted and a promoted variable. I can't tell if many users will do this.
Actually, you should find that this variable is no more in input file with current master
, because it was due to bug #313, which has just been fixed.
And since FAST-OAD always promotes all variables of its modules, the only place where a user can choose to connect a non promoted and a promoted variable, is inside his own components. And in that case, I am not really sure that it could have the effect you describe on the whole problem.
My point is that VariableList.from_problem()
is already (too?) complicated. And if you have to add code in it to manage this corner case, I am afraid that refactoring/splitting this method might be necessary to keep it readable.
And of course, you'd have to set up also a proper unit test to go with your changes.
I am not against doing that, but I just want to be sure it is worth it.
There is an problem when determining wether if a variable is a global input of the problem when using the connect() mechanism with the promotion mechanism. In the example below,
y1
is an output ofdis1
and an input offunctions
which are both connected. Hence,y1.is_input
should beFalse
.