Skip to content

Commit 2f11fe9

Browse files
skearnesclaude
andcommitted
Clarify that similarity ranking is scoped to one component side
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b2b31d3 commit 2f11fe9

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

ord_interface/api/queries.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,13 @@ def query_and_parameters(self) -> tuple[str, list]:
369369
def similarity_score_query(self) -> tuple[LiteralString, list]:
370370
"""Returns a query ranking reactions by similarity, plus its leading parameter.
371371
372-
Each reaction is scored by the greatest Tanimoto similarity of its target
373-
components to the query pattern, and the results are ordered by that score,
374-
descending. The caller supplies the candidate reaction IDs (and any LIMIT) as
375-
the remaining parameters; scoring runs over that already-filtered set, so the
376-
per-row ``tanimoto_sml()`` calls are cheap.
372+
Each reaction is scored by the greatest Tanimoto similarity to the query
373+
pattern among its components on the searched side -- reactants or products,
374+
matching this predicate's target -- and the results are ordered by that score,
375+
descending. The two sides are never combined. The caller supplies the
376+
candidate reaction IDs (and any LIMIT) as the remaining parameters; scoring
377+
runs over that already-filtered set, so the per-row ``tanimoto_sml()`` calls
378+
are cheap.
377379
378380
Raises:
379381
ValueError: If this is not a similarity query.

0 commit comments

Comments
 (0)