hoftcache module

class hoftcache.Handler(*args, **kwargs)[source]

Bases: Handler

do_on_message(bus, message)[source]

Add extra message handling by overriding this in your subclass. If this method returns True, no further message handling is performed. If this method returns False, message handling continues with default cases or EOS, INFO, WARNING and ERROR messages.

hoftcache.build_pipeline(pipeline, data_source_info, output_path='/tmp', sample_rate=None, description='TMPFILE_DELETE_ME_49e346faa91246bcbdc0e6327f91caca', channel_comment=None, frame_duration=1, frames_per_file=1024, verbose=False)[source]
hoftcache.cache_hoft(data_source_info, channel_comment='cached h(t) for inspiral search', verbose=False, **kwargs)[source]
hoftcache.mkbasicsrc(pipeline, gw_data_source_info, instrument, verbose=False)[source]
class hoftcache.tempcache[source]

Bases: list

List-like object to hold CacheEntry objects, and run os.unlink() on the .path of each as they are removed from the list or when the list is garbage collected. All errors during file removal are ignored.

Note that there is no way to remove a CacheEntry from this list without the file it represents being deleted. If, after adding a CacheEntry to this list it is decided the file must not be deleted, then instead of removing it from the list it must be replaced with something else, e.g. None, and that item can then be removed from the list.

Example:

>>> from lal.utils import CacheEntry
>>> # create a cache, and add an entry
>>> cache = tempcache()
>>> cache.append(CacheEntry("- - - - file://localhost/tmp/blah.txt"))
>>> # now remove it without the file being deleted
>>> cache[-1] = None
>>> del cache[-1]