friendlysam.util.get_list¶
-
friendlysam.util.
get_list
(func, indices)¶ Get a list of function values at indices.
Parameters: - func (callable) – The callable to get values from.
- indices (iterable) – An iterable of index values to pass to
func
.
Returns: values as
float
Return type: list
Examples
>>> from friendlysam import Storage >>> s = Storage('power', name='Battery') >>> for i in range(5): ... s.volume(i).value = i ** 2 ... >>> get_list(s.accumulation['power'], range(4)) [1.0, 3.0, 5.0, 7.0]