Skip to content

Commit ea2e591

Browse files
Will-Tylerjeromekelleher
authored andcommitted
Move waiting to just before writing
1 parent 363b655 commit ea2e591

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

vcztools/vcf_writer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,6 @@ def c_chunk_to_vcf(
362362
vcf_name = name[len("variant_") :]
363363
info_fields[vcf_name] = get_vchunk_array(zarray, v_chunk, v_mask_chunk)
364364

365-
if preceding_future:
366-
concurrent.futures.wait((preceding_future,))
367-
368365
ref = alleles[:, 0].astype("S")
369366
alt = alleles[:, 1:].astype("S")
370367

@@ -414,6 +411,10 @@ def c_chunk_to_vcf(
414411
if len(zarray.shape) == 2:
415412
zarray = zarray.reshape((num_variants, num_samples, 1))
416413
encoder.add_format_field(name, zarray)
414+
415+
if preceding_future:
416+
concurrent.futures.wait((preceding_future,))
417+
417418
# TODO: (1) make a guess at this based on number of fields and samples,
418419
# and (2) log a DEBUG message when we have to double.
419420
buflen = 1024

0 commit comments

Comments
 (0)