km3modules.common
¶
A collection of commonly used modules.
Module Contents¶
Classes¶
Print the content of the blob. |
|
Remove specific keys from the blob. |
|
Keep only specified keys in the blob. |
|
Prints the number of hits |
|
A very basic hit calibrator, which requires a Calibration module. |
|
Puts an incremented index in each blob for the key 'blob_index' |
|
Displays the current blob number. |
|
Display the elapsed time. |
|
Shows the maximum memory usage |
|
A siphon to accumulate a given volume of blobs. |
|
Use the given pump to iterate through a list of files. |
|
Provides a local sqlite3 based database service to store information |
|
A simple helper to observe the blobs in a test pipeline. |
|
A basic iterator for a list of files. |
Attributes¶
- class km3modules.common.Dump(name=None, **parameters)[source]¶
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?
- class km3modules.common.Delete(name=None, **parameters)[source]¶
Remove specific keys from the blob.
- Parameters:
- keys: collection(string), optional
Keys to remove.
- class km3modules.common.Keep(name=None, **parameters)[source]¶
Keep only specified keys in the blob.
- Parameters:
- keys: collection(string), optional
Keys to keep. Everything else is removed.
- class km3modules.common.HitCalibrator(name=None, **parameters)[source]¶
A very basic hit calibrator, which requires a Calibration module.
- class km3modules.common.BlobIndexer(name=None, **parameters)[source]¶
Puts an incremented index in each blob for the key ‘blob_index’
- class km3modules.common.StatusBar(name=None, **parameters)[source]¶
Displays the current blob number.
- class km3modules.common.TickTock(name=None, **parameters)[source]¶
Display the elapsed time.
- Parameters:
- every: int, optional [default=1]
Number of iterations between printout.
- class km3modules.common.MemoryObserver(name=None, **parameters)[source]¶
Shows the maximum memory usage
- Parameters:
- every: int, optional [default=1]
Number of iterations between printout.
- class km3modules.common.Siphon(name=None, **parameters)[source]¶
A siphon to accumulate a given volume of blobs.
- Parameters:
- volume: int
number of blobs to hold
- flush: bool
discard blobs after accumulation
- class km3modules.common.MultiFilePump(name=None, **parameters)[source]¶
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.
- class km3modules.common.LocalDBService(name=None, **parameters)[source]¶
Provides a local sqlite3 based database service to store information
- insert_row(table, column_names, values)[source]¶
Insert a row into the table with a given list of values
- class km3modules.common.Observer(name=None, **parameters)[source]¶
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.