@@ -739,20 +739,37 @@ impl PyMolecule {
739
739
Ok ( n)
740
740
}
741
741
742
- #[ pyo3( signature = ( ignore_pbc=false , bond_tolerance=0.45 , bonding_scheme=None ) ) ]
743
- #[ pyo3( text_signature = "(ignore_pbc=False, bond_tolerance=0.45 , bonding_scheme=None)" ) ]
742
+ #[ pyo3( signature = ( ignore_pbc=false , bond_tolerance=None , cov_radius_scale_factor= None , bonding_scheme=None ) ) ]
743
+ #[ pyo3( text_signature = "(ignore_pbc=False, bond_tolerance=None, radius_scale_factor=None , bonding_scheme=None)" ) ]
744
744
/// Recalculates all bonds in molecule based on interatomic
745
745
/// distances and covalent radii. For periodic system, the bonds
746
746
/// are determined in miniumu image convention.
747
747
///
748
748
/// # Parameters
749
- /// * ignore_pbc: force to ignore periodicity when search nearest neighbors. The default is False.
750
- /// * bonding_scheme: the bonding scheme for rebond. Avaialbe scheme includes jmol and multiwfn.
751
- /// * bond_tolerance: the bonding tolerance used in jmol scheme.
752
- pub fn rebond ( & mut self , ignore_pbc : bool , bond_tolerance : f64 , bonding_scheme : Option < String > ) {
749
+ /// * ignore_pbc: force to ignore periodicity when search nearest
750
+ /// neighbors. The default is False.
751
+ /// * bonding_scheme: the bonding scheme for rebond. Avaialbe scheme
752
+ /// includes jmol and multiwfn.
753
+ /// * bond_tolerance: the bonding tolerance used in jmol scheme. The
754
+ /// default value is 0.45.
755
+ /// * cov_radius_scale_factor: set the scale factor for covalent
756
+ /// radius for perception of bond in multiwfn scheme. The
757
+ /// default value is 1.15.
758
+ pub fn rebond (
759
+ & mut self ,
760
+ ignore_pbc : bool ,
761
+ bond_tolerance : Option < f64 > ,
762
+ cov_radius_scale_factor : Option < f64 > ,
763
+ bonding_scheme : Option < String > ,
764
+ ) {
753
765
let mut options = Molecule :: rebond_options ( ) ;
754
766
options. ignore_pbc = ignore_pbc;
755
- options. bond_tolerance = bond_tolerance;
767
+ if let Some ( v) = bond_tolerance {
768
+ options. bond_tolerance = v;
769
+ }
770
+ if let Some ( v) = cov_radius_scale_factor {
771
+ options. cov_radius_scale_factor = v;
772
+ }
756
773
if let Some ( s) = bonding_scheme {
757
774
options. set_bonding_scheme ( & s) ;
758
775
}
0 commit comments