Skip to content

Commit 5c2d457

Browse files
sfluegel05Copilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent ef19276 commit 5c2d457

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

chebi_utils/sample_filters.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ def get_closest_negatives(
1414
1515
Performs a breadth-first walk outward from ``target_id`` over the undirected
1616
``is_a`` hierarchy, collecting samples that are subclasses of the visited
17-
neighbours (but not of ``target_id`` itself). The walk aims to reach
18-
``min_samples``, then keeps collecting further-out (non-sibling) samples only
19-
until ``max_samples`` is reached.
17+
neighbours (but not of ``target_id`` itself). The walk expands outward until
18+
it reaches ``min_samples``. If ``min_samples`` is reached while still
19+
processing the immediate neighbours of ``target_id``, that neighbour layer is
20+
completed; otherwise expansion stops as soon as ``min_samples`` is reached.
21+
If ``max_samples`` is set, selection stops once it is reached.
2022
2123
Parameters
2224
----------

0 commit comments

Comments
 (0)