Sowiks commented on code in PR #96:
URL: https://github.com/apache/otava/pull/96#discussion_r2531613619
##########
otava/analysis.py:
##########
@@ -222,22 +210,22 @@ def merge(
# We can't continue yet, because by removing a change_point
# the adjacent change points changed their properties.
# Recompute the adjacent change point stats:
- window_endpoints = [0] + [cp.index for cp in change_points] +
[len(series)]
+ intervals = tester.get_intervals(change_points)
def recompute(index: int):
if index < 0 or index >= len(change_points):
return
cp = change_points[index]
- change_points[index] = tester.change_point(cp.index, series,
window_endpoints)
+ change_points[index] = tester.change_point(cp.to_candidate(),
series, intervals)
recompute(weakest_cp_index)
recompute(weakest_cp_index + 1)
Review Comment:
We don't. Good catch! It should be
```python
if weakest_cp_index == len(change_points):
recompute(weakest_cp_index - 1)
else:
recompute(weakest_cp_index)
recompute(weakest_cp_index + 1)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]