pybiolib 1.2.983__py3-none-any.whl → 1.2.998__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -88,20 +88,21 @@ def fasta_batch_records(records, work_per_batch_min, work_per_residue=1, verbose
88
88
  batch = []
89
89
  current_longest_seq_len = 0
90
90
  for record in records:
91
- # Add to batch
92
- batch.append(record)
93
-
94
91
  seq_len = len(record.sequence)
95
- current_longest_seq_len = max(current_longest_seq_len, seq_len)
92
+ potential_longest_seq_len = max(current_longest_seq_len, seq_len)
96
93
 
97
- # Calculate work units based on longest sequence * number of sequences
98
- current_work_units = current_longest_seq_len * work_per_residue * len(batch)
94
+ # Calculate work units if we were to add this record
95
+ potential_work_units = potential_longest_seq_len * work_per_residue * (len(batch) + 1)
99
96
 
100
- # If above limit, start a new batch
101
- if current_work_units >= work_per_batch_min:
97
+ if potential_work_units >= work_per_batch_min and len(batch) > 0:
102
98
  batches.append(batch)
103
99
  batch = []
104
100
  current_longest_seq_len = 0
101
+ potential_longest_seq_len = seq_len
102
+
103
+ # Add to batch
104
+ batch.append(record)
105
+ current_longest_seq_len = potential_longest_seq_len
105
106
 
106
107
  # Append last batch if present
107
108
  if batch:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pybiolib
3
- Version: 1.2.983
3
+ Version: 1.2.998
4
4
  Summary: BioLib Python Client
5
5
  License: MIT
6
6
  Keywords: biolib
@@ -51,7 +51,7 @@ biolib/_internal/types/result.py,sha256=MesSTBXCkaw8HydXgHf1OKGVLzsxhZ1KV5z4w-VI
51
51
  biolib/_internal/types/typing.py,sha256=qrsk8hHcGEbDpU1QQFzHAKnhQxkMe7uJ6pxHeAnfv1Y,414
52
52
  biolib/_internal/types/user.py,sha256=5_hYG0jrdGxynCCWXGaHZCAlVcRKBqMIEA2EBGrnpiE,439
53
53
  biolib/_internal/utils/__init__.py,sha256=p5vsIFyu-zYqBgdSMfwW9NC_jk7rXvvCbV4Bzd3As7c,630
54
- biolib/_internal/utils/multinode.py,sha256=bFj7ucQB0MgGrgtnCbFFcanwdtdBGupJIZB9sFi2Ts8,8244
54
+ biolib/_internal/utils/multinode.py,sha256=N7kR49xD1PdkMVlxxzRiSYHfgi9MG-kLCwemcY1rojg,8323
55
55
  biolib/_runtime/runtime.py,sha256=Z9YVF8e2A1VMdndEf7CIGqvVKHS7FPY0VGmRgLBB7ck,5699
56
56
  biolib/_session/session.py,sha256=US1Y1jfFIAm86-Lq3C7nCXpZXUJXXBVBkND9djMNYxI,1649
57
57
  biolib/api/__init__.py,sha256=mQ4u8FijqyLzjYMezMUUbbBGNB3iFmkNdjXnWPZ7Jlw,138
@@ -146,8 +146,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
146
146
  biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
147
147
  biolib/utils/seq_util.py,sha256=Ozk0blGtPur_D9MwShD02r_mphyQmgZkx-lOHOwnlIM,6730
148
148
  biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
149
- pybiolib-1.2.983.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
150
- pybiolib-1.2.983.dist-info/METADATA,sha256=dHtGcD9XEEKaOlFU18U9VLeynB9gYqsBuSle-Q7jKcg,1570
151
- pybiolib-1.2.983.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
152
- pybiolib-1.2.983.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
153
- pybiolib-1.2.983.dist-info/RECORD,,
149
+ pybiolib-1.2.998.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
150
+ pybiolib-1.2.998.dist-info/METADATA,sha256=bITNV2IriYnSoYw2Spx0HILrTIUWZFxVNXTkafrEOd8,1570
151
+ pybiolib-1.2.998.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
152
+ pybiolib-1.2.998.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
153
+ pybiolib-1.2.998.dist-info/RECORD,,