:py:mod:`km3modules.common` =========================== .. py:module:: km3modules.common .. autoapi-nested-parse:: A collection of commonly used modules. .. !! processed by numpydoc !! Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: km3modules.common.Dump km3modules.common.Delete km3modules.common.Keep km3modules.common.HitCounter km3modules.common.HitCalibrator km3modules.common.BlobIndexer km3modules.common.StatusBar km3modules.common.TickTock km3modules.common.MemoryObserver km3modules.common.Siphon km3modules.common.MultiFilePump km3modules.common.LocalDBService km3modules.common.Observer km3modules.common.FilePump Attributes ~~~~~~~~~~ .. autoapisummary:: km3modules.common.log .. py:data:: log .. py:class:: Dump(name=None, **parameters) Print the content of the blob. :Parameters: **keys: collection(string), optional [default=None]** Keys to print. If None, print all keys. **full: bool, default=False** Print blob values too, not just the keys? .. !! processed by numpydoc !! .. py:method:: configure() Configure module, like instance variables etc. .. !! processed by numpydoc !! .. py:method:: process(blob) Knead the blob and return it .. !! processed by numpydoc !! .. py:class:: Delete(name=None, **parameters) Remove specific keys from the blob. :Parameters: **keys: collection(string), optional** Keys to remove. .. !! processed by numpydoc !! .. py:method:: configure() Configure module, like instance variables etc. .. !! processed by numpydoc !! .. py:method:: process(blob) Knead the blob and return it .. !! processed by numpydoc !! .. py:class:: Keep(name=None, **parameters) Keep only specified keys in the blob. :Parameters: **keys: collection(string), optional** Keys to keep. Everything else is removed. .. !! processed by numpydoc !! .. py:method:: configure() Configure module, like instance variables etc. .. !! processed by numpydoc !! .. py:method:: process(blob) Knead the blob and return it .. !! processed by numpydoc !! .. py:class:: HitCounter(name=None, **parameters) Prints the number of hits .. !! processed by numpydoc !! .. py:method:: process(blob) Knead the blob and return it .. !! processed by numpydoc !! .. py:class:: HitCalibrator(name=None, **parameters) A very basic hit calibrator, which requires a `Calibration` module. .. !! processed by numpydoc !! .. py:method:: configure() Configure module, like instance variables etc. .. !! processed by numpydoc !! .. py:method:: process(blob) Knead the blob and return it .. !! processed by numpydoc !! .. py:class:: BlobIndexer(name=None, **parameters) Puts an incremented index in each blob for the key 'blob_index' .. !! processed by numpydoc !! .. py:method:: configure() Configure module, like instance variables etc. .. !! processed by numpydoc !! .. py:method:: process(blob) Knead the blob and return it .. !! processed by numpydoc !! .. py:class:: StatusBar(name=None, **parameters) Displays the current blob number. .. !! processed by numpydoc !! .. py:method:: configure() Configure module, like instance variables etc. .. !! processed by numpydoc !! .. py:method:: process(blob) Knead the blob and return it .. !! processed by numpydoc !! .. py:method:: finish() Clean everything up. .. !! processed by numpydoc !! .. py:class:: TickTock(name=None, **parameters) Display the elapsed time. :Parameters: **every: int, optional [default=1]** Number of iterations between printout. .. !! processed by numpydoc !! .. py:method:: configure() Configure module, like instance variables etc. .. !! processed by numpydoc !! .. py:method:: process(blob) Knead the blob and return it .. !! processed by numpydoc !! .. py:class:: MemoryObserver(name=None, **parameters) Shows the maximum memory usage :Parameters: **every: int, optional [default=1]** Number of iterations between printout. .. !! processed by numpydoc !! .. py:method:: process(blob) Knead the blob and return it .. !! processed by numpydoc !! .. py:class:: Siphon(name=None, **parameters) A siphon to accumulate a given volume of blobs. :Parameters: **volume: int** number of blobs to hold **flush: bool** discard blobs after accumulation .. !! processed by numpydoc !! .. py:method:: configure() Configure module, like instance variables etc. .. !! processed by numpydoc !! .. py:method:: process(blob) Knead the blob and return it .. !! processed by numpydoc !! .. py:class:: MultiFilePump(name=None, **parameters) Use the given pump to iterate through a list of files. The group_id will be reset so that it's unique for each iteration. :Parameters: **pump: Pump** The pump to be used to generate the blobs. **filenames: iterable(str)** List of filenames. **kwargs: dict(str -> any) optional** Keyword arguments to be passed to the pump. .. !! processed by numpydoc !! .. py:method:: configure() Configure module, like instance variables etc. .. !! processed by numpydoc !! .. py:method:: blob_generator() .. py:method:: process(blob) Knead the blob and return it .. !! processed by numpydoc !! .. py:method:: finish() Clean everything up. .. !! processed by numpydoc !! .. py:class:: LocalDBService(name=None, **parameters) Provides a local sqlite3 based database service to store information .. !! processed by numpydoc !! .. py:method:: configure() Configure module, like instance variables etc. .. !! processed by numpydoc !! .. py:method:: query(query) Execute a SQL query and return the result of fetchall() .. !! processed by numpydoc !! .. py:method:: insert_row(table, column_names, values) Insert a row into the table with a given list of values .. !! processed by numpydoc !! .. py:method:: create_table(name, columns, types, overwrite=False) Create a table with given columns and types, overwrite if specified The `types` should be a list of SQL types, like ["INT", "TEXT", "INT"] .. !! processed by numpydoc !! .. py:method:: table_exists(name) Check if a table exists in the database .. !! processed by numpydoc !! .. py:method:: finish() Clean everything up. .. !! processed by numpydoc !! .. py:class:: Observer(name=None, **parameters) A simple helper to observe the blobs in a test pipeline. :Parameters: **count: int** The exact number of iterations the pipeline has to drain **required_keys: list(str)** A list of keys which has to be present in a blob in every cycle. .. !! processed by numpydoc !! .. py:method:: configure() Configure module, like instance variables etc. .. !! processed by numpydoc !! .. py:method:: process(blob) Knead the blob and return it .. !! processed by numpydoc !! .. py:method:: finish() Clean everything up. .. !! processed by numpydoc !! .. py:class:: FilePump(name=None, **parameters) A basic iterator for a list of files. :Parameters: **filenames: iterable(str)** The filenames to be iterated over which are put into ``blob["filename"]`` .. !! processed by numpydoc !! .. py:method:: configure() Configure module, like instance variables etc. .. !! processed by numpydoc !! .. py:method:: blob_generator() .. py:method:: process(blob) Knead the blob and return it .. !! processed by numpydoc !!