@@ -94,8 +94,7 @@ def load_parquet_shard(parquet_path):
9494
9595 if SMILES_COLUMN not in ds .column_names :
9696 raise RuntimeError (
97- f"Column { SMILES_COLUMN !r} not found in { parquet_path } . "
98- f"Available columns: { ds .column_names } "
97+ f"Column { SMILES_COLUMN !r} not found in { parquet_path } . Available columns: { ds .column_names } "
9998 )
10099
101100 return ds
@@ -133,15 +132,10 @@ def sample_zinc22_from_random_parquet_batches(parquet_files, seed):
133132 )
134133
135134 for batch_start in range (0 , len (shuffled_parquets ), PARQUET_BATCH_SIZE ):
136- batch = shuffled_parquets [
137- batch_start : batch_start + PARQUET_BATCH_SIZE
138- ]
135+ batch = shuffled_parquets [batch_start : batch_start + PARQUET_BATCH_SIZE ]
139136 parquet_batches_read += 1
140137
141- print (
142- f"Seed { seed } : reading parquet batch { parquet_batches_read } "
143- f"with { len (batch )} shard(s)"
144- )
138+ print (f"Seed { seed } : reading parquet batch { parquet_batches_read } with { len (batch )} shard(s)" )
145139
146140 for parquet_path in batch :
147141 if len (pool ) >= target_pool_size :
@@ -276,10 +270,7 @@ def opsin_batch_with_fallback(names):
276270 converted = [converted ]
277271
278272 if len (converted ) != len (name_chunk ):
279- raise ValueError (
280- f"OPSIN returned { len (converted )} results for "
281- f"{ len (name_chunk )} names"
282- )
273+ raise ValueError (f"OPSIN returned { len (converted )} results for { len (name_chunk )} names" )
283274
284275 except Exception :
285276 converted = [opsin_one (name ) for name in name_chunk ]
@@ -511,6 +502,7 @@ def main():
511502 print (f"Total failures: { len (all_failures ):,} " )
512503 print (f"Wrote results to: { OUT_DIR .resolve ()} " )
513504
505+
514506if __name__ == "__main__" :
515507 mp .freeze_support ()
516508 main ()
0 commit comments