dreye.arange_with_interval#

dreye.arange_with_interval(start, stop, step, dtype=None, raise_on_step_change=False, return_interval=False)[source]#

Return evenly spaced values within a given interval.

The function generates values within the closed interval [start, stop] (i.e., the interval including start and stop). If necessary, the function adjusts the step size to ensure that stop is included in the output.

Parameters:
startfloat

Start of interval. The interval includes this value.

stopfloat

End of interval. The interval includes this value.

stepfloat

Desired spacing between values. The actual spacing may be adjusted to include stop in the output.

dtypedata-type, optional

Desired output data-type.

raise_on_step_changebool, optional

If True, raise an exception if the step size is adjusted. Default is False.

return_intervalbool, optional

If True, return the used step size. Default is False.

Returns:
arrndarray

Array of evenly spaced values.

intervalfloat, optional

The used step size. Returned only if return_interval is True.

Raises:
ValueError

If raise_on_step_change is True and the step size is adjusted.