summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorПавел Жуков <33721692+LeaveMyYard@users.noreply.github.com>2023-03-28 19:26:05 +0300
committerПавел Жуков <33721692+LeaveMyYard@users.noreply.github.com>2023-03-28 19:26:05 +0300
commit8a56db8168cbbcace4cd55a1cc1b22528dcde5c8 (patch)
tree61415cc0aedaae6f61d837f04a2d3ab6571bfe40
parent895432f2d827c1dfc2da95d3defed6163f8b3ccd (diff)
Fix invalid calculation in simple strategy
-rw-r--r--robusta_krr/strategies/simple.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/robusta_krr/strategies/simple.py b/robusta_krr/strategies/simple.py
index 1846049..8206227 100644
--- a/robusta_krr/strategies/simple.py
+++ b/robusta_krr/strategies/simple.py
@@ -37,10 +37,4 @@ class SimpleStrategy(BaseStrategy[SimpleStrategySettings]):
if len(data_) == 0:
return Decimal.from_float(float("nan"))
- min_val, max_val = min(data_), max(data_)
- # If the min and max are the same, we can't calculate a percentile
- # Should'n happen on practice, but just in case
- if min_val == max_val:
- return min_val
-
- return min_val + (max_val - min_val) * percentile / 100
+ return max(data_) * percentile / 100