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
pysimlin: Run.loops shares for arrayed loops do not sum to 1 #672
For an arrayed loop, pysimlin's Run.loops fills behavior_time_series from Sim.get_relative_loop_score(id) with no element.
That call returns, at each step, the element value with the largest magnitude, and the chosen element differs from loop to loop.
The per-loop series therefore no longer add up to 1 within a partition, so a "share of total activity" reading is wrong, and Run.dominant_periods is built on these series.
Example
C-LEARN with 9 pinned arrayed loops: the default relative scores summed to 1.27-1.55 at a timestep instead of 1.0.
Asking per element (get_relative_loop_score(id, element="deterministic")) gave shares that summed correctly.
Why it matters
Arrayed loops are common in real models (C-LEARN, regional models).
Any user who reads Run.loops or dominant_periods on such a model gets shares that look valid but are not, with no error.
Fix
Have Run.loops return one Loop per element of an arrayed loop, each tagged with its element and carrying that element's relative score series.
Then shares add up to 1 per element, and dominant periods can group by each element's own partition, which also removes the "first element's partition" caveat in the dominant_periods docstring.
Alternative: keep one Loop per arrayed loop but add the per-element series alongside the aggregate, and say clearly in the docs that the aggregate is not a share.
changed the title [-]ltm: arrayed pinned loops' no-element default aggregate breaks share-based analysis (Run.loops behavior_time_series)[/-][+]pysimlin: Run.loops shares for arrayed loops do not sum to 1[/+]on Oct 12, 2026
Activity
notebooks: rebuild the C-LEARN LTM experience notebook from scratch
[-]ltm: arrayed pinned loops' no-element default aggregate breaks share-based analysis (Run.loops behavior_time_series)[/-][+]pysimlin: Run.loops shares for arrayed loops do not sum to 1[/+]