[docs]classMetricInfo:display_name:strmetric_type:METRIC_TYPEcalculator:Type[Calculator]exclude_axes:List[str]def__init__(self,display_name:str,metric_type:METRIC_TYPE,calculator:Type[Calculator],exclude_axes:List[PLOT_AXIS]=None,):""" Data about a metric that can be calculated. Parameters ---------- display_name: str The name for this metric to display on a plot axis. metric_type: METRIC_TYPE The type of metric, for determining which metrics can be plotted against one another. calculator: Type[Calculator] The calculator class for this metric. exclude_axes: List[PLOT_AXIS] (optional) A list of plot axes where this metric doesn't make sense, if any. Default: [] (don't exclude any axes) """self.display_name=display_nameself.metric_type=metric_typeself.calculator=calculatorself.exclude_axes=[]ifexclude_axesisnotNone:self.exclude_axes=[axis.valueforaxisinexclude_axes]
[docs]defto_dict(self)->Dict[str,Any]:""" Get a dict with info about the metric that a client needs to know. Returns ------- Dict[str, Any] A dict of the metric info, including display name, metric type, and excluded axes. """return{"display_name":self.display_name,"metric_type":self.metric_type.value,"exclude_axes":self.exclude_axes,}