pyppin.math

[Browse Source]

Mathematical utilities.

Modules

pyppin.math.functions

Create real-valued functions by interpolating data.

pyppin.math.histogram

A flexible class for managing, computing with, and plotting histograms.

pyppin.math.plot_ascii

Generate ASCII-art plots of functions and data.

Functions

cap(value, min, max)

Cap a value to an interval.

minmax(data)

Return (min, max) of data in one pass.

round_up_to(value, multiple_of)

Round value up to the nearest multiple of multiple_of.

within(value, min, max)

Test if value is in [min, max).

pyppin.math.round_up_to(value: float, multiple_of: float) float[source]

Round value up to the nearest multiple of multiple_of.

pyppin.math.cap(value: float, min: float, max: float) float[source]

Cap a value to an interval.

pyppin.math.within(value: float, min: float, max: float) bool[source]

Test if value is in [min, max).

pyppin.math.minmax(data: Iterable[float]) Tuple[float, float][source]

Return (min, max) of data in one pass.