Skip to main content

Compute and plot timing scalings for functions with numpy array inputs

Project description

xyzt: compute and plot time cost scaling for functions with numpy array input

I often implement functions on atom positions in terms of Nx3 numpy arrays, and need to compare speed of different implementations. This small library is a thin wrapper over timeit for that purpose.

xyzt.timethem(functions_to_check, nmin=10, nmax=1e5, number=1e5) -> (n, times)
xyzt.plot(n, times, labels=None)
for fi in functions:
    for n in valid_range:
        generate random n-dimensional input vector
        timeit fi(v_rand)

example: scipy.spatial.distance.cdist+min versus scipy.spatial.cKDTree

Project details


Download files

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

Source Distribution

xyzt-0.0.1.tar.gz (2.5 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