Skip to main content

graphtimer

This library is based around generating nice graphs for timings. It's highly modular and provides an interface to quickly and cleanly use modules.

The high-level interface is the Plotter class which takes a timer class as its only argument. The builtin timer is MultiTimer, where TimerNamespace builds it without you having to.

From here you have three steps:

  1. Time the code by using the timer provided. Usual usage is repeat, as timeit only times the functions once and skips step 2.
  2. Perform the statistical analysis on the timings. Most of the time you'll want to use min, which gets the lowest value that isn't an outlier. And shows the error bars from the lowest outlier to Q3.
  3. Plot the data on the graph. This by default uses matplotlib via the MatPlotLib class.
import matplotlib.pyplot as plt
from graphtimer import Plotter, TimerNamespace


class ManualListCreation(TimerNamespace):
    def test_comprehension(iterable):
        return [i for i in iterable]

    def test_append(iterable):
        a = []
        append = a.append
        for i in iterable:
            append(i)
        return a


fig, axs = plt.subplots()
(
    Plotter(ManualListCreation)
        .repeat(100, 5, list(range(0, 10001, 1000)), args_conv=range)
        .min()
        .plot(axs)
)
fig.show()

Installation

To install graphtimer, just use pip:

$ pip install graphtimer

Metadata

Release files for graphtimer 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graphtimer 0.0.4
File Size Uploaded Provenance
graphtimer-0.0.4.tar.gz 5.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for graphtimer 0.0.4
File Interpreter ABI Platform
graphtimer-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 13.0 kB

Release files / graphtimer-0.0.4.tar.gz

Download URL graphtimer-0.0.4.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1aa9d7c9f00c7043c3bdf78e24f21d591c66efa4f22d6768b8f52fe9a00afad3
BLAKE2b-256 checksum
How to use checksums
d0ed9f8a2b72aae9463830039d4dbe54e1fcdb391e284e53ece6b4d0877cb490
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

Release files / graphtimer-0.0.4-py3-none-any.whl

Download URL graphtimer-0.0.4-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c1cfe6b53e1d245f9e2ce170db771c50a186dfb5294e97087650b7dc998d437
BLAKE2b-256 checksum
How to use checksums
74ea114d791ed599de59935671a09177ff6b6daaad4c86906b8e28a8010b46d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

Security for graphtimer 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page