Skip to content

Commit

Permalink
fix: only remove PIKAChU if it is there initially (caused crash)
Browse files Browse the repository at this point in the history
  • Loading branch information
OBrink committed Jul 13, 2023
1 parent 9c54d7c commit 3b5d3e0
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 @@ -313,7 +313,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 3b5d3e0

Please sign in to comment.