diff options
author | Frederick Muriuki Muriithi | 2024-09-17 16:44:51 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-09-17 16:44:51 -0500 |
commit | e039cb0b69d1645efe396361a719e2e08c3cc050 (patch) | |
tree | fb9dce2cc1b8ee6a809b4addfedc411702951ef8 /uploader/datautils.py | |
parent | a7f158de3cafddcca9c788829a263eb444fa7b59 (diff) | |
download | gn-uploader-e039cb0b69d1645efe396361a719e2e08c3cc050.tar.gz |
Enable spefifying of start point for enumerator.
Diffstat (limited to 'uploader/datautils.py')
-rw-r--r-- | uploader/datautils.py | 4 |
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, ...], |