From e039cb0b69d1645efe396361a719e2e08c3cc050 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 17 Sep 2024 16:44:51 -0500 Subject: Enable spefifying of start point for enumerator. --- uploader/datautils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'uploader') 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, ...], -- cgit v1.2.3