Package pipe_control :: Module domain
[hide private]
[frames] | no frames]

Source Code for Module pipe_control.domain

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2011 Edward d'Auvergne                                        # 
 4  #                                                                             # 
 5  # This file is part of the program relax (http://www.nmr-relax.com).          # 
 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  """Module containing the structural domain related functions.""" 
24   
25   
26 -def define(id=None, spin_id=None):
27 """Define the domain. 28 29 @keyword id: The domain ID string. 30 @type id: str 31 @keyword spin_id: The spin ID string for all atoms of the domain. 32 @type spin_id: str 33 """ 34 35 # Initialise the data structure if needed. 36 if not hasattr(cdp, 'domain'): 37 cdp.domain = {} 38 39 # Store the domain info. 40 cdp.domain[id] = spin_id
41 42
43 -def get_domain_ids():
44 """Return the list of all domain ID strings. 45 46 @return: The list of all domain IDs. 47 @rtype: list of str 48 """ 49 50 # No pipe. 51 if cdp == None: 52 return [] 53 54 # No domain data. 55 if not hasattr(cdp, 'domain'): 56 return [] 57 58 # The domain IDs, sorted. 59 ids = sorted(cdp.domain.keys()) 60 return ids
61