A python library to measure algorithms execution time and compare with its theoretical complexity
Project description
Almetro Library
version number: 0.0.1 author: Arnour Sabino
Overview
A python library to measure algorithms execution time and compare with its theoretical complexity.
Installation / Usage
To install use pip:
$ pip install almetro
Or clone the repo:
$ git clone https://github.com/arnour/almetro.git
$ python setup.py install
Examples
Applying Almetro to a quadratic algorithm:
import almetro
from almetro.algorithms import loop_n_quadratic
from almetro.complexity import cn_quadratic
from almetro.instance import growing
metro = almetro\
.new()\
.with_execution(trials=5)\
.with_instances(instances=20, provider=growing(initial_size=100, growth_size=100))\
.metro(algorithm=loop_n_quadratic, complexity=cn_quadratic)
chart = metro.chart()
chart.show()
Applying Almetro to a lg n algorithm:
import almetro
from almetro.algorithms import loop_n_log
from almetro.complexity import clog_n
from almetro.instance import growing
metro = almetro\
.new()\
.with_execution(trials=100)\
.with_instances(instances=20, provider=growing(initial_size=10000, growth_size=10000))\
.metro(algorithm=loop_n_log, complexity=clog_n)
chart = metro.chart()
chart.show()
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
almetro-1.0.6.tar.gz
(10.0 kB
view hashes)
Built Distribution
almetro-1.0.6-py3-none-any.whl
(11.1 kB
view hashes)