lisa.utils.value_range#

lisa.utils.value_range(start, stop, step=None, nr_steps=None, inclusive=False, type_=None, clip=False)[source]#

Equivalent to builtin range function, but works for floats as well.

Parameters:
  • start (numbers.Number) – First value to use.

  • stop (numbers.Number) – Last value to use.

  • step (numbers.Number) – Mutually exclusive with nr_steps: increment. If None, increment defaults to 1.

  • nr_steps (int or None) – Mutually exclusive with step: number of steps.

  • inclusive (bool) – If True, the stop value will be included (unlike the builtin range)

  • type (collections.abc.Callable) – If specified, will be mapped on the resulting values.

  • clip (bool) – If True, the last value is set to stop, rather than potentially be different if inclusive=True.

Note

Unlike range, it will raise ValueError if start > stop and step > 0.