Author: bugman Date: Thu Jun 13 11:52:47 2013 New Revision: 20089 URL: http://svn.gna.org/viewcvs/relax?rev=20089&view=rev Log: Improvements to the RelaxZeroVectorWarning - the warning message was terribly out of date. Modified: trunk/lib/warnings.py trunk/pipe_control/interatomic.py trunk/pipe_control/structure/main.py Modified: trunk/lib/warnings.py URL: http://svn.gna.org/viewcvs/relax/trunk/lib/warnings.py?rev=20089&r1=20088&r2=20089&view=diff ============================================================================== --- trunk/lib/warnings.py (original) +++ trunk/lib/warnings.py Thu Jun 13 11:52:47 2013 @@ -113,10 +113,10 @@ # PDB warnings. ############### -# Zero length XH bond vector. +# Zero length interactomic vector. class RelaxZeroVectorWarning(BaseWarning): - def __init__(self, res): - self.text = "The XH bond vector for residue " + repr(res) + " is of zero length." + def __init__(self, spin_id1, spin_id2): + self.text = "The interatomic vector between the spins '%s' and '%s' is of zero length." % (spin_id1, spin_id2) # The atom is missing from the PDB file. Modified: trunk/pipe_control/interatomic.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/interatomic.py?rev=20089&r1=20088&r2=20089&view=diff ============================================================================== --- trunk/pipe_control/interatomic.py (original) +++ trunk/pipe_control/interatomic.py Thu Jun 13 11:52:47 2013 @@ -710,7 +710,7 @@ # Test for zero length. if norm_factor == 0.0: - warn(RelaxZeroVectorWarning(id)) + warn(RelaxZeroVectorWarning(spin_id1=interatom.spin_id1, spin_id2=interatom.spin_id2)) # Calculate the normalised vector. else: Modified: trunk/pipe_control/structure/main.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/structure/main.py?rev=20089&r1=20088&r2=20089&view=diff ============================================================================== --- trunk/pipe_control/structure/main.py (original) +++ trunk/pipe_control/structure/main.py Thu Jun 13 11:52:47 2013 @@ -976,6 +976,7 @@ # Get the bond info. bond_vectors, attached_name, warnings = cdp.structure.bond_vectors(attached_atom=attached, model_num=model, res_num=res_num, spin_name=spin.name, spin_num=spin.num, return_name=True, return_warnings=True) + id2 = generate_spin_id_unique(res_num=res_num, res_name=None, spin_name=spin.name) # No attached atom. if not bond_vectors: @@ -1005,7 +1006,7 @@ # Test for zero length. if norm_factor == 0.0: - warn(RelaxZeroVectorWarning(id)) + warn(RelaxZeroVectorWarning(spin_id1=id, spin_id2=id2)) # Calculate the normalised vector. else: