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
{{ message }}
Repository navigation
mdl: one apply-to-all equation imports as N per-element equations #651
The MDL importer turned every subscripted equation into one equation per element, even when the Vensim source has a single apply-to-all equation.
It should import a single apply-to-all equation as one apply-to-all equation.
Example
C-LEARN v77:
Atm conc CO2[scenario] = C in Atmosphere[scenario] * ppm CO2 per GtonC
imported as three per-element equations (Deterministic, High_2xCO2_sensitivity, Low_2xCO2_sensitivity), each with the same text.
Most of C-LEARN's auxiliaries were affected.
Why it matters
The model held 3 to 12 times more equations than its source, pysimlin showed these variables with an empty equation, and LTM built per-element link scores where one apply-to-all score would do, a large part of C-LEARN's LTM size (#647).
Status
The importer now collapses the slots back into one apply-to-all equation when they come from one source equation with no :EXCEPT:, no external data, no per-element initial value or graphical function, and cover every element (slots_are_one_apply_to_all).
A variable defined by several equations over subranges, like C-LEARN's Heat Transfer[scenario, layer1] and [scenario, lower], still imports per element; the datamodel has no form for "one equation per subrange".
changed the title [-]mdl: importer expands single apply-to-all Vensim equations into N identical per-element equations[/-][+]mdl: one apply-to-all equation imports as N per-element equations[/+]on Oct 12, 2026
The importer collapses slots from one source equation back into Equation::ApplyToAll via slots_are_one_apply_to_all (src/simlin-engine/src/mdl/convert/variables.rs:376, gate at :794). Pinned in src/simlin-engine/src/mdl/convert/apply_to_all_tests.rs (an_ordinary_apply_to_all_equation_stays_one_equation at :121, plus rows for each case that must stay arrayed).
Activity
[-]mdl: importer expands single apply-to-all Vensim equations into N identical per-element equations[/-][+]mdl: one apply-to-all equation imports as N per-element equations[/+]bpowers commentedon Oct 12, 2026
Closing: already fixed on main.
The importer collapses slots from one source equation back into
Equation::ApplyToAllviaslots_are_one_apply_to_all(src/simlin-engine/src/mdl/convert/variables.rs:376, gate at :794). Pinned in src/simlin-engine/src/mdl/convert/apply_to_all_tests.rs (an_ordinary_apply_to_all_equation_stays_one_equationat :121, plus rows for each case that must stay arrayed).