Author: bugman Date: Thu Mar 5 15:05:28 2015 New Revision: 27784 URL: http://svn.gna.org/viewcvs/relax?rev=27784&view=rev Log: Improved the RelaxError message from the RDC assembly function when unit vectors are None. Modified: trunk/pipe_control/rdc.py Modified: trunk/pipe_control/rdc.py URL: http://svn.gna.org/viewcvs/relax/trunk/pipe_control/rdc.py?rev=27784&r1=27783&r2=27784&view=diff ============================================================================== --- trunk/pipe_control/rdc.py (original) +++ trunk/pipe_control/rdc.py Thu Mar 5 15:05:28 2015 @@ -1145,6 +1145,12 @@ # Calculate the RDC dipolar constant (in Hertz, and the 3 comes from the alignment tensor), and append it to the list. rdc_const.append(3.0/(2.0*pi) * dipolar_constant(g1, g2, interatom.r)) + # Sanity check, to prevent cryptic Python errors. + indices = [] + for i in range(len(unit_vect[-1])): + if unit_vect[-1][i] == None: + raise RelaxError("Unit vectors of None have been detected between the spins '%s' and '%s' %s." % (interatom.spin_id1, interatom.spin_id2, unit_vect[-1])) + # Store the measured J coupling. if opt_uses_j_couplings(): j_couplings.append(interatom.j_coupling) @@ -1152,11 +1158,6 @@ # Fix the unit vector data structure. num = None for rdc_index in range(len(unit_vect)): - # Sanity check, to prevent cryptic Python errors. - for i in range(len(unit_vect[rdc_index])): - if unit_vect[rdc_index][i] == None: - raise RelaxError("Unit vectors of None have been detected.") - # Convert to numpy structures. unit_vect[rdc_index] = array(unit_vect[rdc_index], float64)