Skip to content

Commit

Permalink
EXP: change sig_from_record to use scaled from Record to downsample
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Nov 11, 2024
1 parent e75f306 commit 94acff3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/core/src/collection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/src/selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down

0 comments on commit 94acff3

Please sign in to comment.