neurtu.delayed

neurtu.delayed(obj, tags=None, env=None)[source]

Delayed object evaluation

Parameters:
  • obj (object) – object or function to wrap
  • tags (dict) – optional tags for the produced delayed object
  • env (dict) – optional environment variables to set when evaluating the delayed object
Returns:

result – a delayed object

Return type:

class:neurtu.Delayed

Example

>>> x = delayed('some string').split(' ')[::-1]
>>> x
<Delayed('some string').split(' ')[slice(None, None, -1)]>
>>> x.compute()
['string', 'some']

Using tags

>>> x = delayed([2, 3], tags={'a': 0}).sum()
>>> x.get_tags()
{'a': 0}