mailr9907 - in /1.3: data/mol_res_spin.py specific_fns/api_base.py specific_fns/relax_fit.py


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

Header


Content

Posted by edward on November 24, 2009 - 12:18:
Author: bugman
Date: Tue Nov 24 12:18:58 2009
New Revision: 9907

URL: http://svn.gna.org/viewcvs/relax?rev=9907&view=rev
Log:
Added data_names() to the specific analysis API.

General docstring clean ups as well.


Modified:
    1.3/data/mol_res_spin.py
    1.3/specific_fns/api_base.py
    1.3/specific_fns/relax_fit.py

Modified: 1.3/data/mol_res_spin.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/data/mol_res_spin.py?rev=9907&r1=9906&r2=9907&view=diff
==============================================================================
--- 1.3/data/mol_res_spin.py (original)
+++ 1.3/data/mol_res_spin.py Tue Nov 24 12:18:58 2009
@@ -31,7 +31,7 @@
 from float import floatAsByteArray
 import generic_fns
 from prototype import Prototype
-from relax_errors import RelaxError, RelaxFromXMLNotEmptyError
+from relax_errors import RelaxError, RelaxFromXMLNotEmptyError, 
RelaxImplementError
 from relax_xml import fill_object_contents, xml_to_object
 import specific_fns
 
@@ -234,7 +234,7 @@
 
             # Get the spin specific object names and loop over them to get 
their descriptions.
             object_info = []
-            if data_names:
+            try:
                 for name in data_names(error_names=True, sim_names=True):
                     # Get the description.
                     if return_data_desc:
@@ -244,6 +244,8 @@
 
                     # Append the two.
                     object_info.append([name, desc])
+            except RelaxImplementError:
+                pass
 
             # Add the ordered objects.
             blacklist = []

Modified: 1.3/specific_fns/api_base.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/specific_fns/api_base.py?rev=9907&r1=9906&r2=9907&view=diff
==============================================================================
--- 1.3/specific_fns/api_base.py (original)
+++ 1.3/specific_fns/api_base.py Tue Nov 24 12:18:58 2009
@@ -39,15 +39,9 @@
 
         This default method simply loops over the spins, returning the spin 
identification string.
 
-        Specific implementations of this generator method are free to yield 
any type of data.  The
-        data which is yielded is then passed into the specific functions 
such as return_data(),
-        return_error(), create_mc_data(), pack_sim_data(), etc., so these 
methods should handle the
-        data thrown at them.  If multiple data is yielded, this is caught as 
a tuple and passed into
-        the dependent methods as a tuple.
-
-        @return:    Information concerning the base data of the analysis.  
For this base class
-                    method, the loop is over the spins and the yielded value 
is the spin
-                    identification string.
+        Specific implementations of this generator method are free to yield 
any type of data.  The data which is yielded is then passed into the specific 
functions such as return_data(), return_error(), create_mc_data(), 
pack_sim_data(), etc., so these methods should handle the data thrown at 
them.  If multiple data is yielded, this is caught as a tuple and passed into 
the dependent methods as a tuple.
+
+        @return:    Information concerning the base data of the analysis.  
For this base class method, the loop is over the spins and the yielded value 
is the spin identification string.
         @rtype:     anything
         """
 
@@ -79,8 +73,7 @@
     def create_mc_data(self, spin_id=None):
         """Prototype method for creating the Monte Carlo data.
 
-        @param spin_id: The spin identification string, as yielded by the 
base_data_loop() generator
-                        method.
+        @param spin_id: The spin identification string, as yielded by the 
base_data_loop() generator method.
         @type spin_id:  str
         @return:        The Monte Carlo data.
         @rtype:         list of floats
@@ -93,9 +86,28 @@
     def data_init(self, spin):
         """Dummy method for initialising the spin specific data structures.
 
+        This method does nothing!
+
         @param spin:    The spin data container.
         @type spin:     SpinContainer instance
         """
+
+
+    def data_names(self, set='all', error_names=False, sim_names=False):
+        """Prototype method for returning a list of names of data structures.
+
+        @keyword set:           The set of object names to return.  This can 
be set to 'all' for all names, to 'generic' for generic object names, 
'params' for analysis specific parameter names, or to 'min' for minimisation 
specific object names.
+        @type set:              str
+        @keyword error_names:   A flag which if True will add the error 
object names as well.
+        @type error_names:      bool
+        @keyword sim_names:     A flag which if True will add the Monte 
Carlo simulation object names as well.
+        @type sim_names:        bool
+        @return:                The list of object names.
+        @rtype:                 list of str
+        """
+
+        # Not implemented.
+        raise RelaxImplementError
 
 
     def eliminate(self):

Modified: 1.3/specific_fns/relax_fit.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/specific_fns/relax_fit.py?rev=9907&r1=9906&r2=9907&view=diff
==============================================================================
--- 1.3/specific_fns/relax_fit.py (original)
+++ 1.3/specific_fns/relax_fit.py Tue Nov 24 12:18:58 2009
@@ -226,7 +226,7 @@
 
 
     def data_names(self, set='all', error_names=False, sim_names=False):
-        """Function for returning a list of names of data structures.
+        """Return a list of names of data structures.
 
         Description
         ===========
@@ -245,15 +245,11 @@
             - 'warning', minimisation warning.
 
 
-        @keyword set:           The set of object names to return.  This can 
be set to 'all' for all
-                                names, to 'generic' for generic object 
names, 'params' for
-                                model-free parameter names, or to 'min' for 
minimisation specific
-                                object names.
+        @keyword set:           The set of object names to return.  This can 
be set to 'all' for all names, to 'generic' for generic object names, 
'params' for analysis specific parameter names, or to 'min' for minimisation 
specific object names.
         @type set:              str
         @keyword error_names:   A flag which if True will add the error 
object names as well.
         @type error_names:      bool
-        @keyword sim_names:     A flag which if True will add the Monte 
Carlo simulation object
-                                names as well.
+        @keyword sim_names:     A flag which if True will add the Monte 
Carlo simulation object names as well.
         @type sim_names:        bool
         @return:                The list of object names.
         @rtype:                 list of str




Related Messages


Powered by MHonArc, Updated Tue Nov 24 12:40:01 2009