astra.contrib.thecannon.utils.wrapper

Module Contents

Classes

Wrapper A generic wrapper with a progressbar, which can be used either in serial or
class astra.contrib.thecannon.utils.wrapper.Wrapper(f, args, kwds, N, message=None, size=100)

A generic wrapper with a progressbar, which can be used either in serial or in parallel.

Parameters:
  • f – The function to apply.
  • args – Additional arguments to supply to the function f.
  • kwds – Keyword arguments to supply to the function f.
  • N – The number of items that will be iterated over.
  • message – [optional] An information message to log before showing the progressbar.
  • size – [optional] The width of the progressbar in characters.
Returns:

A generator.

_init_progressbar(self, N, message=None)

Initialise a progressbar.

Parameters:
  • N – The number of items that will be iterated over.
  • message – [optional] An information message to log before showing the progressbar.
_update_progressbar(self)

Increment the progressbar by one iteration.

__call__(self, x)