padl.wrap

Wrappers.

class padl.wrap.PatchedModule(module, parents=None)

Class that patches a module, such that all functions and classes in that module come out wrapped as Transforms.

Example:

>>> import padl
>>> import numpy as np
>>> pd_np = padl.transform(np)
>>> isinstance(pd_np.random.rand, padl.transforms.Transform)
True
padl.wrap.transform(wrappee, ignore_scope=False)

Transform wrapper / decorator. Use to wrap a class, module or callable.

Parameters
  • wrappee – class, module or callable to be wrapped

  • ignore_scope – Don’t try to determine the scope (use the toplevel scope instead).