oemof.solph.plumbing¶
Helpers to fit scalar values into sequences.
- oemof.solph._plumbing.sequence(iterable_or_scalar)[source]¶
Tests if an object is iterable (except string) or scalar and returns the original sequence if object is an iterable and an ‘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]