From 9a65a7b9c599081533a801fb8108cbe7529328e0 Mon Sep 17 00:00:00 2001 From: danielsanchezq Date: Mon, 3 Apr 2023 19:33:02 +0200 Subject: [PATCH] Store just highest qc and aggregated views in AggregatedQc, --- carnot/carnot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/carnot/carnot.py b/carnot/carnot.py index 52eed50..3784d25 100644 --- a/carnot/carnot.py +++ b/carnot/carnot.py @@ -22,14 +22,16 @@ class StandardQc: @dataclass class AggregateQc: - qcs: List[StandardQc] + qcs: List[View] + highest_qc: StandardQc view: View def view(self) -> View: return self.view def high_qc(self) -> StandardQc: - return max(self.qcs, key=lambda qc: qc.view) + assert self.highest_qc.view == max(self.qcs) + return self.highest_qc Qc: TypeAlias = StandardQc | AggregateQc