Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
NOCSurfaceProcesses
GeoSpatialTools
Commits
c2e58af0
Commit
c2e58af0
authored
6 months ago
by
Joseph Siddons
Browse files
Options
Download
Email Patches
Plain Diff
docs: correct documentation re: sorted-ness error from bisect.
parent
7ed4c7be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
GeoSpatialTools/neighbours.py
GeoSpatialTools/neighbours.py
+6
-5
No files found.
GeoSpatialTools/neighbours.py
View file @
c2e58af0
"""Functions for finding nearest neighbours using bisection."""
from
numpy
import
argmin
from
bisect
import
bisect
from
typing
import
TypeVar
...
...
@@ -26,18 +28,17 @@ def find_nearest(vals: list[Numeric], test: list[Numeric]) -> list[int]:
Uses bisection for speediness!
Argument
s
=========
Parameter
s
----------
vals : list[Numeric]
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
checked, nor is the list sorted. An error will be raised if the list
is not sorted.
checked, nor is the list sorted.
test : list[Numeric]
List of query values
Returns
=======
-------
A list containing the index of the nearest neighbour in vals for each value
in test.
"""
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment