@@ -311,24 +311,24 @@ def get_depiction_functions(self, smiles: str) -> List[Callable]:
311311 for k in self ._config .styles ]
312312
313313 # Remove PIKAChU if there is an isotope
314- if re .search ("(\[\d\d\d?[A-Z])|(\[2H\])|(\[3H\])|(D)|(T)" , smiles ):
314+ if re .search (r "(\[\d\d\d?[A-Z])|(\[2H\])|(\[3H\])|(D)|(T)" , smiles ):
315315 if self .pikachu_depict in depiction_functions :
316316 depiction_functions .remove (self .pikachu_depict )
317317 if self .has_r_group (smiles ):
318318 # PIKAChU only accepts \[[RXZ]\d*\]
319- squared_bracket_content = re .findall ("\[.+?\]" , smiles )
319+ squared_bracket_content = re .findall (r "\[.+?\]" , smiles )
320320 for r_group in squared_bracket_content :
321- if not re .search ("\[[RXZ]\d*\]" , r_group ):
321+ if not re .search (r "\[[RXZ]\d*\]" , r_group ):
322322 if self .pikachu_depict in depiction_functions :
323323 depiction_functions .remove (self .pikachu_depict )
324324 # "R", "X", "Z" are not depicted by RDKit
325325 # The same is valid for X,Y,Z and a number
326326 if self .rdkit_depict in depiction_functions :
327- if re .search ("\[[RXZ]\]|\[[XYZ]\d+" , smiles ):
327+ if re .search (r "\[[RXZ]\]|\[[XYZ]\d+" , smiles ):
328328 depiction_functions .remove (self .rdkit_depict )
329329 # "X", "R0", [RXYZ]\d+[a-f] and indices above 32 are not depicted by Indigo
330330 if self .indigo_depict in depiction_functions :
331- if re .search ("\[R0\]|\[X\]|[4-9][0-9]+|3[3-9]|[XYZR]\d+[a-f]" , smiles ):
331+ if re .search (r "\[R0\]|\[X\]|[4-9][0-9]+|3[3-9]|[XYZR]\d+[a-f]" , smiles ):
332332 depiction_functions .remove (self .indigo_depict )
333333 # Workaround because PIKAChU fails to depict large structures
334334 # TODO: Delete workaround when problem is fixed in PIKAChU
@@ -739,7 +739,7 @@ def has_r_group(self, smiles: str) -> bool:
739739 Returns:
740740 bool
741741 """
742- if re .search ("\[.*[RXYZ].*\]" , smiles ):
742+ if re .search (r "\[.*[RXYZ].*\]" , smiles ):
743743 return True
744744
745745 def _smiles_to_mol_block (
@@ -776,7 +776,7 @@ def _smiles_to_mol_block(
776776 molecule = self ._cdk_rotate_coordinates (molecule )
777777 return self ._cdk_iatomcontainer_to_mol_block (molecule )
778778 elif generate_2d == "rdkit" :
779- if re .search ("\[[RXZ]\]|\[[XYZ]\d+" , smiles ):
779+ if re .search (r "\[[RXZ]\]|\[[XYZ]\d+" , smiles ):
780780 return self ._smiles_to_mol_block (smiles , generate_2d = "cdk" )
781781 mol_block = self ._smiles_to_mol_block (smiles )
782782 molecule = Chem .MolFromMolBlock (mol_block , sanitize = False )
@@ -789,7 +789,7 @@ def _smiles_to_mol_block(
789789 else :
790790 raise ValueError (f"RDKit could not read molecule: { smiles } " )
791791 elif generate_2d == "indigo" :
792- if re .search ("\[R0\]|\[X\]|[4-9][0-9]+|3[3-9]|[XYZR]\d+[a-f]" , smiles ):
792+ if re .search (r "\[R0\]|\[X\]|[4-9][0-9]+|3[3-9]|[XYZR]\d+[a-f]" , smiles ):
793793 return self ._smiles_to_mol_block (smiles , generate_2d = "cdk" )
794794 indigo = Indigo ()
795795 mol_block = self ._smiles_to_mol_block (smiles )
0 commit comments