X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FMLRsearch%2Ftrimmed_stat.py;h=74918d78b0a552ee4e2f129357408ae4bbfcbdb8;hb=HEAD;hp=0076644aa32cc3719e2b6fb4f4ba08d4d1f4673e;hpb=e5dbe10d9599b9a53fa07e6fadfaf427ba6d69e3;p=csit.git diff --git a/resources/libraries/python/MLRsearch/trimmed_stat.py b/resources/libraries/python/MLRsearch/trimmed_stat.py index 0076644aa3..74918d78b0 100644 --- a/resources/libraries/python/MLRsearch/trimmed_stat.py +++ b/resources/libraries/python/MLRsearch/trimmed_stat.py @@ -16,9 +16,7 @@ from __future__ import annotations from dataclasses import dataclass -from typing import Optional -from .discrete_load import DiscreteLoad from .load_stats import LoadStats from .target_spec import TargetSpec @@ -52,27 +50,3 @@ class TrimmedStat(LoadStats): int_load=stats.int_load, target_to_stat={target: stats.target_to_stat[target]}, ) - - @property - def conditional_throughput(self) -> Optional[DiscreteLoad]: - """Compute conditional throughput from the load. - - Target stat has dur_rat_sum and good_long. - The code here adds intended load and handles the case min load is hit. - If min load is not a lower bound, None is returned. - - :return: Conditional throughput assuming self is a relevant lower bound. - :rtype: Optional[DiscreteLoad] - :raises RuntimeError: If target is unclear or load is spurious. - """ - target = list(self.target_to_stat.keys())[0] - _, pes = self.estimates(target) - if not pes: - if int(self): - raise RuntimeError(f"Not a lower bound: {self}") - return None - # TODO: Verify self is really the clo? - stat = self.target_to_stat[target] - loss_ratio = stat.dur_rat_sum / stat.good_long - ret = self * (1.0 - loss_ratio) - return ret