Skip to content

Commit

Permalink
Merge pull request #49 from OBrink/explicite_hydrogen_inclusion
Browse files Browse the repository at this point in the history
fix: only remove PIKAChU if it is there initially (caused crash)
  • Loading branch information
OBrink authored Jul 13, 2023
2 parents 3b395cd + 3b5d3e0 commit 2e8dec0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion RanDepict/randepict.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ def get_depiction_functions(self, smiles: str) -> List[Callable]:

# Remove PIKAChU if there is an isotope
if re.search("(\[\d\d\d?[A-Z])|(\[2H\])|(\[3H\])|(D)|(T)", smiles):
depiction_functions.remove(self.pikachu_depict)
if self.pikachu_depict in depiction_functions:
depiction_functions.remove(self.pikachu_depict)
if self.has_r_group(smiles):
# PIKAChU only accepts \[[RXZ]\d*\]
squared_bracket_content = re.findall("\[.+?\]", smiles)
Expand Down

0 comments on commit 2e8dec0

Please sign in to comment.