oemof.solph.plumbing

Plumbing stuff.

oemof.solph._plumbing.sequence(iterable_or_scalar)[source]

Tests if an object is iterable (except string) or scalar and returns a the original sequence if object is an iterable and a ‘emulated’ sequence object of class _Sequence if object is a scalar or string.

Parameters:iterable_or_scalar (iterable or None or int or float)

Examples

>>> sequence([1,2])
[1, 2]
>>> x = sequence(10)
>>> x[0]
10
>>> x[10]
10
>>> print(x)
[10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]