[docs]@dataclasses.dataclassclassHistogramMetricConfig:""" Parameters: variables: when set, filter the aggregator to these variables only — no histogram (plot or percentile) is emitted for variables not in this list. name: log prefix and wandb key prefix. enabled: master toggle for the metric. strict: raise if the metric can't be built. percentile_variables: when set, only these variables get the 99.9999th-percentile (and any other configured percentile) scalar metrics emitted. The histogram plot is still emitted for every variable that passed ``variables``. Defaults to None (emit percentile keys for every variable that passed ``variables`` — current behaviour). Use to restrict the noisy tail-percentile keys to a small list (e.g. precipitation only) while keeping the histogram plot cohort-wide. """variables:list[str]|None=Nonename:str="histogram"enabled:bool=Falsestrict:bool=Truepercentile_variables:list[str]|None=Nonedef__post_init__(self):ifself.variablesisnotNoneandself.percentile_variablesisnotNone:extra=set(self.percentile_variables)-set(self.variables)ifextra:raiseValueError(f"percentile_variables contains names not in variables: "f"{sorted(extra)}")defget_name(self)->str:returnself.namedefbuild(self,ctx:MetricBuildContext)->MetricBuildResult:agg:SubAggregator=HistogramAggregator(percentile_variables=self.percentile_variables)returnMetricBuildResult(aggregator=maybe_filter(agg,self.variables))