You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We ran into a subtle issue with the En-ROADS model and the latest SDE where sde would fail in the case where a subscripted variable is only partially defined in the mdl file. For example:
In this case, technically Initial Partial[C1] is unused and doesn't need to be included in the compiled code, but the removeUnusedVariables function is currently conservative and doesn't eliminate unused subscript cases.
As currently written, one part of that function would skip over Initial Partial[C1] because it appears to be unreferenced, but then another part of the code would try to include all subscript variants of Initial Partial when emitting the code, and there would be a broken dependency, leading to this sort of error message:
ERROR: no var found for refId : '_constant_partial_1'
no var with refId for _constant_partial_1, referenced by _initial_partial[_c1]
ERROR: no var found for refId : '_constant_partial_1'
TypeError: Cannot read property 'varType' of undefined
The fix is to make both parts of the code equally conservative for now. Eventually we might be able to try a different approach that eliminates the unused subscripted variable, but for now, better to be safe.
The text was updated successfully, but these errors were encountered:
We ran into a subtle issue with the En-ROADS model and the latest SDE where
sde
would fail in the case where a subscripted variable is only partially defined in the mdl file. For example:In this case, technically
Initial Partial[C1]
is unused and doesn't need to be included in the compiled code, but theremoveUnusedVariables
function is currently conservative and doesn't eliminate unused subscript cases.As currently written, one part of that function would skip over
Initial Partial[C1]
because it appears to be unreferenced, but then another part of the code would try to include all subscript variants ofInitial Partial
when emitting the code, and there would be a broken dependency, leading to this sort of error message:The fix is to make both parts of the code equally conservative for now. Eventually we might be able to try a different approach that eliminates the unused subscripted variable, but for now, better to be safe.
The text was updated successfully, but these errors were encountered: