stdlib: Remove PyStats Accumulator
This appears to have no equivalent type in the CPP stats and was never utilized in PyStats. Change-Id: Ia9afc83b4159eb1ab2c6f44ec0ad86cd73f2a4f8
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user