Skip to content

Commit

Permalink
Update bond_constraints.py
Browse files Browse the repository at this point in the history
This modifies slightly default constraints for some charged atoms. Thereby we follow the updated constraints of RDKit. This fixes issue #127
  • Loading branch information
MarioKrenn6240 authored Dec 31, 2024
1 parent 03e8ce5 commit 0e4b44e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions selfies/bond_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"B": 3, "B+1": 2, "B-1": 4,
"O": 2, "O+1": 3, "O-1": 1,
"N": 3, "N+1": 4, "N-1": 2,
"C": 4, "C+1": 5, "C-1": 3,
"P": 5, "P+1": 6, "P-1": 4,
"S": 6, "S+1": 7, "S-1": 5,
"C": 4, "C+1": 3, "C-1": 3,
"P": 5, "P+1": 4, "P-1": 6,
"S": 6, "S+1": 5, "S-1": 5,
"?": 8
}

Expand Down Expand Up @@ -48,7 +48,7 @@ def get_preset_constraints(name: str) -> Dict[str, int]:
+-----------------+-----------+---+---+-----+-----+---+-----+-----+
| | Cl, Br, I | N | P | P+1 | P-1 | S | S+1 | S-1 |
+-----------------+-----------+---+---+-----+-----+---+-----+-----+
| ``default`` | 1 | 3 | 5 | 6 | 4 | 6 | 7 | 5 |
| ``default`` | 1 | 3 | 5 | 4 | 6 | 6 | 5 | 5 |
+-----------------+-----------+---+---+-----+-----+---+-----+-----+
| ``octet_rule`` | 1 | 3 | 3 | 4 | 2 | 2 | 3 | 1 |
+-----------------+-----------+---+---+-----+-----+---+-----+-----+
Expand Down

0 comments on commit 0e4b44e

Please sign in to comment.