compas.itertools

This package defines useful functions for working with iterable objects.

Functions

normalize_values

Normalize a list of numbers to the range between new_min and new_max.

remap_values

Maps a list of numbers from one domain to another.

meshgrid

Construct coordinate matrices from two coordinate vectors.

linspace

Generate a sequence of evenly spaced numbers over a specified interval.

flatten

Flatten one level of nesting.

reshape

Gives a new shape to an array without changing its data.

pairwise

Returns a sliding window of size 2 over the data of the iterable.

window

Returns a sliding window (of width n) over the data from the iterable.

iterable_like

Creates an iterator from a reference object with size equivalent to that of a target iterable.