From a3af819d827722ceccff29d418644ce4c5c0e383 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Wed, 27 Mar 2024 10:06:38 -0700 Subject: [PATCH] stdlib: Remove PyStats Accumulator This appears to have no equivalent type in the CPP stats and was never utilized in PyStats. Change-Id: Ia9afc83b4159eb1ab2c6f44ec0ad86cd73f2a4f8 --- src/python/m5/ext/pystats/jsonloader.py | 5 ---- src/python/m5/ext/pystats/statistic.py | 34 ------------------------- 2 files changed, 39 deletions(-) diff --git a/src/python/m5/ext/pystats/jsonloader.py b/src/python/m5/ext/pystats/jsonloader.py index 260b978174..dfd9da38de 100644 --- a/src/python/m5/ext/pystats/jsonloader.py +++ b/src/python/m5/ext/pystats/jsonloader.py @@ -37,7 +37,6 @@ from .group import ( ) from .simstat import SimStat from .statistic import ( - Accumulator, Distribution, Scalar, Statistic, @@ -74,10 +73,6 @@ class JsonLoader(json.JSONDecoder): d.pop("type", None) return Distribution(**d) - elif d["type"] == "Accumulator": - d.pop("type", None) - return Accumulator(**d) - elif d["type"] == "Group": return Group(**d) diff --git a/src/python/m5/ext/pystats/statistic.py b/src/python/m5/ext/pystats/statistic.py index ebe24fbbca..a2ac1cc337 100644 --- a/src/python/m5/ext/pystats/statistic.py +++ b/src/python/m5/ext/pystats/statistic.py @@ -195,37 +195,3 @@ class Distribution(Vector): # These check some basic conditions of a distribution. assert self.bin_size >= 0 assert self.num_bins >= 1 - - -class Accumulator(Vector): - """ - A statistical type representing an accumulator. - """ - - _count: int - min: Union[int, float] - max: Union[int, float] - sum_squared: Optional[int] - - def __init__( - self, - value: Iterable[Union[int, float]], - count: int, - min: Union[int, float], - max: Union[int, float], - sum_squared: Optional[int] = None, - description: Optional[str] = None, - ): - super().__init__( - value=value, - type="Accumulator", - description=description, - ) - - self._count = count - self.min = min - self.max = max - self.sum_squared = sum_squared - - def count(self) -> int: - return self._count