Protocols and type aliases¶
Structural protocols and PEP 695 type aliases. Because the protocols are structural, your own transforms satisfy them without inheriting from anything.
_typing
¶
Shared type aliases and structural protocols.
The aliases are written with PEP 695
type statements (Python 3.12+), and
the protocols are structural: any object with the right methods satisfies
them, no inheritance or registration required. That is what lets
Pipeline accept a user-defined transform it has never
heard of.
Series
¶
Any read-only sequence of numbers accepted as input by this package.
A list, tuple, range, or anything else implementing
collections.abc.Sequence works. Inputs are coerced to list[float] on the
way in and never mutated.
Transform
¶
Bases: Protocol
Structural protocol for anything that maps a series to a new series.
Implementations must not mutate their input and must return a fresh
list[float].
Examples: