@@ -150,7 +150,8 @@ def update_cif_with_connection_site(
150150
151151 Args:
152152 input_cif: Path to input CIF file
153- connection_sites: List of atom labels to be converted to connection sites
153+ connection_sites: List of atom labels to be
154+ converted to connection sites
154155 output_cif: Path to output CIF file
155156 """
156157 # Read and clean input file
@@ -193,7 +194,8 @@ def update_cif_with_connection_site(
193194
194195
195196def update_aromatic_bond (cif_in , cif_out ):
196- """Update CIF file by converting single bonds in aromatic rings to aromatic bonds."""
197+ """Update CIF: convert single bonds in aromatic rings
198+ to aromatic bonds."""
197199 with open (cif_in , encoding = "utf-8" ) as f :
198200 data = [line .strip () for line in f if line .strip ()]
199201
@@ -257,11 +259,20 @@ def smiles_to_cif(smiles, output_prefix="L1"):
257259 for i , atom in enumerate (struct ):
258260 label = f"{ atom .symbol } { i + 1 } "
259261 x , y , z = np .round (scaled_pos [i ], 5 )
260- pos_block += f"{ label :<10} { atom .symbol :<6} { x :<10} { y :<10} { z :<10} 0.00000 Uiso 1.00 0.00000\n "
262+ pos_block += (
263+ f"{ label :<10} { atom .symbol :<6} "
264+ f"{ x :<10} { y :<10} { z :<10} "
265+ f"0.00000 Uiso 1.00 0.00000\n "
266+ )
261267 indices , _ = nl .get_neighbors (i )
262268 for j in indices :
263269 d = struct .get_distance (i , j , mic = True )
264- bond_block += f"{ label :<6} { struct [j ].symbol } { j + 1 :<6} { round (d , 4 ):<8} . S\n "
270+ jlabel = f"{ struct [j ].symbol } { j + 1 } "
271+ dist = round (d , 4 )
272+ bond_block += (
273+ f"{ label :<6} { jlabel :<6} "
274+ f"{ dist :<8} . S\n "
275+ )
265276
266277 with open (final_cif , "w" , encoding = "utf-8" ) as f :
267278 f .write (
0 commit comments