Resources#

class maize.utilities.resources.Resources(max_count: int, parent: Component)[source]#

Bases: object

Acquire computational resources in the form of a context manager.

Parameters:
  • max_count – The maximum resource count

  • parent – Parent component object for status updates

Examples

>>> cpus = Resources(max_count=5, parent=graph)
... with cpus(3):
...     do_something(n_jobs=3)
__init__(max_count: int, parent: Component) None[source]#

Methods

__init__(max_count, parent)