Skip to content

Commit

Permalink
Merge pull request #1 from SebastianHurubaru/hurubaru/issue_53
Browse files Browse the repository at this point in the history
Use data.keys as a method to be inline with PyG 2.4.0
  • Loading branch information
SebastianHurubaru authored Nov 1, 2023
2 parents 08bab60 + 21559e2 commit 9a88c43
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deepsnap/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]

Expand Down

0 comments on commit 9a88c43

Please sign in to comment.