DylSort module

DylSort.mergeSort(arr: list, comp: DylComp.Comparator, statParams: list = None, n: int = 2, combGroups: bool = True, sortGroups: bool = False) → list[source]

Sorts the array with the given comparator.

statParams must be the format ((D0, D1), dist, target AUC) combGroups determins if the returned array is one list or each group as its own list. sortGroups determins if groups will be sorted by size in the sort. yields the arr after each pass through also yields the stats if given statParams

DylSort.treeMergeSort(arr: list, comp, statParams=None, n: int = 2, combGroups: bool = True)[source]

Sorts an array with the provided comparator.

statParams must be the format ((D0, D1), dist, target AUC) if it is provided. If n is provided, does at most nAFC type comparisons (ex if n=4, may do most 4AFC, maybe some 3AFC, rest 2AFC) combGroups determins if the returned array is one list or each group as its own list. Yields the current layer and the statistics if statParams is not None.

DylSort.validate(arr: list)[source]

Throws errors if the array to be validated is invalid.

Invalid is if there is a -1 in the array or if there are duplicates.