Commit c2e58af0 authored by Joseph Siddons's avatar Joseph Siddons
Browse files

docs: correct documentation re: sorted-ness error from bisect.

parent 7ed4c7be
"""Functions for finding nearest neighbours using bisection."""
from numpy import argmin from numpy import argmin
from bisect import bisect from bisect import bisect
from typing import TypeVar from typing import TypeVar
...@@ -26,18 +28,17 @@ def find_nearest(vals: list[Numeric], test: list[Numeric]) -> list[int]: ...@@ -26,18 +28,17 @@ def find_nearest(vals: list[Numeric], test: list[Numeric]) -> list[int]:
Uses bisection for speediness! Uses bisection for speediness!
Arguments Parameters
========= ----------
vals : list[Numeric] vals : list[Numeric]
List of values - this is the pool of values for which we are looking List of values - this is the pool of values for which we are looking
for a nearest match. This list MUST be sorted. Sortedness is not for a nearest match. This list MUST be sorted. Sortedness is not
checked, nor is the list sorted. An error will be raised if the list checked, nor is the list sorted.
is not sorted.
test : list[Numeric] test : list[Numeric]
List of query values List of query values
Returns Returns
======= -------
A list containing the index of the nearest neighbour in vals for each value A list containing the index of the nearest neighbour in vals for each value
in test. in test.
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment