mailr22617 - in /branches/double_rotor/specific_analyses/frame_order: checks.py optimisation.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on March 31, 2014 - 16:23:
Author: bugman
Date: Mon Mar 31 16:23:19 2014
New Revision: 22617

URL: http://svn.gna.org/viewcvs/relax?rev=22617&view=rev
Log:
Shifted the frame order average domain position info check from the 
'optimisation' to 'checks' module.


Modified:
    branches/double_rotor/specific_analyses/frame_order/checks.py
    branches/double_rotor/specific_analyses/frame_order/optimisation.py

Modified: branches/double_rotor/specific_analyses/frame_order/checks.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/double_rotor/specific_analyses/frame_order/checks.py?rev=22617&r1=22616&r2=22617&view=diff
==============================================================================
--- branches/double_rotor/specific_analyses/frame_order/checks.py       
(original)
+++ branches/double_rotor/specific_analyses/frame_order/checks.py       Mon 
Mar 31 16:23:19 2014
@@ -26,8 +26,16 @@
 from warnings import warn
 
 # relax module imports.
-from lib.errors import RelaxNoValueError, RelaxSpinTypeError
+from lib.errors import RelaxError, RelaxNoValueError, RelaxSpinTypeError
 from lib.warnings import RelaxWarning
+
+
+def check_ave_domain_setup():
+    """Check that the average domain displacements have been set up."""
+
+    # Check for the pivot.
+    if not hasattr(cdp, 'ave_pos_pivot') or not hasattr(cdp, 
'ave_pos_translation'):
+        raise RelaxError("The mechanics of the average domain displacements 
have not been set up, please use the frame_order.average_position user 
function.")
 
 
 def check_rdcs(interatom, spin1, spin2):

Modified: branches/double_rotor/specific_analyses/frame_order/optimisation.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/double_rotor/specific_analyses/frame_order/optimisation.py?rev=22617&r1=22616&r2=22617&view=diff
==============================================================================
--- branches/double_rotor/specific_analyses/frame_order/optimisation.py 
(original)
+++ branches/double_rotor/specific_analyses/frame_order/optimisation.py Mon 
Mar 31 16:23:19 2014
@@ -39,7 +39,7 @@
 from pipe_control.interatomic import interatomic_loop
 from pipe_control.mol_res_spin import return_spin, spin_loop
 from pipe_control.structure.mass import pipe_centre_of_mass
-from specific_analyses.frame_order.checks import check_rdcs
+from specific_analyses.frame_order.checks import check_ave_domain_setup, 
check_rdcs
 from specific_analyses.frame_order.data import base_data_types, 
domain_moving, pivot_fixed, tensor_loop, translation_fixed
 from specific_analyses.frame_order.parameters import assemble_param_vector, 
assemble_scaling_matrix
 from target_functions import frame_order
@@ -620,8 +620,7 @@
     """
 
     # Check for the average domain displacement information.
-    if not hasattr(cdp, 'ave_pos_pivot') or not hasattr(cdp, 
'ave_pos_translation'):
-        raise RelaxError("The mechanics of the displacement to the average 
domain position have not been set up.")
+    check_ave_domain_setup()
 
     # Assemble the parameter vector.
     param_vector = assemble_param_vector(sim_index=sim_index)




Related Messages


Powered by MHonArc, Updated Mon Mar 31 23:40:02 2014