mailr18942 - in /trunk: generic_fns/ prompt/ specific_fns/


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

Header


Content

Posted by edward on March 22, 2013 - 11:46:
Author: bugman
Date: Fri Mar 22 11:46:15 2013
New Revision: 18942

URL: http://svn.gna.org/viewcvs/relax?rev=18942&view=rev
Log:
Next block of the manual merger of the frame_order_testing branch.

The commands used were:
svn merge -r15024:15025 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
svn merge -r15025:15026 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
svn merge -r15026:15027 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
svn merge -r15027:15028 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
svn merge -r15028:15029 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .
svn merge -r15029:15030 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/branches/frame_order_testing .

Again much conflict resolution was required.


Added:
    trunk/generic_fns/domain.py
      - copied unchanged from r15028, 
branches/frame_order_testing/generic_fns/domain.py
    trunk/prompt/domain.py
      - copied unchanged from r15027, 
branches/frame_order_testing/prompt/domain.py
Modified:
    trunk/generic_fns/__init__.py
    trunk/generic_fns/align_tensor.py
    trunk/specific_fns/frame_order.py

Modified: trunk/generic_fns/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/generic_fns/__init__.py?rev=18942&r1=18941&r2=18942&view=diff
==============================================================================
--- trunk/generic_fns/__init__.py (original)
+++ trunk/generic_fns/__init__.py Fri Mar 22 11:46:15 2013
@@ -30,6 +30,7 @@
             'dasha',
             'diffusion_tensor',
             'dipole_pair',
+            'domain',
             'eliminate',
             'exp_info',
             'fix',

Modified: trunk/generic_fns/align_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/generic_fns/align_tensor.py?rev=18942&r1=18941&r2=18942&view=diff
==============================================================================
--- trunk/generic_fns/align_tensor.py (original)
+++ trunk/generic_fns/align_tensor.py Fri Mar 22 11:46:15 2013
@@ -34,7 +34,6 @@
 from data.align_tensor import AlignTensorList
 from generic_fns.angles import wrap_angles
 from generic_fns import pipes
-from generic_fns.mol_res_spin import spin_loop
 from physical_constants import g1H, h_bar, kB, mu0, return_gyromagnetic_ratio
 from relax_errors import RelaxError, RelaxNoTensorError, RelaxStrError, 
RelaxTensorError, RelaxUnknownParamCombError, RelaxUnknownParamError
 from relax_io import write_data
@@ -1842,16 +1841,18 @@
 """
 
 
-def set_domain(tensor=None, domain=None, spin_id=None):
+def set_domain(tensor=None, domain=None):
     """Set the domain label for the given tensor.
 
-    @param tensor:      The alignment tensor label.
-    @type tensor:       str
-    @param domain:      The domain label.
-    @type domain:       str
-    @keyword spin_id:   The spin ID string.
-    @type spin_id:      None or str
-    """
+    @param tensor:  The alignment tensor label.
+    @type tensor:   str
+    @param domain:  The domain label.
+    @type domain:   str
+    """
+
+    # Check that the domain is defined.
+    if not hasattr(cdp, 'domain') or domain not in cdp.domain.keys():
+        raise RelaxError("The domain '%s' has not been defined.  Please use 
the domain user function." % domain)
 
     # Test if alignment tensor data exists.
     if not hasattr(cdp, 'align_tensors') or len(cdp.align_tensors) == 0 or 
not hasattr(cdp, 'align_ids'):
@@ -1869,16 +1870,6 @@
     if not match:
         raise RelaxNoTensorError('alignment', tensor)
 
-    # Label the spins by domain.
-    if spin_id != None:
-        for spin in spin_loop(spin_id):
-            # Initialise.
-            if not hasattr(spin, 'domain'):
-                spin.domain = {}
-
-            # Set the domain.
-            spin.domain[tensor] = domain
-
 
 def svd(basis_set=0, tensors=None):
     """Function for calculating the singular values of all the loaded 
tensors.

Modified: trunk/specific_fns/frame_order.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_fns/frame_order.py?rev=18942&r1=18941&r2=18942&view=diff
==============================================================================
--- trunk/specific_fns/frame_order.py (original)
+++ trunk/specific_fns/frame_order.py Fri Mar 22 11:46:15 2013
@@ -961,6 +961,10 @@
 
         # Test if the current data pipe exists.
         pipes.test()
+
+        # Check that the domain is defined.
+        if not hasattr(cdp, 'domain') or domain not in cdp.domain.keys():
+            raise RelaxError("The domain '%s' has not been defined.  Please 
use the domain user function." % domain)
 
         # Test if the reference domain exists.
         exists = False
@@ -1322,23 +1326,17 @@
         @type sim_index:    None or int
         """
 
-        # Assemble the parameter vector.
-        param_vector = self._assemble_param_vector()
-
-        # Get the data structures for optimisation using the tensors as base 
data sets.
-        full_tensors, red_tensors, red_tensor_err, full_in_ref_frame = 
self._minimise_setup_tensors()
-
-        # Set up the optimisation function.
-        target = frame_order.Frame_order(model=cdp.model, 
full_tensors=full_tensors, red_tensors=red_tensors, 
red_errors=red_tensor_err, full_in_ref_frame=full_in_ref_frame)
+        # Set up the target function for direct calculation.
+        model, param_vector, data_types, scaling_matrix = 
self._target_fn_setup(sim_index=sim_index)
 
         # Make a single function call.  This will cause back calculation and 
the data will be stored in the class instance.
-        chi2 = target.func(param_vector)
+        chi2 = model.func(param_vector)
 
         # Set the chi2.
         cdp.chi2 = chi2
 
         # Store the back-calculated tensors.
-        self._store_bc_tensors(target)
+        self._store_bc_tensors(model)
 
 
     def create_mc_data(self, data_id=None):




Related Messages


Powered by MHonArc, Updated Fri Mar 22 12:00:03 2013