mailr8846 - in /branches/bmrb/bmrblib: kinetics/heteronucl_T1_relaxation.py tag_category.py


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

Header


Content

Posted by edward on February 22, 2009 - 13:40:
Author: bugman
Date: Sun Feb 22 13:40:08 2009
New Revision: 8846

URL: http://svn.gna.org/viewcvs/relax?rev=8846&view=rev
Log:
Further object simplifications.

The __init__() methods have been shifted into the TagCategory base class in 
bmrblib.tag_category.


Added:
    branches/bmrb/bmrblib/tag_category.py
Modified:
    branches/bmrb/bmrblib/kinetics/heteronucl_T1_relaxation.py

Modified: branches/bmrb/bmrblib/kinetics/heteronucl_T1_relaxation.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/bmrblib/kinetics/heteronucl_T1_relaxation.py?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- branches/bmrb/bmrblib/kinetics/heteronucl_T1_relaxation.py (original)
+++ branches/bmrb/bmrblib/kinetics/heteronucl_T1_relaxation.py Sun Feb 22 
13:40:08 2009
@@ -27,6 +27,7 @@
 """
 
 # relax module imports.
+from bmrblib.tag_category import TagCategory
 from pystarlib.SaveFrame import SaveFrame
 from pystarlib.TagTable import TagTable
 
@@ -112,7 +113,7 @@
 
 
 
-class HeteronuclT1List:
+class HeteronuclT1List(TagCategory):
     """Base class for the HeteronuclT1List tag category."""
 
     # Tag category label.
@@ -127,17 +128,6 @@
 
     # Class variables.
     coherence = 'Nz'
-
-
-    def __init__(self, sf):
-        """Initialise the tag category object, placing the saveframe into 
its namespace.
-
-        @param sf:  The heteronuclear T1 saveframe object.
-        @type sf:   HeteronuclT1Saveframe instance
-        """
-
-        # Place the saveframe into the namespace.
-        self.sf = sf
 
 
     def create(self):
@@ -161,7 +151,7 @@
 
 
 
-class HeteronuclT1Experiment:
+class HeteronuclT1Experiment(TagCategory):
     """Base class for the HeteronuclT1Experiment tag category."""
 
     # Tag category label.
@@ -169,17 +159,6 @@
 
     # Tag names for experiment setup.
     SampleLabel = '_Sample_label'
-
-
-    def __init__(self, sf):
-        """Initialise the tag category object, placing the saveframe into 
its namespace.
-
-        @param sf:  The heteronuclear T1 saveframe object.
-        @type sf:   HeteronuclT1Saveframe instance
-        """
-
-        # Place the saveframe into the namespace.
-        self.sf = sf
 
 
     def create(self, frame=None):
@@ -195,22 +174,11 @@
 
 
 
-class HeteronuclT1Software:
+class HeteronuclT1Software(TagCategory):
     """Base class for the HeteronuclT1Software tag category."""
 
     # Tag category label.
     HeteronuclT1Software = None
-
-
-    def __init__(self, sf):
-        """Initialise the tag category object, placing the saveframe into 
its namespace.
-
-        @param sf:  The heteronuclear T1 saveframe object.
-        @type sf:   HeteronuclT1Saveframe instance
-        """
-
-        # Place the saveframe into the namespace.
-        self.sf = sf
 
 
     def create(self):

Added: branches/bmrb/bmrblib/tag_category.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/bmrb/bmrblib/tag_category.py?rev=8846&view=auto
==============================================================================
--- branches/bmrb/bmrblib/tag_category.py (added)
+++ branches/bmrb/bmrblib/tag_category.py Sun Feb 22 13:40:08 2009
@@ -1,0 +1,37 @@
+###############################################################################
+#                                                                            
 #
+# Copyright (C) 2009 Edward d'Auvergne                                       
 #
+#                                                                            
 #
+# This file is part of the program relax.                                    
 #
+#                                                                            
 #
+# relax 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 2 of the License, or          
 #
+# (at your option) any later version.                                        
 #
+#                                                                            
 #
+# relax 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 relax; if not, write to the Free Software                       
 #
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
 #
+#                                                                            
 #
+###############################################################################
+
+# Module docstring.
+"""The TagCategory base class."""
+
+class TagCategory:
+    """The base class for tag category classes."""
+
+    def __init__(self, sf):
+        """Initialise the tag category object, placing the saveframe into 
its namespace.
+
+        @param sf:  The saveframe object.
+        @type sf:   saveframe instance
+        """
+
+        # Place the saveframe into the namespace.
+        self.sf = sf




Related Messages


Powered by MHonArc, Updated Sun Feb 22 14:00:02 2009