From be3f177352a97eca25004a85aa7d782504e350bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petter=20K=C3=A4llstr=C3=B6m?= <petter.kallstrom@liu.se> Date: Tue, 7 May 2024 12:23:53 +0000 Subject: [PATCH] Update signal_flow_graph.SFG.find_by_type_name. Now it actually checks the type name, and not the _graph_id. Safer (if user changed the graph_id), and no need for regex. --- b_asic/signal_flow_graph.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/b_asic/signal_flow_graph.py b/b_asic/signal_flow_graph.py index fb784913..89a6bfee 100644 --- a/b_asic/signal_flow_graph.py +++ b/b_asic/signal_flow_graph.py @@ -549,10 +549,8 @@ class SFG(AbstractOperation): type_name : TypeName The TypeName of the desired components. """ - reg = f"{type_name}[0-9]+" - p = re.compile(reg) components = [ - val for key, val in self._components_by_id.items() if p.match(key) + com for com in self._components_dfs_order if com.type_name() == type_name ] return components -- GitLab