kb_python.stats
¶
Module Contents¶
Classes¶
Class used to collect kb run statistics. |
Attributes¶
- class kb_python.stats.Stats¶
Class used to collect kb run statistics.
- start(self)¶
Start collecting statistics.
Sets start time, the command line call, and the commands array to an empty list. Additionally, sets the kallisto and bustools paths and versions.
- command(self, command: List[str], runtime: Optional[float] = None)¶
Report a shell command was run.
- Parameters
command – A shell command, represented as a list
runtime – Command runtime
- end(self)¶
End collecting statistics.
- save(self, path: str) str ¶
Save statistics as JSON to path.
- Parameters
path – Path to JSON
- Returns
Path to saved JSON
- to_dict(self) Dict[str, Union[str, float]] ¶
Convert statistics to dictionary, so that it is easily parsed by the report-rendering functions.
- Returns
Statistics dictionary
- kb_python.stats.STATS¶