cave.analyzer.base_analyzer module

class cave.analyzer.base_analyzer.BaseAnalyzer(runscontainer: cave.reader.runs_container.RunsContainer, *args, **kwargs)[source]

Bases: object

The base class for analyzing methods. To create a new analyzer, inherit from this class and extend. If you already have an analyzer, but need a wrapper to call it, also inherit it from this class. You should overwrite the “get_name”-method. Currently the initialization calls the analysis. After the analyzer ran, the results should be saved to the member self.result, which is a dictionary with a defined structure. The docstrings (this part) will be used to display a tooltip / help for the analyzer, so it should be a descriptive and concise small paragraph describing the analyzer and it’s results. Remember to call super.__init__(runscontainer) in your analyzer’s __init__-method. This will initialize the logger, name and important attributes. All configurator data is available via the self.runscontainer.

runscontainer: RunsContainer

contains all important information about the configurator runs

classmethod check_for_bokeh(d)[source]

Check if there is bokeh-plots in the output of this analyzer by checking the result-dictionary for the bokeh keyword.

get_html(d=None, tooltip=None) → Tuple[str, str][source]

General reports in html-format, to be easily integrated in html-code. WORKS ALSO FOR BOKEH-OUTPUT.

Parameters
  • d (Dictionary) – a dictionary that will be later turned into a website

  • tooltip (string) – tooltip to be displayed in report. optional, will overwrite the docstrings that are used by default.

Returns

script, div – header and body part of html-code

Return type

str, str

get_jupyter()[source]

Depending on analysis, this creates jupyter-notebook compatible output.

get_name()[source]
plot_bokeh()[source]

This function should recreate the bokeh-plot from scratch with as little overhead as possible. This is needed to show the bokeh plot in jupyter AND save it to the webpage. The bokeh plot needs to be recreated to be displayed in different outputs for reasons beyond out control. So save all analysis results in the class and simply redo the plotting with this function. This function needs to be called if bokeh-plots are to be displayed in notebook AND saved to html-result.