DataFolder.filter

DataFolder.filter(filter=None, invert=False, copy=False, recurse=False, prune=True)

Filter the current set of files by some criterion.

Parameters:

filter (string or callable) – Either a string flename pattern or a callable function which takes a single parameter x which is an instance of a metadataObject and evaluates True or False

Keyword Arguments:
  • invert (bool) – Invert the sense of the filter (done by doing an XOR with the filter condition

  • copy (bool) – If set True then the DataFolder is copied before being filtered. Default is False - work in place.

  • recurse (bool) – If True, apply the filter recursely to all groups. Default False

  • prune (bool) – If True, execute a baseFolder.prune() to remove empty groups after filering

Returns:

The current objectFolder object