From 65f45522b99564e8614783ba1055c3b42237899e Mon Sep 17 00:00:00 2001 From: Caroline Malin-Mayor Date: Fri, 8 Sep 2023 16:37:13 -0400 Subject: [PATCH] Change to get_edges_with_flag where appropriate --- src/traccuracy/metrics/_ctc.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/traccuracy/metrics/_ctc.py b/src/traccuracy/metrics/_ctc.py index 32bb14d2..f76ef4e8 100644 --- a/src/traccuracy/metrics/_ctc.py +++ b/src/traccuracy/metrics/_ctc.py @@ -50,19 +50,15 @@ def compute(self): } edge_error_counts = { "ws": len( - self.data.pred_graph.get_edges_with_attribute( - EdgeAttr.WRONG_SEMANTIC, lambda x: x + self.data.pred_graph.get_edges_with_flag( + EdgeAttr.WRONG_SEMANTIC ) ), "fp": len( - self.data.pred_graph.get_edges_with_attribute( - EdgeAttr.FALSE_POS, lambda x: x - ) + self.data.pred_graph.get_edges_with_flag(EdgeAttr.FALSE_POS) ), "fn": len( - self.data.gt_graph.get_edges_with_attribute( - EdgeAttr.FALSE_NEG, lambda x: x - ) + self.data.gt_graph.get_edges_with_flag(EdgeAttr.FALSE_NEG) ), } error_sum = get_weighted_error_sum(