Package bmrblib :: Package experimental_details :: Module sample_conditions
[hide private]
[frames] | no frames]

Source Code for Module bmrblib.experimental_details.sample_conditions

  1  ############################################################################# 
  2  #                                                                           # 
  3  # The BMRB library.                                                         # 
  4  #                                                                           # 
  5  # Copyright (C) 2009-2011 Edward d'Auvergne                                 # 
  6  #                                                                           # 
  7  # This program is free software: you can redistribute it and/or modify      # 
  8  # it under the terms of the GNU General Public License as published by      # 
  9  # the Free Software Foundation, either version 3 of the License, or         # 
 10  # (at your option) any later version.                                       # 
 11  #                                                                           # 
 12  # This program is distributed in the hope that it will be useful,           # 
 13  # but WITHOUT ANY WARRANTY; without even the implied warranty of            # 
 14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             # 
 15  # GNU General Public License for more details.                              # 
 16  #                                                                           # 
 17  # You should have received a copy of the GNU General Public License         # 
 18  # along with this program.  If not, see <http://www.gnu.org/licenses/>.     # 
 19  #                                                                           # 
 20  ############################################################################# 
 21   
 22  # Module docstring. 
 23  """The model_free saveframe category (used to be called order_parameters). 
 24   
 25  For example, see http://www.bmrb.wisc.edu/dictionary/3.1html_frame/frame_SaveFramePage.html#order_parameters 
 26  """ 
 27   
 28  # relax module imports. 
 29  from bmrblib.base_classes import BaseSaveframe, TagCategory, TagCategoryFree 
 30   
 31   
32 -class SampleConditionsSaveframe(BaseSaveframe):
33 """The sample conditions saveframe class.""" 34 35 # Class variables. 36 sf_label = 'sample_conditions' 37
38 - def add_tag_categories(self):
39 """Create the v3.1 tag categories.""" 40 41 # The tag category objects. 42 self.tag_categories.append(SampleConditionList(self)) 43 self.tag_categories.append(SampleConditionCitation(self)) 44 self.tag_categories.append(SampleConditionVariable(self))
45 46
47 -class SampleConditionList(TagCategoryFree):
48 """Base class for the SampleConditionList tag category.""" 49
50 - def __init__(self, sf):
51 """Setup the SampleConditionList tag category. 52 53 @param sf: The saveframe object. 54 @type sf: saveframe instance 55 """ 56 57 # Initialise the baseclass. 58 super(SampleConditionList, self).__init__(sf) 59 60 # Add the tag info. 61 self.add(key='SampleConditionListID', var_name='count_str', format='int') 62 self.add(key='Details', var_name='details', format='str')
63 64 65
66 -class SampleConditionCitation(TagCategory):
67 """Base class for the SampleConditionCitation tag category.""" 68
69 - def __init__(self, sf):
70 """Setup the SampleConditionCitation tag category. 71 72 @param sf: The saveframe object. 73 @type sf: saveframe instance 74 """ 75 76 # Initialise the baseclass. 77 super(SampleConditionCitation, self).__init__(sf) 78 79 # Add the tag info. 80 self.add(key='CitationID', var_name='data_ids', format='int') 81 self.add(key='CitationLabel', var_name='citation_label', format='str') 82 self.add(key='SampleConditionListID', var_name='count_str', format='int')
83 84 85
86 -class SampleConditionVariable(TagCategory):
87 """Base class for the SampleConditionVariable tag category.""" 88
89 - def __init__(self, sf):
90 """Setup the SampleConditionVariable tag category. 91 92 @param sf: The saveframe object. 93 @type sf: saveframe instance 94 """ 95 96 # Initialise the baseclass. 97 super(SampleConditionVariable, self).__init__(sf) 98 99 # Add the tag info. 100 self.add(key='Type', var_name='type', format='str') 101 self.add(key='Val', var_name='value', format='str') 102 self.add(key='ValErr', var_name='error', format='str') 103 self.add(key='ValUnits', var_name='units', format='str') 104 self.add(key='SampleConditionListID', var_name='count_str', format='int')
105