From 21559e278bd24b27e1a39b1835b555201f102162 Mon Sep 17 00:00:00 2001 From: Sebastian Hurubaru Date: Wed, 1 Nov 2023 11:59:44 +0100 Subject: [PATCH] Use data.keys as a method to be inline with PyG 2.4.0 --- deepsnap/graph.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deepsnap/graph.py b/deepsnap/graph.py index edb57fc..b3f14dc 100644 --- a/deepsnap/graph.py +++ b/deepsnap/graph.py @@ -1970,9 +1970,9 @@ def pyg_to_graph( """ # all fields in PyG Data object kwargs = {} - kwargs["node_feature"] = data.x if "x" in data.keys else None + kwargs["node_feature"] = data.x if "x" in data.keys() else None kwargs["edge_feature"] = ( - data.edge_attr if "edge_attr" in data.keys else None + data.edge_attr if "edge_attr" in data.keys() else None ) kwargs["node_label"], kwargs["edge_label"] = None, None kwargs["graph_feature"], kwargs["graph_label"] = None, None @@ -2013,7 +2013,7 @@ def pyg_to_graph( # include other arguments that are in the kwargs of pyg data object keys_processed = ["x", "y", "edge_index", "edge_attr"] - for key in data.keys: + for key in data.keys(): if key not in keys_processed: kwargs[key] = data[key]