steppyngstounes.stepper

Classes

class steppyngstounes.stepper.Step(begin, end, stepper, want)

Bases: object

Object describing a step to take.

Parameters:
  • begin (float) – The present value of the variable to step over.

  • end (float) – The desired value of the variable to step over.

  • stepper (Stepper) – The adaptive stepper that generated this step.

  • want (float) – The step size really desired if not constrained by, e.g., end of range.

succeeded(value=None, error=None)

Test if step was successful.

Parameters:
  • value (float, optional) – User-determined scalar value that characterizes the last step. Whether this parameter is required depends on which Stepper is being used. (default None).

  • error (float, optional) – User-determined error (positive and normalized to 1) from the last step. Whether this parameter is required depends on which Stepper is being used. (default None).

Returns:

Whether step was successful. If error is not required, returns True.

Return type:

bool


class steppyngstounes.stepper.Stepper(start, stop, size=None, minStep=None, inclusive=False, record=False, limiting=False)

Bases: object

Adaptive stepper base class.

Parameters:
  • start (float) – Beginning of range to step over.

  • stop (float) – Finish of range to step over.

  • size (float) – Suggested step size to try (default None).

  • minStep (float) –

    Smallest step to allow (default (stop - start) * eps).

  • inclusive (bool) – Whether to include an evaluation at start (default False).

  • record (bool) – Whether to keep history of steps, errors, values, etc. (default False).

  • limiting (bool) – Whether to prevent error from exceeding 1 (default False).

property errors

ndarray of the “error” at each step attempt.

The user-determined “error” scalar value (positive and normalized to 1) at each step attempt is passed to Stepper via succeeded().

next()

Return the next step.

Note

Legacy Python 2.7 support.

Return type:

Step

Raises:

StopIteration – If there are no further steps to take

property sizes

ndarray of the step size at each step attempt.

property steps

ndarray of values of the control variable attempted so far.

succeeded(step, value=None, error=None)

Test if step was successful.

Stores data about the last step.

Parameters:
  • step (Step) – The step to test.

  • value (float, optional) – User-determined scalar value that characterizes the last step. Whether this parameter is required depends on which Stepper is being used. (default None).

  • error (float, optional) – User-determined error (positive and normalized to 1) from the last step. Whether this parameter is required depends on which Stepper is being used. (default None).

Returns:

Whether step was successful.

Return type:

bool

property successes

ndarray of whether the step was successful at each step attempt.

property values

ndarray of the “value” at each step attempt.

The user-determined scalar value at each step attempt is passed to Stepper via succeeded().