- DataFolder.walk_groups(walker, **kargs)¶
Walk through a heirarchy of groups and calls walker for each file.
walker (callable) – A callable object that takes either a metadataObject instance or a objectFolder instance.
- Keyword Arguments
group (bool) – (default False) determines whether the walker function will expect to be given the objectFolder representing the lowest level group or individual metadataObject objects from the lowest level group
replace_terminal (bool) – If group is True and the walker function returns an instance of metadataObject then the return value is appended to the files and the group is removed from the current objectFolder. This will unwind the group heirarchy by one level.
obly_terminal (bool) – Only execute the walker function on groups that have no sub-groups inside them (i.e. are terminal groups)
walker_args (dict) – A dictionary of static arguments for the walker function.
The walker function should have a prototype of the form:
where f is either a objectFolder or metadataObject.