Skip to content

Commit 0e4b44e

Browse files
Update bond_constraints.py
This modifies slightly default constraints for some charged atoms. Thereby we follow the updated constraints of RDKit. This fixes issue #127
1 parent 03e8ce5 commit 0e4b44e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

selfies/bond_constraints.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"B": 3, "B+1": 2, "B-1": 4,
1010
"O": 2, "O+1": 3, "O-1": 1,
1111
"N": 3, "N+1": 4, "N-1": 2,
12-
"C": 4, "C+1": 5, "C-1": 3,
13-
"P": 5, "P+1": 6, "P-1": 4,
14-
"S": 6, "S+1": 7, "S-1": 5,
12+
"C": 4, "C+1": 3, "C-1": 3,
13+
"P": 5, "P+1": 4, "P-1": 6,
14+
"S": 6, "S+1": 5, "S-1": 5,
1515
"?": 8
1616
}
1717

@@ -48,7 +48,7 @@ def get_preset_constraints(name: str) -> Dict[str, int]:
4848
+-----------------+-----------+---+---+-----+-----+---+-----+-----+
4949
| | Cl, Br, I | N | P | P+1 | P-1 | S | S+1 | S-1 |
5050
+-----------------+-----------+---+---+-----+-----+---+-----+-----+
51-
| ``default`` | 1 | 3 | 5 | 6 | 4 | 6 | 7 | 5 |
51+
| ``default`` | 1 | 3 | 5 | 4 | 6 | 6 | 5 | 5 |
5252
+-----------------+-----------+---+---+-----+-----+---+-----+-----+
5353
| ``octet_rule`` | 1 | 3 | 3 | 4 | 2 | 2 | 3 | 1 |
5454
+-----------------+-----------+---+---+-----+-----+---+-----+-----+

0 commit comments

Comments
 (0)