From ba39ea257af0781a127697a0b1653f085dea1bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristiano=20K=C3=B6hler?= Date: Mon, 22 Jan 2024 01:57:58 +0100 Subject: [PATCH] Fixed error when removing None nodes and a None was an input to a function --- alpaca/graph.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/alpaca/graph.py b/alpaca/graph.py index 198e366..74e71d7 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)