From 2b8dd34fc6f9a4c1ed2004e014b3ed9495eda1ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristiano=20K=C3=B6hler?= <42555442+kohlerca@users.noreply.github.com> Date: Sat, 26 Oct 2024 18:14:28 +0200 Subject: [PATCH] Fixed error when removing None nodes in the visualization and a None was an input to a function (#31) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cristiano Köhler --- alpaca/graph.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/alpaca/graph.py b/alpaca/graph.py index d427382..29a6db7 100644 --- a/alpaca/graph.py +++ b/alpaca/graph.py @@ -411,10 +411,12 @@ def _transform_graph(graph, annotations=None, attributes=None, # Add all the edges from sources to activity and from activity # to targets for source in source_entities: - transformed.add_edge(source, node_id, membership=False) - if time_intervals: - _add_gephi_interval(transformed.nodes[source], - node_data['execution_order']) + if not remove_none or ( + remove_none and source not in none_nodes): + transformed.add_edge(source, node_id, membership=False) + if time_intervals: + _add_gephi_interval(transformed.nodes[source], + node_data['execution_order']) if not remove_none or (remove_none and target not in none_nodes): transformed.add_edge(node_id, target, membership=False)