sidpy.base.num_utils.get_slope

sidpy.base.num_utils.get_slope(values, tol=0.001)[source]

Attempts to get the slope of the provided values. This function will be handy for checking if a dimension has been varied linearly or not. If the values vary non-linearly, a ValueError will be raised

Parameters:
  • values (array-like) – List of numbers

  • tol (float, optional. Default = 1E-3) – Tolerance in the variation of the slopes.

Returns:

Slope of the line

Return type:

float