mailr19081 - in /trunk: lib/frame_order/ pipe_control/ target_functions/frame_order/ test_suite/shared_data/frame_order/cam/ tes...


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

Header


Content

Posted by edward on March 23, 2013 - 20:51:
Author: bugman
Date: Sat Mar 23 20:51:12 2013
New Revision: 19081

URL: http://svn.gna.org/viewcvs/relax?rev=19081&view=rev
Log:
Renamed the pipe_control.frame_order module to lib.frame_order.format.


Added:
    trunk/lib/frame_order/format.py
      - copied unchanged from r19080, trunk/pipe_control/frame_order.py
Removed:
    trunk/pipe_control/frame_order.py
Modified:
    trunk/target_functions/frame_order/__init__.py
    trunk/test_suite/shared_data/frame_order/cam/generate_base.py
    
trunk/test_suite/shared_data/frame_order/cam/iso_cone_torsionless/frame_order_matrix.py
    
trunk/test_suite/shared_data/frame_order/cam/pseudo_ellipse_free_rotor/frame_order_matrix.py
    
trunk/test_suite/unit_tests/_target_functions/_frame_order/test_matrix_ops.py

Removed: trunk/pipe_control/frame_order.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/frame_order.py?rev=19080&view=auto
==============================================================================
--- trunk/pipe_control/frame_order.py (original)
+++ trunk/pipe_control/frame_order.py (removed)
@@ -1,127 +1,0 @@
-###############################################################################
-#                                                                            
 #
-# Copyright (C) 2009-2013 Edward d'Auvergne                                  
 #
-#                                                                            
 #
-# This file is part of the program relax (http://www.nmr-relax.com).         
 #
-#                                                                            
 #
-# This program is free software: you can redistribute it and/or modify       
 #
-# it under the terms of the GNU General Public License as published by       
 #
-# the Free Software Foundation, either version 3 of the License, or          
 #
-# (at your option) any later version.                                        
 #
-#                                                                            
 #
-# This program is distributed in the hope that it will be useful,            
 #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of             
 #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              
 #
-# GNU General Public License for more details.                               
 #
-#                                                                            
 #
-# You should have received a copy of the GNU General Public License          
 #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.      
 #
-#                                                                            
 #
-###############################################################################
-
-# Module docstring.
-"""Module containing functions related to the Frame Order theories."""
-
-# Python module imports.
-from numpy import array, matrix
-import sys
-
-# relax module imports.
-from lib.float import isNaN
-
-
-def print_frame_order_2nd_degree(daeg, name=None, epsilon=1e-15, 
integer=False, dot=False, comma=True, file=None):
-    """Nicely print out the Frame Order matrix of the 2nd degree.
-
-    @param daeg:        The 3D, rank-4 Frame Order matrix.
-    @type daeg:         numpy 3D, rank-4 array
-    @keyword name:      The name of the matrix.
-    @type name:         None or str
-    @keyword epsilon:   The minimum value, below which is considered zero.
-    @type epsilon:      float
-    @keyword integer:   A flag which if true will only print the integer 
part of the number.
-    @type integer:      bool
-    @keyword dot:       A flag which if true replaces all zeros with dot 
characters.
-    @type dot:          bool
-    @keyword comma:     A flag which if true causes commas to be printed 
between the elements.
-    @type comma:        bool
-    @keyword file:      The file object to write to.
-    @type file:         file object
-    """
-
-    # Default name.
-    if not name:
-        name = 'Frame Order matrix, 2nd degree'
-
-    # No file given, so send to STDOUT.
-    if file == None:
-        file = sys.stdout
-
-    # Header and first row start.
-    file.write("\n%s:\n" % name)
-    file.write('[[')
-
-    # Convert to an array, if necessary.
-    if isinstance(daeg, matrix):
-        daeg = array(daeg)
-
-    # Loop over the rows.
-    for i in range(len(daeg)):
-        # 2nd to last row start.
-        if i != 0:
-            file.write(' [')
-
-        # Row end character.
-        char2 = ''
-        if comma:
-            char2 = ','
-        if i == len(daeg) - 1:
-            char2 = ']'
-
-        # Loop over the columns.
-        for j in range(len(daeg[i])):
-            # Column end character.
-            char1 = ''
-            if comma:
-                char1 = ','
-            if j == len(daeg[i]) - 1:
-                char1 = ']%s\n' % char2
-
-            # Write out the elements.
-            if abs(daeg[i, j]) > epsilon:
-                # Integer printout.
-                if integer:
-                    val = int(daeg[i, j])
-                    format = "%4i%s"
-
-                # Float printout.
-                else:
-                    val = daeg[i, j]
-                    format = "%10.4f%s"
-
-            # NaN.
-            elif isNaN(daeg[i, j]):
-                val = 'NaN'
-                if integer:
-                    format = "%4i%s"
-                else:
-                    format = "%10s%s"
-
-            # Write out the zero elements.
-            else:
-                # Integer printout.
-                if integer:
-                    format = "%4s%s"
-
-                # Float printout.
-                else:
-                    format = "%10s%s"
-
-                # The character.
-                if dot:
-                    val = '.'
-                else:
-                    val = '0'
-
-            # Write.
-            file.write(format % (val, char1))

Modified: trunk/target_functions/frame_order/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/target_functions/frame_order/__init__.py?rev=19081&r1=19080&r2=19081&view=diff
==============================================================================
--- trunk/target_functions/frame_order/__init__.py (original)
+++ trunk/target_functions/frame_order/__init__.py Sat Mar 23 20:51:12 2013
@@ -30,7 +30,7 @@
 
 # relax module imports.
 from lib.float import isNaN
-from pipe_control.frame_order import print_frame_order_2nd_degree
+from lib.frame_order.format import print_frame_order_2nd_degree
 from extern.sobol.sobol_lib import i4_sobol
 from lib.alignment.alignment_tensor import to_5D, to_tensor
 from target_functions.chi2 import chi2

Modified: trunk/test_suite/shared_data/frame_order/cam/generate_base.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/shared_data/frame_order/cam/generate_base.py?rev=19081&r1=19080&r2=19081&view=diff
==============================================================================
--- trunk/test_suite/shared_data/frame_order/cam/generate_base.py (original)
+++ trunk/test_suite/shared_data/frame_order/cam/generate_base.py Sat Mar 23 
20:51:12 2013
@@ -31,7 +31,7 @@
 
 # relax module imports.
 from pipe_control.angles import wrap_angles
-from pipe_control.frame_order import print_frame_order_2nd_degree
+from lib.frame_order.format import print_frame_order_2nd_degree
 from pipe_control.mol_res_spin import spin_loop
 from pipe_control.interatomic import interatomic_loop
 from lib.geometry.coord_transform import cartesian_to_spherical

Modified: 
trunk/test_suite/shared_data/frame_order/cam/iso_cone_torsionless/frame_order_matrix.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/shared_data/frame_order/cam/iso_cone_torsionless/frame_order_matrix.py?rev=19081&r1=19080&r2=19081&view=diff
==============================================================================
--- 
trunk/test_suite/shared_data/frame_order/cam/iso_cone_torsionless/frame_order_matrix.py
 (original)
+++ 
trunk/test_suite/shared_data/frame_order/cam/iso_cone_torsionless/frame_order_matrix.py
 Sat Mar 23 20:51:12 2013
@@ -5,7 +5,7 @@
 
 # relax module imports.
 from lib.algebra.kronecker_product import kron_prod
-from pipe_control.frame_order import print_frame_order_2nd_degree
+from lib.frame_order.format import print_frame_order_2nd_degree
 
 
 # Load the matrices.

Modified: 
trunk/test_suite/shared_data/frame_order/cam/pseudo_ellipse_free_rotor/frame_order_matrix.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/shared_data/frame_order/cam/pseudo_ellipse_free_rotor/frame_order_matrix.py?rev=19081&r1=19080&r2=19081&view=diff
==============================================================================
--- 
trunk/test_suite/shared_data/frame_order/cam/pseudo_ellipse_free_rotor/frame_order_matrix.py
 (original)
+++ 
trunk/test_suite/shared_data/frame_order/cam/pseudo_ellipse_free_rotor/frame_order_matrix.py
 Sat Mar 23 20:51:12 2013
@@ -1,6 +1,6 @@
 from numpy import array, float64, zeros
 
-from pipe_control.frame_order import print_frame_order_2nd_degree
+from lib.frame_order.format import print_frame_order_2nd_degree
 from lib.algebra.kronecker_product import kron_prod
 
 

Modified: 
trunk/test_suite/unit_tests/_target_functions/_frame_order/test_matrix_ops.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/unit_tests/_target_functions/_frame_order/test_matrix_ops.py?rev=19081&r1=19080&r2=19081&view=diff
==============================================================================
--- 
trunk/test_suite/unit_tests/_target_functions/_frame_order/test_matrix_ops.py 
(original)
+++ 
trunk/test_suite/unit_tests/_target_functions/_frame_order/test_matrix_ops.py 
Sat Mar 23 20:51:12 2013
@@ -25,7 +25,7 @@
 from unittest import TestCase
 
 # relax module imports.
-from pipe_control.frame_order import print_frame_order_2nd_degree
+from lib.frame_order.format import print_frame_order_2nd_degree
 from lib.geometry.coord_transform import cartesian_to_spherical
 from target_functions.frame_order import *
 from lib.algebra.kronecker_product import transpose_23




Related Messages


Powered by MHonArc, Updated Sat Mar 23 21:00:02 2013