mailr17315 - /branches/frame_order_testing/generic_fns/align_tensor.py


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

Header


Content

Posted by edward on July 25, 2012 - 13:09:
Author: bugman
Date: Wed Jul 25 13:09:49 2012
New Revision: 17315

URL: http://svn.gna.org/viewcvs/relax?rev=17315&view=rev
Log:
Renamed get_ids() to get_align_ids() and created get_tensor_ids().

This is to allow the retrieval of either tensor or alignment IDs separately.


Modified:
    branches/frame_order_testing/generic_fns/align_tensor.py

Modified: branches/frame_order_testing/generic_fns/align_tensor.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/generic_fns/align_tensor.py?rev=17315&r1=17314&r2=17315&view=diff
==============================================================================
--- branches/frame_order_testing/generic_fns/align_tensor.py (original)
+++ branches/frame_order_testing/generic_fns/align_tensor.py Wed Jul 25 
13:09:49 2012
@@ -577,10 +577,10 @@
     return gdo
 
 
-def get_ids():
-    """Return the list of all alignment tensor IDs.
-
-    @return:        The list of all alignment tensors.
+def get_align_ids():
+    """Return the list of all alignment IDs.
+
+    @return:        The list of all alignment IDs.
     @rtype:         list of str
     """
 
@@ -594,6 +594,33 @@
 
     # The tensor IDs.
     return cdp.align_ids
+
+
+def get_tensor_ids():
+    """Return the list of all tensor IDs.
+
+    @return:        The list of all tensor IDs.
+    @rtype:         list of str
+    """
+
+    # Init.
+    ids = []
+
+    # No pipe.
+    if cdp == None:
+        return ids
+
+    # No tensor data.
+    if not hasattr(cdp, 'align_tensors'):
+        return ids
+
+    # Loop over the tensors.
+    for i in xrange(len(cdp.align_tensors)):
+        if cdp.align_tensors[i].name != None:
+            ids.append(cdp.align_tensors[i].name)
+
+    # Return the object.
+    return ids
 
 
 def get_tensor_index(tensor=None, align_id=None, pipe=None):




Related Messages


Powered by MHonArc, Updated Wed Jul 25 13:20:02 2012