Thomas Eapen · Selected work
Preserving the sequence of a handover
Order the events and remove consecutive duplicates while keeping return visits visible.
Synthetic example · independently invented dataOne-page print edition · A3 landscape
8invented event records
5states after compression
4participant changes
2P1 → support visits
SYNTHETIC INPUT / ONE INTERACTION
Repeated does not mean redundant
| Step | From | To | Illustrative category |
|---|---|---|---|
| 1 | P1 | P2 | P1 → support |
| 2 | P2 | P1 | Return to P1 |
| 3 | P1 | P3 | P1 → support |
| 4 | P3 | P1 | Return to P1 |
THE METHOD / PYTHON
Keep returns in their original order
from itertools import groupby
def transition_summary(events, origin, support):
ordered = sorted(events, key=lambda row: row['sequence'])
if len({r['sequence'] for r in ordered}) != len(ordered):
raise ValueError('Each event needs a unique sequence.')
people = [row['participant'] for row in ordered]
chain = [person for person, _ in groupby(people)]
handovers = list(zip(chain, chain[1:]))
visits = [(a, b) for a, b in handovers
if a == origin and b in support]
return {'ordered': people, 'chain': chain,
'handovers': handovers, 'support_visits': visits}Selected code from the new demonstration that computes these results.
Here P2 and P3 are invented support participants. A handover is an adjacent participant change in this demonstration; the code makes no claim about historical business classifications.
Why consecutive duplicates matter Removing every repeated participant would collapse this sequence to P1 → P2 → P3 and lose both return visits. The ordered path is what makes the two P1-to-support moves visible.