Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from ._arraykit import split_after_count as split_after_count
from ._arraykit import get_new_indexers_and_screen as get_new_indexers_and_screen
from ._arraykit import write_array_to_file as write_array_to_file
from ._arraykit import factorize as factorize
from ._arraykit import count_iteration as count_iteration
from ._arraykit import first_true_1d as first_true_1d
from ._arraykit import first_true_2d as first_true_2d
Expand Down
3 changes: 3 additions & 0 deletions src/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ def write_array_to_file(
fortran_order: bool = False,
buffersize: int = 8192,
) -> None: ...
def factorize(
array: np.ndarray, *, sort: bool = ...
) -> tp.Tuple[np.ndarray, np.ndarray]: ...
def first_true_1d(__array: np.ndarray, *, forward: bool) -> int: ...
def first_true_2d(__array: np.ndarray, *, forward: bool, axis: int) -> np.ndarray: ...
def nonzero_1d(__array: np.ndarray, /) -> np.ndarray: ...
Expand Down
4 changes: 4 additions & 0 deletions src/_arraykit.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ static PyMethodDef arraykit_methods[] = {
(PyCFunction)write_array_to_file,
METH_VARARGS | METH_KEYWORDS,
NULL},
{"factorize",
(PyCFunction)factorize,
METH_VARARGS | METH_KEYWORDS,
NULL},
{NULL},
};

Expand Down
Loading
Loading