Gerrrr commented on code in PR #161:
URL: https://github.com/apache/otava/pull/161#discussion_r3742394792


##########
otava/series.py:
##########
@@ -445,12 +359,18 @@ def metric(self, name: str) -> Metric:
 
     def to_json(self):
         change_points_json = {}
-        for metric, cps in self.change_points.items():
-            change_points_json[metric] = [cp.to_json(rounded=False) for cp in 
cps]
+        cpbm = self.change_points.by_metric()
+        for metric_name in self.change_points.metrics():
+            change_points_json[metric_name] = []
+            for cp in cpbm.select_metrics(metric_name):
+                
change_points_json[metric_name].append(cp.to_json(rounded=False))
 
         weak_change_points_json = {}
-        for metric, cps in self.weak_change_points.items():
-            weak_change_points_json[metric] = [cp.to_json(rounded=False) for 
cp in cps]
+        wcpbm = self.change_points.by_metric()

Review Comment:
   c2782b8



-- 
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]

Reply via email to