Skip to content

Commit 65dfda6

Browse files
committed
bond prop fix
1 parent 4fb00e6 commit 65dfda6

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

chebai_graph/preprocessing/properties/augmented_properties.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,16 @@ def get_property_value(self, augmented_mol: Dict) -> List:
4747
# For python 3.7+, the standard dict type preserves insertion order, and is iterated over in same order
4848
# https://docs.python.org/3/whatsnew/3.7.html#summary-release-highlights
4949
# https://mail.python.org/pipermail/python-dev/2017-December/151283.html
50-
prop_list.extend([self.get_bond_value(bond) for bond in fg_atom_edges])
51-
prop_list.extend([self.get_bond_value(bond) for bond in fg_edges])
52-
prop_list.extend([self.get_bond_value(bond) for bond in fg_graph_node_edges])
50+
prop_list.extend([self.get_bond_value(bond) for bond in fg_atom_edges.values()])
51+
prop_list.extend([self.get_bond_value(bond) for bond in fg_edges.values()])
52+
prop_list.extend(
53+
[self.get_bond_value(bond) for bond in fg_graph_node_edges.values()]
54+
)
55+
56+
num_directed_edges = augmented_mol[self.MAIN_KEY]["num_undirected_edges"] // 2
5357
assert (
54-
len(prop_list) == augmented_mol[self.MAIN_KEY]["num_edges"]
55-
), "Number of property values should be equal to number of edges"
58+
len(prop_list) == num_directed_edges
59+
), f"Number of property values ({len(prop_list)}) should be equal to number of half the number of undirected edges i.e. must be equal to {num_directed_edges} "
5660

5761
return prop_list
5862

0 commit comments

Comments
 (0)