From 991785bfe726df79e40a72264e2845edf8da4593 Mon Sep 17 00:00:00 2001 From: Jessica Millar Date: Tue, 26 Nov 2024 11:22:25 -0500 Subject: [PATCH] updates to hardware layout hierarchy stuff --- src/gwproto/data_classes/hardware_layout.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gwproto/data_classes/hardware_layout.py b/src/gwproto/data_classes/hardware_layout.py index 84dd4303..ae08b24c 100644 --- a/src/gwproto/data_classes/hardware_layout.py +++ b/src/gwproto/data_classes/hardware_layout.py @@ -653,6 +653,9 @@ def boss_node(self, node: ShNode) -> Optional[ShNode]: raise DcError(f"{node} is missing boss {boss_handle}") return boss + def direct_reports(self, node: ShNode) -> List[ShNode]: + return [n for n in self.nodes.values() if self.boss_node(n) == node] + def node_from_handle(self, handle: str) -> Optional[ShNode]: return next((n for n in self.nodes.values() if n.handle == handle), None)