aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-09-17 16:44:51 -0500
committerFrederick Muriuki Muriithi2024-09-17 16:44:51 -0500
commite039cb0b69d1645efe396361a719e2e08c3cc050 (patch)
treefb9dce2cc1b8ee6a809b4addfedc411702951ef8
parenta7f158de3cafddcca9c788829a263eb444fa7b59 (diff)
downloadgn-uploader-e039cb0b69d1645efe396361a719e2e08c3cc050.tar.gz
Enable spefifying of start point for enumerator.
-rw-r--r--uploader/datautils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/uploader/datautils.py b/uploader/datautils.py
index 2c2a3dc..e593937 100644
--- a/uploader/datautils.py
+++ b/uploader/datautils.py
@@ -3,10 +3,10 @@ import math
from typing import Sequence
from functools import reduce
-def enumerate_sequence(seq: Sequence[dict]) -> Sequence[dict]:
+def enumerate_sequence(seq: Sequence[dict], start:int = 1) -> Sequence[dict]:
"""Enumerate sequence beginning at 1"""
return tuple({**item, "sequence_number": seqno}
- for seqno, item in enumerate(seq, start=1))
+ for seqno, item in enumerate(seq, start=start))
def order_by_family(items: tuple[dict, ...],