4.1.2.5. pamtra2.decorators

4.1.2.5.1. Module Contents

4.1.2.5.1.1. Classes

MemoizeMutable

4.1.2.5.1.2. Functions

NDto2DtoND(referenceIn=0, noOfInDimsToKeep=1, convertInputs=[0], convertOutputs=[0], verbosity=0)

Decorator to turn the Pamtra functions which expect only one dimension

class MemoizeMutable(fn)[source]
__call__(self, *args, **kwds)[source]
NDto2DtoND(referenceIn=0, noOfInDimsToKeep=1, convertInputs=[0], convertOutputs=[0], verbosity=0)[source]

Decorator to turn the Pamtra functions which expect only one dimension (usually height) into function accepting arbritrary shapes.

Parameters
  • referenceIn (int, optional) – Input argument used as reference for reshaping (default 0)

  • noOfInDimsToKeep (int, optional) – number of dimensions to preserve of referenceIn (counting from the back) (default 1)

  • convertInputs (list of int, optional) – list of indices of input arguments which should be treated. (default [0])

  • convertOutputs (list of int, optional) – list of indices of output arguments which should be treated. (default [0])

  • verbosity (int, optional) – verbosity level (default 0)

Returns

function – decorated function

Return type

function