Skip to content

Commit

Permalink
Update docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
reidjohnson committed Sep 6, 2024
1 parent da64698 commit 0ff3683
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
4 changes: 2 additions & 2 deletions quantile_forest/_quantile_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,10 @@ def _get_y_train_leaves_slice(
Subsample leaf nodes. If True, leaves are randomly sampled to size
`max_samples_leaf`.
max_node_count: int
max_node_count : int
Maximum number of leaf nodes across all trees.
max_samples_leaf: int
max_samples_leaf : int
Maximum number of samples per leaf node.
random_state : int, RandomState instance
Expand Down
4 changes: 2 additions & 2 deletions quantile_forest/_quantile_forest_fast.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,8 @@ cdef class QuantileForest:
Returns
-------
proximities : list of dicts
Dicts mapping sample indices to proximity counts.
proximities : list of dicts, length = n_samples
List of dicts mapping training sample indices to proximity counts.
"""
cdef intp_t n_samples
cdef intp_t n_trees, n_train, max_idx
Expand Down
19 changes: 18 additions & 1 deletion quantile_forest/_utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,24 @@ cdef inline void parallel_qsort_asc(
int left,
int right,
) noexcept nogil:
"""Sort lists `a` and `b` in ascending order by `a`."""
"""Sort two lists `a` and `b` in parallel in ascending order by `a`.
The sorting is performed in-place on `a`, and the elements of `b` are
rearranged to maintain the same index correspondence with `a`.
The sorting is performed using quicksort.
Parameters
----------
a : list of floats
Primary list to be sorted in ascending order.
b : list of floats
Secondary list, whose elements are rearranged in parallel with `a`.
left : int
Starting index of the current subarray to sort.
right : int
Ending index of the current subarray to sort.
"""
cdef int i, j
cdef double pivot

Expand Down

0 comments on commit 0ff3683

Please sign in to comment.