Skip to content

Commit

Permalink
docs: fix docstring and type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
skhrg committed May 9, 2024
1 parent 5afb75f commit 3c7d047
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions megham/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,21 @@ def estimate_var(
return var


def estimate_spacing(coords: NDArray[np.floating]):
def estimate_spacing(coords: NDArray[np.floating]) -> float:
"""
Estimate the spacing between points in a point cloud.
This is just the median distance between nearest neighbors.
Parameters
----------
coords: NDArray[np.floating]
coords : NDArray[np.floating]
The point cloud to estimate spacing of.
Should have shape (npoint, ndim).
Returns
-------
spacing : float
The spacing between points.
"""
edm = make_edm(coords)
edm[edm == 0] = np.nan
Expand Down

0 comments on commit 3c7d047

Please sign in to comment.