Skip to content

Commit 5118316

Browse files
committed
fix(monitors): constrain prediction for volume monitor to be non-negative
1 parent b316116 commit 5118316

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

testgen/commands/test_thresholds_prediction.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ def run(self) -> None:
118118
holiday_codes=self.test_suite.holiday_codes_list,
119119
schedule_tz=self.tz,
120120
)
121+
if test_type == "Volume_Trend":
122+
if lower is not None:
123+
lower = max(lower, 0.0)
124+
if upper is not None:
125+
upper = max(upper, 0.0)
121126
test_prediction.extend([lower, upper, None, prediction])
122127

123128
prediction_results.append(test_prediction)

0 commit comments

Comments
 (0)