bmp_cleanup

bigmultipipe.bmp_cleanup(data, bmp_meta=None, add=None)[source]

Enables select BigMultiPipe metadata to be deleted after all BigMultiPipe post-processing routines have completed.

Parameters
bmp_metadict

BigMultiPipe metadata dictionary

addstr or list of str

bmp_meta keyword(s) that will be deleted

Notes

As discussed in Discussion of Design, this can be used to enable multiple post-processing routines to share information that would otherwise not be returnable on the bigmultipipe metadata stream. One can think of this as implementing shared property of an object constructed on-the-fly by several post-processing routines. Depending on the implementation, it may be more “pythonic” to create an object that is passed through the control stream and access that as a keyword in the post-processing routines. See also post_process_list documentation.

Examples

In a bigmultipipe post-processing routine add the following call to bmp_cleanup() and large_meta will be automatically removed after all other post-processing routines have run.

>>> def large_meta_producer(data, bmp_meta=None, **kwargs):
>>>     bmp_meta['large_meta'] = 'large'
>>>     bmp_cleanup(bmp_meta, add='large_meta')
>>>     return data