mailr15174 - /branches/spec_api/specific_fns/api_objects.py


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

Header


Content

Posted by edward on January 18, 2012 - 16:43:
Author: bugman
Date: Wed Jan 18 16:43:54 2012
New Revision: 15174

URL: http://svn.gna.org/viewcvs/relax?rev=15174&view=rev
Log:
Created the Param_list.get_units() method for returning the units 
corresponding to the parameter.


Modified:
    branches/spec_api/specific_fns/api_objects.py

Modified: branches/spec_api/specific_fns/api_objects.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/spec_api/specific_fns/api_objects.py?rev=15174&r1=15173&r2=15174&view=diff
==============================================================================
--- branches/spec_api/specific_fns/api_objects.py (original)
+++ branches/spec_api/specific_fns/api_objects.py Wed Jan 18 16:43:54 2012
@@ -106,3 +106,20 @@
 
         # Return the value.
         return self.grace_string[name]
+
+
+    def get_units(self, name):
+        """Return the units string for the parameter.
+
+        @param name:    The name of the parameter.
+        @type name:     str
+        @return:        The units string.
+        @rtype:         str
+        """
+
+        # Check.
+        if name not in self.names:
+            raise RelaxError("The parameter '%s' does not exist." % name)
+
+        # Return the value.
+        return self.units[name]




Related Messages


Powered by MHonArc, Updated Wed Jan 18 17:00:01 2012