Skip to main content

Timsort sorting algorithm with custom minrun

Project description

CustomTimSort

CustomTimSort is a library where you can sort python objects using custom minruns. How to use:

from customtimsort import timsort, get_minrun

minrun = get_minrun(len(yours_object))
timsort(yours_object, minrun)

get_minrun(array_size: int, path_to_data: string, model_name: string) -> int

Returns predicted minrun for given object's size

:param array_size: size of array we want to predict minrun to :param path_to_data: name of json file with keys mean, std, standard: "data.json" :param model_name: name of model that will predict minrun, standard: "standard_model"

timsort(yours_object: some iterable obj, minrun: int) -> int

Sorts yours_object using given minrun

:param yours_object: something that you want to sort (but you can't use timsort(yours_object=[...])) :param minrun: timsort parameter for sorting (but you can't use timsort(minrun=[...]))

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

customtimsort-1.0.4.tar.gz (60.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page