Skip to main content

Pen'n'paper

Pen'n'paper is a package to easily collect the data about (noisy) processes and plot them for comparison. This package is not aiming at feature completeness. Instead it should give you an easy start during the phase of the project when you want to just concentrate on an experimental idea.

Installation: pip install pennpaper

By example:

# We have a mysterious function that we would like to better understand on the interval [0.1, 5.].
# Unfortunately the function is noisy.

import numpy as np

X = np.arange(0.1, 5, step=0.01)

import random


def noisy_mapping(mapping):
    def _(x):
        y = mapping(x)
        y += random.gauss(0, 1)
        return y

    return _


pow2 = noisy_mapping(lambda x: x ** 2)


# lets record the pairs (x, f(x)) in a metric and make a plot:
from pennpaper import Metric, plot_group, plot

m1 = Metric("pow2")
for x in X:
    m1.add_record(x, pow2(x))

plot(m1)

# try again - see in how far it repeats itself.
m2 = Metric("pow2_second_try")
for x in X:
    m2.add_record(x, pow2(x))

# lets plot two metrics side-by-side
plot_group([m1, m2])


# Actually, m1 and m2 are metrics of the same process. 
# What if we create a new metric tracking the mean and stddev of this process?
m3 = m1 + m2
plot(m3)

# the plot is too noisy to understand. We can smoothen it!
plot(m3, smoothen=True)

Metadata

Release files for pennpaper 0.15

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

Source distribution (sdist)

Source distribution for pennpaper 0.15
File Size Uploaded
pennpaper-0.15.tar.gz 6.2 kB Details

Built distribution (wheel)

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

Total release size: 15.2 kB

Release files / pennpaper-0.15.tar.gz

Download URL pennpaper-0.15.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
59524c1aab29fe4c1428ffdea9de16b092e7978c4b729950a01ce95ae6982f05
BLAKE2b-256 checksum
How to use checksums
f2df3e9a72d59d1d9c13a38d2138c524acf1303ae59e0c6ba0b5fa471136333f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release files / pennpaper-0.15-py3-none-any.whl

Download URL pennpaper-0.15-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bbf72f4429b77916f6bd56a5fb91586a8c41382746a549184454da77ccc22791
BLAKE2b-256 checksum
How to use checksums
c1a98e6da6dd840e0b5cdb726d656d61db692fc30c5243611d387e289995eac3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.15 This release

2 release files

0.13

2 release files

0.11

2 release files

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