GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Peilonrayz/graphtimer: Small module to simplify the creation of graphs for timings.

BranchesTags
Open more actions menu

Latest commit

 

History

22 Commits
22 Commits

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
docssrc/source
docssrc/source
 
 
src/graphtimer
src/graphtimer
 
 
tests
tests
 
 
.coveragerc
.coveragerc
 
 
.gitignore
.gitignore
 
 
.isort.cfg
.isort.cfg
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.rst
README.rst
 
 
noxfile-lint.py
noxfile-lint.py
 
 
noxfile.py
noxfile.py
 
 
setup.cfg
setup.cfg
 
 
setup.py
setup.py
 
 

Repository files navigation

GraphTimer

Build Status

About

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

Installation

$ python -m pip install graphtimer

Usage

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 Q<sub>3</sub>.
  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()

Documentation

Documentation is available via GitHub.

Testing

To run all tests run nox. No venv is needed; nox makes all of them for us.

$ python -m pip install --user nox
$ git clone https://peilonrayz.github.io/graphtimer/
$ cd graphtimer
graphtimer $ nox

License

GraphTimer is available under the MIT license.

About

Small module to simplify the creation of graphs for timings.

Resources

Readme
MIT license
Activity

Stars

4 stars

Watchers

1 watching

Forks

2 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.