Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/directsketch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,6 @@ pub fn zipwriter_handle(

// if batch size is non-zero and is reached, close the current zip
if batch_size > 0 && acc_count >= batch_size {
eprintln!("writing batch {}", batch_index);
if let Some(mut zip_writer) = zip_writer.take() {
if let Err(e) = zip_manifest
.async_write_manifest_to_zip(&mut zip_writer)
Expand All @@ -769,6 +768,7 @@ pub fn zipwriter_handle(
return;
}
}
eprintln!("finished batch {}", batch_index);
// Start a new batch
batch_index += 1;
acc_count = 0;
Expand Down
13 changes: 11 additions & 2 deletions src/python/sourmash_plugin_directsketch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ def main(self, args):
if status == 0:
notify("...gbsketch is done!")
if args.output is not None:
notify(f"Sigs in '{args.output}'.")
if args.batch_size:
batch_base = args.output.split('.zip')[0]
notify(f"Sigs in '{batch_base}.1.zip', etc")
else:
notify(f"Sigs in '{args.output}'.")
if args.keep_fasta:
notify(f"FASTAs in '{args.fastas}'.")

Expand Down Expand Up @@ -193,7 +197,12 @@ def main(self, args):
if status == 0:
notify("...gbsketch is done!")
if args.output is not None:
notify(f"Sigs in '{args.output}'.")
if args.batch_size:
batch_base = args.output.split('.zip')[0]
notify(f"Sigs in '{batch_base}.1.zip', etc")
else:
notify(f"Sigs in '{args.output}'.")

if args.keep_fasta:
notify(f"FASTAs in '{args.fastas}'.")

Expand Down
8 changes: 8 additions & 0 deletions tests/test_gbsketch.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,14 @@ def test_gbsketch_simple_batched_multiple(runtmp, capfd):
captured = capfd.readouterr()
print(captured.err)

assert "finished batch 1" in captured.err
assert "finished batch 2" in captured.err
print(captured.out)
print(runtmp.last_result.err)
batch_base = output.split('.zip')[0]
print(batch_base)
assert f"Sigs in '{batch_base}.1.zip', etc" in runtmp.last_result.err

expected_siginfo = {
(ss1.name, ss1.md5sum(), ss1.minhash.moltype),
(ss2.name, ss2.md5sum(), ss2.minhash.moltype),
Expand Down
8 changes: 8 additions & 0 deletions tests/test_urlsketch.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,14 @@ def test_urlsketch_simple_batched(runtmp, capfd):
assert not os.path.exists(output) # for now, orig output file should be empty.
captured = capfd.readouterr()
print(captured.err)
assert "finished batch 1" in captured.err
assert "finished batch 2" in captured.err
assert "finished batch 3" in captured.err
print(captured.out)
print(runtmp.last_result.err)
batch_base = output.split('.zip')[0]
print(batch_base)
assert f"Sigs in '{batch_base}.1.zip', etc" in runtmp.last_result.err

expected_siginfo = {
(ss1.name, ss1.md5sum(), ss1.minhash.moltype),
Expand Down
Loading