From 94acff369d9b467e351b24281b941e065d06a1ff Mon Sep 17 00:00:00 2001 From: "C. Titus Brown" Date: Mon, 11 Nov 2024 12:16:27 -0800 Subject: [PATCH] EXP: change `sig_from_record` to use scaled from `Record` to downsample --- src/core/src/collection.rs | 7 +++---- src/core/src/selection.rs | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/src/collection.rs b/src/core/src/collection.rs index 28659df05f..c97b27324f 100644 --- a/src/core/src/collection.rs +++ b/src/core/src/collection.rs @@ -409,8 +409,8 @@ mod test { // no sigs should remain assert_eq!(cl.len(), 6); for (_idx, rec) in cl.iter() { - // need to pass select again here so we actually downsample - let this_sig = cl.sig_from_record(rec).unwrap().select(&selection).unwrap(); + eprintln!("record scaled is: {}", rec.scaled()); + let this_sig = cl.sig_from_record(rec).unwrap(); let this_mh = this_sig.minhash().unwrap(); assert_eq!(this_mh.scaled(), 2000); } @@ -450,8 +450,7 @@ mod test { // count collection length assert_eq!(cl.len(), 2); for (idx, _rec) in cl.iter() { - // need to pass select again here so we actually downsample - let this_sig = cl.sig_for_dataset(idx).unwrap().select(&selection).unwrap(); + let this_sig = cl.sig_for_dataset(idx).unwrap(); let this_mh = this_sig.minhash().unwrap(); assert_eq!(this_mh.scaled(), 100); } diff --git a/src/core/src/selection.rs b/src/core/src/selection.rs index 3c94c7f0c7..59f83c1146 100644 --- a/src/core/src/selection.rs +++ b/src/core/src/selection.rs @@ -125,7 +125,7 @@ impl Selection { abund: Some(row.with_abundance()), moltype: Some(row.moltype()), num: None, - scaled: None, + scaled: Some(*row.scaled()), containment: None, picklist: None, })