lisa.analysis.base.TraceAnalysisBase#

class lisa.analysis.base.TraceAnalysisBase(trace, proxy=None)[source]#

Bases: AnalysisHelpers

Base class for Analysis modules.

Parameters:

trace (lisa.trace.Trace) – input Trace object

Design notes:

Method depending on certain trace events must be decorated with lisa.trace.requires_events()

Properties

logger inherited

Convenience short-hand for self.get_logger().

name inherited

Name of the analysis class.

Methods

cache()

Decorator to enable caching of the output of dataframe getter function in the trace cache.

call_on_trace()

Call a method of a subclass on a given trace.

df_method()

Dataframe function decorator.

get_all_events()

Returns the set of all events used by any of the methods.

get_analysis_classes()

get_default_plot_path()

Return the default path to use to save plots for the analysis.

get_df_methods()

get_logger() inherited

Provides a logging.Logger named after cls.

get_plot_methods() inherited

log_locals() inherited

Debugging aid: log the local variables of the calling function.

plot_method() inherited

Plot function decorator.

save_plot() inherited

Save a holoviews element or matplotlib.figure.Figure as an image file.

Properties#

property TraceAnalysisBase.logger#

Inherited property, see lisa.utils.Loggable.logger

Convenience short-hand for self.get_logger().

abstract property TraceAnalysisBase.name#

Inherited property, see lisa.analysis.base.AnalysisHelpers.name

Name of the analysis class.

Methods#

classmethod TraceAnalysisBase.cache(f, fmt='parquet', ignored_params=None)[source]#

Called on Trace instances as trace.ana.<property object at 0x7fbf15476ed0>.cache()

Decorator to enable caching of the output of dataframe getter function in the trace cache.

This will write the return data to the swap as well, so processing can be skipped completely when possible.

Parameters:
  • fmt (str) – Format of the data to write to the cache. This will influence the extension of the cache file created. If disk-only format is chosen, the data is not retained in memory and the path to the allocated cache file is passed as first parameter to the wrapped function. This allows manual management of the file’s content, as well having a path to a file to pass to external tools if they can consume the data directly.

  • ignored_params (list(str)) – Parameters to ignore when trying to hit the cache.

classmethod TraceAnalysisBase.call_on_trace(meth, trace, meth_kwargs)[source]#

Called on Trace instances as trace.ana.<property object at 0x7fbf15476ed0>.call_on_trace()

Call a method of a subclass on a given trace.

Parameters:

It will create an instance of the right analysis, bind the function to it and call the resulting bound method with meth_kwargs extra keyword arguments.

classmethod TraceAnalysisBase.df_method(f, index=None)[source]#

Called on Trace instances as trace.ana.<property object at 0x7fbf15476ed0>.df_method()

Dataframe function decorator.

It provides among other things:

  • Dataframe format conversion

classmethod TraceAnalysisBase.get_all_events()[source]#

Called on Trace instances as trace.ana.<property object at 0x7fbf15476ed0>.get_all_events()

Returns the set of all events used by any of the methods.

classmethod TraceAnalysisBase.get_analysis_classes()[source]#

Called on Trace instances as trace.ana.<property object at 0x7fbf15476ed0>.get_analysis_classes()

TraceAnalysisBase.get_default_plot_path(**kwargs)[source]#

Called on Trace instances as trace.ana.<property object at 0x7fbf15476ed0>.get_default_plot_path()

Return the default path to use to save plots for the analysis.

Parameters:
  • img_format (str) – Format of the image to save.

  • plot_name (str) – Middle-name of the plot

  • default_dir (str) – Default folder to store plots into.

classmethod TraceAnalysisBase.get_df_methods(*args, **kwargs)[source]#

Called on Trace instances as trace.ana.<property object at 0x7fbf15476ed0>.get_df_methods()

classmethod TraceAnalysisBase.get_logger(suffix=None)#

Inherited method, see lisa.utils.Loggable.get_logger()

Provides a logging.Logger named after cls.

classmethod TraceAnalysisBase.get_plot_methods(*args, **kwargs)#

Inherited method, see lisa.analysis.base.AnalysisHelpers.get_plot_methods()

classmethod TraceAnalysisBase.log_locals(var_names=None, level='debug')#

Inherited method, see lisa.utils.Loggable.log_locals()

Debugging aid: log the local variables of the calling function.

classmethod TraceAnalysisBase.plot_method(f)#

Inherited method, see lisa.analysis.base.AnalysisHelpers.plot_method()

Plot function decorator.

TraceAnalysisBase.save_plot(figure, filepath=None, img_format=None, backend=None)#

Inherited method, see lisa.analysis.base.AnalysisHelpers.save_plot()

Save a holoviews element or matplotlib.figure.Figure as an image file.