Prevent shortened label collisions in generated links - #32
sylvesterkaczmarek wants to merge 1 commit into
Conversation
|
Thanks for the contribution! On the other hand it also does not really hurt to include the change since it has no negative consequences. @gh0st42 needs to decide on that. |
9c0ac60 to
cb3c7ae
Compare
|
Thanks @axodentally. I agree this is a defensive edge case rather than something present in the current reference scenarios. I have kept the change narrowly scoped and rebased it onto current main; it is now 0 behind and mergeable. Happy to leave the merge decision to @gh0st42. |
Fixes #31.
Distinct labels can collapse to the same interface/network name after label shortening (
highandhiboth becomehi). Incsv_to_compose.pythat reuses the same MultiDiGraph edge key and silently drops one link.Detect shortened-label collisions per node pair and fall back to the original label only for those collisions. Non-colliding generated names keep the existing shortening behavior.
Validation:
main: twoa -> blinks labelledhighandhigenerated one edgea_b_highanda_b_hipytest tests/test_csv_label_collisions.py -q— 2 passedgit diff --checkpasses