Skip to content

Commit

Permalink
Move waiting to just before writing
Browse files Browse the repository at this point in the history
  • Loading branch information
Will-Tyler committed Oct 30, 2024
1 parent 99debd3 commit c522666
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions vcztools/vcf_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,6 @@ def c_chunk_to_vcf(
vcf_name = name[len("variant_") :]
info_fields[vcf_name] = get_vchunk_array(zarray, v_chunk, v_mask_chunk)

if preceding_future:
concurrent.futures.wait((preceding_future,))

ref = alleles[:, 0].astype("S")
alt = alleles[:, 1:].astype("S")

Expand Down Expand Up @@ -415,6 +412,10 @@ def c_chunk_to_vcf(
if len(zarray.shape) == 2:
zarray = zarray.reshape((num_variants, num_samples, 1))
encoder.add_format_field(name, zarray)

if preceding_future:
concurrent.futures.wait((preceding_future,))

# TODO: (1) make a guess at this based on number of fields and samples,
# and (2) log a DEBUG message when we have to double.
buflen = 1024
Expand Down

0 comments on commit c522666

Please sign in to comment.