Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement find as an iterator in SBT to provide library users more options #2665

Open
wants to merge 7 commits into
base: latest
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ authors = [
{ name="Marisa Lim", orcid="0000-0003-2097-8818" },
{ name="Ricky Lim", orcid="0000-0003-1313-7076" },
{ name="Bradley Nelson", orcid="0009-0001-1553-932X" },
{ name="R. Todd Morse", orcid="0009-0007-1711-5938" },
{ name="Ivan Ogasawara", orcid="0000-0001-5049-4289" },
{ name="Taylor Reiter", orcid="0000-0002-7388-421X" },
{ name="Camille Scott", orcid="0000-0001-8822-8779" },
Expand Down
11 changes: 8 additions & 3 deletions src/core/src/index/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@
type Item: Comparable<Self::Item>;
//type SignatureIterator: Iterator<Item = Self::Item>;

fn find<F>(&self, search_fn: F, sig: &Self::Item, threshold: f64) -> Result<Vec<&Self::Item>>
fn find<F>(

Check warning on line 131 in src/core/src/index/mod.rs

View check run for this annotation

Codecov / codecov/patch

src/core/src/index/mod.rs#L131

Added line #L131 was not covered by tests
&'a self,
search_fn: F,
sig: &'a Self::Item,
threshold: f64,
) -> Result<Vec<&Self::Item>>
where
F: Fn(&dyn Comparable<Self::Item>, &Self::Item, f64) -> bool,
{
Expand All @@ -146,8 +151,8 @@
}

fn search(
&self,
sig: &Self::Item,
&'a self,
sig: &'a Self::Item,
threshold: f64,
containment: bool,
) -> Result<Vec<&Self::Item>> {
Expand Down
Loading