From 4c4a9a5a7b973b30c2bbfa03a99e50f28cccc666 Mon Sep 17 00:00:00 2001 From: "N. Tessa Pierce-Ward" Date: Fri, 8 Sep 2023 15:29:01 -0700 Subject: [PATCH] init multigather changes --- src/fastmultigather.rs | 26 +++----------------------- src/python/tests/test_multigather.py | 4 ++-- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/src/fastmultigather.rs b/src/fastmultigather.rs index 1338899d..4c529b63 100644 --- a/src/fastmultigather.rs +++ b/src/fastmultigather.rs @@ -14,7 +14,7 @@ use std::sync::atomic::AtomicUsize; use std::collections::BinaryHeap; use crate::utils::{prepare_query, write_prefetch, PrefetchResult, - load_sketchlist_filenames, load_sketches, consume_query_by_gather}; + consume_query_by_gather, load_sigpaths_from_zip_or_pathlist, load_sketches_from_zip_or_pathlist, ReportType}; pub fn fastmultigather + std::fmt::Debug + Clone>( query_filenames: P, @@ -32,14 +32,9 @@ pub fn fastmultigather + std::fmt::Debug + Clone>( let template = Sketch::MinHash(template_mh); // load the list of query paths - let querylist_paths = load_sketchlist_filenames(&query_filenames)?; + let (querylist_paths, temp_dir) = load_sigpaths_from_zip_or_pathlist(&query_filenames)?; println!("Loaded {} sig paths in querylist", querylist_paths.len()); - // build the list of paths to match against. - println!("Loading matchlist"); - let matchlist_paths = load_sketchlist_filenames(&matchlist_filename)?; - println!("Loaded {} sig paths in matchlist", matchlist_paths.len()); - let threshold_hashes : u64 = { let x = threshold_bp / scaled; if x > 0 { @@ -52,22 +47,7 @@ pub fn fastmultigather + std::fmt::Debug + Clone>( println!("threshold overlap: {} {}", threshold_hashes, threshold_bp); // Load all the against sketches - let result = load_sketches(matchlist_paths, &template)?; - let (sketchlist, skipped_paths, failed_paths) = result; - - eprintln!("Loaded {} sketches to search against.", sketchlist.len()); - if failed_paths > 0 { - eprintln!("WARNING: {} search paths failed to load. See error messages above.", - failed_paths); - } - if skipped_paths > 0 { - eprintln!("WARNING: skipped {} search paths - no compatible signatures.", - skipped_paths); - } - - if sketchlist.is_empty() { - bail!("No sketches loaded to search against!?") - } + let sketchlist = load_sketches_from_zip_or_pathlist(&matchlist_filename, &template, ReportType::Against)?; // Iterate over all queries => do prefetch and gather! let processed_queries = AtomicUsize::new(0); diff --git a/src/python/tests/test_multigather.py b/src/python/tests/test_multigather.py index b041b594..a3a12776 100644 --- a/src/python/tests/test_multigather.py +++ b/src/python/tests/test_multigather.py @@ -263,8 +263,8 @@ def test_empty_against(runtmp, capfd): captured = capfd.readouterr() print(captured.err) - assert "Loaded 0 sketches to search against." in captured.err - assert "Error: No sketches loaded to search against!?" in captured.err + assert "Loaded 0 search signature(s)" in captured.err + assert "Error: No search signatures loaded, exiting." in captured.err def test_nomatch_in_against(runtmp, capfd):