diff --git a/extra_data/display.py b/extra_data/display.py index 5660e93d..3cfeb547 100644 --- a/extra_data/display.py +++ b/extra_data/display.py @@ -270,7 +270,7 @@ def add(self, name): if len(diffs_at) != 1 or ((diff_at := diffs_at[0]) % 2 == 0): return False # >1 part changed, or separator part changed - if len(grp) > 2 and (grp[-1][diff_at] == grp[0][diff_at]): + if len(grp) >= 2 and (grp[-1][diff_at] == grp[0][diff_at]): return False # different part changing from current group self.entries.append(split) diff --git a/extra_data/tests/test_display.py b/extra_data/tests/test_display.py index 671783b6..1bc27558 100644 --- a/extra_data/tests/test_display.py +++ b/extra_data/tests/test_display.py @@ -87,6 +87,12 @@ def test_group_ok(names, exp): "SA1_XTD2_XGM/DOOCS/MAIN:output", "SPB_XTD9_XGM/DOOCS/MAIN:output", ], + [ + # One part changing each time, but different parts + 'SQS_ILH_LAS/PROC/BS_CAM_800_OU1', + 'SQS_ILH_LAS/PROC/BS_CAM_800_OU2', + 'SQS_ILH_LAS/PROC/BS_CAM_TT_OU2', + ], ]) def test_group_fail(names): grp = SourceGroup()