Required
a| Type: | npt.NDArray |
| Description: | Array to inspect. |
def consecutive(a: npt.NDArray) -> list[npt.NDArray]: ...| Type: | npt.NDArray |
| Description: | Array to inspect. |
list[npt.NDArray]def copy_and_modify(
a: typing.Sequence[T], indices: list[tuple[int, T]] | tuple[int, T]
) -> typing.Sequence[T]: ...| Type: | typing.Sequence[T] |
| Description: | The sequence to copy. |
| Type: | list[tuple[int, T]] | tuple[int, T] |
| Description: | A collection of (index, value) of entries to replace. |
typing.Sequence[T]def fill_index_space(
a: npt.NDArray, direction: str = "forwards"
) -> npt.NDArray: ...| Type: | npt.NDArray |
| Description: | The index set to fill. |
| Type: | str |
| Default value: | 'forwards' |
| Description: | Whether to fill forwards or backwards. |
npt.NDArraya to values in snap_to.a to the values in
snap_to. Attempts are made to precondition the index space to ensure
there is no overlap and that multiple values of snap_to are not
associated with the same index of a.def fix_spacing(a: npt.NDArray, snap_to: npt.NDArray) -> npt.NDArray: ...| Type: | npt.NDArray |
| Description: | The array of values to modify. |
| Type: | npt.NDArray |
| Description: | The values to snap to. |
npt.NDArraydef flatten(i: tuple | list) -> typing.Generator[typing.Any, None, None]: ...| Type: | tuple | list |
| Description: | The list of lists to flatten. |
typing.Generator[typing.Any, None, None]def group_by(
a: npt.NDArray, pred_col: int = 0, target_col: int = -1
) -> list[npt.NDArray]: ...| Type: | npt.NDArray |
| Description: | The array to group. |
| Type: | int |
| Default value: | 0 |
| Description: | The predicate column. Defaults to 0. |
| Type: | int |
| Default value: | -1 |
| Description: | The target column group. Defaults to -1. |
list[npt.NDArray]def interp1d_linear(
x: ArrayLike, y: ArrayLike, p: ArrayLike
) -> npt.NDArray: ...| Type: | ArrayLike |
| Description: | x values of the function. |
| Type: | ArrayLike |
| Description: | y values of the function. |
| Type: | ArrayLike |
| Description: | Points to interpolate at. |
npt.NDArraystart and
stop. Useful when you want to have a more-or-less lin-spaced array, but
it's more important to hit specific values rather than achieving a fixed
step size.def linspace_intervals(
start: float, stop: float, min_num: int, interval_bounds: npt.NDArray
) -> npt.NDArray: ...| Type: | float |
| Description: | The start value of the interval. |
| Type: | float |
| Description: | The end value of the interval. |
| Type: | int |
| Description: | The minimum number of samples that should span the interval. Needs to be at least 2. |
| Type: | npt.NDArray |
| Description: | The values between (start, stop) to hit. |
npt.NDArraydef linspace_intervals_equidistant(a: npt.NDArray, n: int) -> npt.NDArray: ...| Type: | npt.NDArray |
| Description: | The array to insert entries into. |
| Type: | int |
| Description: | The number of entries to insert between each value. |
npt.NDArraya to values in snap_to.snap_to while ensuring that the distance bounds are respected.
Additional checks are performed to attempt to distribute the entries of
snap_to to neighboring entries of a if it is determined that multiple
values are competing for the same entry of a.def optimize_spacing(
a: npt.NDArray,
snap_to: npt.NDArray,
distance_bounds: tuple[float, float] = (0.95, 1.05),
) -> npt.NDArray: ...| Type: | npt.NDArray |
| Description: | The array of values to modify. |
| Type: | npt.NDArray |
| Description: | The values to snap to. |
| Type: | tuple[float, float] |
| Default value: | (0.95, 1.05) |
| Description: | A tuple of the minimum and maximum values of allowed for the relative distance between the computed points, as a percentage of their distance upon input. |
npt.NDArraydef promote(a: npt.NDArray) -> tuple[npt.NDArray, ...]: ...| Type: | npt.NDArray |
| Description: | The arrays to promote. |
tuple[npt.NDArray, ...]