From d66b467c5c037de659ffa7832fe30f6a5a03c0c1 Mon Sep 17 00:00:00 2001 From: xenofem Date: Tue, 6 Feb 2024 10:22:48 -0500 Subject: [PATCH] stop automatic collation if the sequence of numbers doesn't seem to be indices in an ordering --- dlibrary/dlibrary.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlibrary/dlibrary.py b/dlibrary/dlibrary.py index c4dbfba..ec567ed 100755 --- a/dlibrary/dlibrary.py +++ b/dlibrary/dlibrary.py @@ -212,6 +212,9 @@ def complete_prefix_number_ordering(entries): unified_indices = list(unified_indices) unified_indices.sort() + if len(unified_indices) > 1 and min(unified_indices[i] - unified_indices[i-1] for i in range(1, len(unified_indices))) > 2: + return None + versions = list(numberings_by_version.keys()) versions.sort()