diff --git a/epyt_flow/uncertainty/uncertainties.py b/epyt_flow/uncertainty/uncertainties.py index fa88beb..27c4e40 100644 --- a/epyt_flow/uncertainty/uncertainties.py +++ b/epyt_flow/uncertainty/uncertainties.py @@ -334,8 +334,16 @@ def __init__(self, deviation_percentage: float, **kwds): if not 0 < deviation_percentage < 1: raise ValueError("'deviation_percentage' must be in (0,1)") + if "low" in kwds: + del kwds["low"] + if "high" in kwds: + del kwds["high"] + super().__init__(low=1. - deviation_percentage, high=1. + deviation_percentage, **kwds) + def get_attributes(self) -> dict: + return super().get_attributes() | {"deviation_percentage": self.high - 1.} + def apply(self, data: float) -> float: data *= np.random.uniform(low=self.low, high=self.high)