@@ -1385,7 +1385,12 @@ def set_dihedral(self,
13851385 return None
13861386 mol = self .mol
13871387 if mol is None :
1388- mols = molecules_from_xyz (xyz , multiplicity = self .multiplicity , charge = self .charge )
1388+ mols = molecules_from_xyz (xyz ,
1389+ multiplicity = self .multiplicity ,
1390+ charge = self .charge ,
1391+ original_molecule = mol ,
1392+ numer_of_radicals = self .number_of_radicals ,
1393+ )
13891394 mol = mols [1 ] or mols [0 ]
13901395 if chk_rotor_list :
13911396 for rotor in self .rotors_dict .values ():
@@ -1595,7 +1600,10 @@ def mol_from_xyz(self,
15951600 # self.mol should have come from another source, e.g., SMILES or yml.
15961601 mol_s , mol_b = molecules_from_xyz (xyz = xyz ,
15971602 multiplicity = self .multiplicity ,
1598- charge = self .charge )
1603+ charge = self .charge ,
1604+ original_molecule = self .mol ,
1605+ numer_of_radicals = self .number_of_radicals ,
1606+ )
15991607 perceived_mol = mol_b or mol_s
16001608 if perceived_mol is not None :
16011609 allow_nonisomorphic_2d = self .charge \
@@ -1615,7 +1623,12 @@ def mol_from_xyz(self,
16151623 if not self .keep_mol :
16161624 self .mol = perceived_mol
16171625 else :
1618- mol_s , mol_b = molecules_from_xyz (xyz , multiplicity = self .multiplicity , charge = self .charge )
1626+ mol_s , mol_b = molecules_from_xyz (xyz ,
1627+ multiplicity = self .multiplicity ,
1628+ charge = self .charge ,
1629+ original_molecule = self .mol ,
1630+ numer_of_radicals = self .number_of_radicals ,
1631+ )
16191632 if mol_b is not None and len (mol_b .atoms ) == self .number_of_atoms :
16201633 self .mol = mol_b
16211634 elif mol_s is not None and len (mol_s .atoms ) == self .number_of_atoms :
@@ -1788,7 +1801,12 @@ def check_xyz_isomorphism(self,
17881801
17891802 # 1. Perceive
17901803 try :
1791- s_mol , b_mol = molecules_from_xyz (xyz , multiplicity = self .multiplicity , charge = self .charge )
1804+ s_mol , b_mol = molecules_from_xyz (xyz ,
1805+ multiplicity = self .multiplicity ,
1806+ charge = self .charge ,
1807+ original_molecule = mol ,
1808+ numer_of_radicals = self .number_of_radicals ,
1809+ )
17921810 except Exception as e :
17931811 if verbose :
17941812 logger .error (f'Could not perceive the Cartesian coordinates of species { self .label } . This '
0 commit comments