Package user_functions :: Module fix'
[hide private]
[frames] | no frames]

Source Code for Module user_functions.fix'

 1  ############################################################################### 
 2  #                                                                             # 
 3  # Copyright (C) 2003-2012 Edward d'Auvergne                                   # 
 4  #                                                                             # 
 5  # This file is part of the program relax.                                     # 
 6  #                                                                             # 
 7  # relax 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 2 of the License, or           # 
10  # (at your option) any later version.                                         # 
11  #                                                                             # 
12  # relax 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 relax; if not, write to the Free Software                        # 
19  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA   # 
20  #                                                                             # 
21  ############################################################################### 
22   
23  # Module docstring. 
24  """The fix user function definitions.""" 
25   
26  # relax module imports. 
27  from generic_fns import fix 
28  from graphics import WIZARD_IMAGE_PATH 
29  from user_functions.data import Uf_info; uf_info = Uf_info() 
30  from user_functions.objects import Desc_container 
31   
32   
33  # The fix user function. 
34  uf = uf_info.add_uf('fix') 
35  uf.title = "Fix or allow parameter values to change during optimisation." 
36  uf.title_short = "Fixing of parameters." 
37  uf.display = True 
38  uf.add_keyarg( 
39      name = "element", 
40      py_type = "str", 
41      desc_short = "element", 
42      desc = "Which element to fix.", 
43      wiz_element_type = "combo", 
44      wiz_combo_choices = [ 
45          "Diffusion tensor parameters", 
46          "All parameters from all spins", 
47          "All parameters (diffusion and spin)"], 
48      wiz_combo_data = [ 
49          "diff", 
50          "all_spins", 
51          "all"], 
52      wiz_read_only = True, 
53  ) 
54  uf.add_keyarg( 
55      name = "fixed", 
56      default = True, 
57      py_type = "bool", 
58      desc_short = "fixed", 
59      desc = "A flag specifying if the parameters should be fixed or allowed to change." 
60  ) 
61  # Description. 
62  uf.desc.append(Desc_container()) 
63  uf.desc[-1].add_paragraph("The element can be any of the following:") 
64  uf.desc[-1].add_item_list_element("'diff'", "The diffusion tensor parameters.  This will allow all diffusion tensor parameters to be toggled.") 
65  uf.desc[-1].add_item_list_element("'all_spins'", "Using this keyword, all parameters from all spins will be toggled.") 
66  uf.desc[-1].add_item_list_element("'all'", "All parameters will be toggled.  This is equivalent to combining both 'diff' and 'all_spins'.") 
67  uf.desc[-1].add_paragraph("The flag 'fixed', if set to True, will fix parameters during optimisation whereas a value of False will allow parameters to vary.") 
68  uf.backend = fix.fix 
69  uf.menu_text = "&fix" 
70  uf.gui_icon = "oxygen.status.object-locked" 
71  uf.wizard_height_desc = 400 
72  uf.wizard_size = (800, 600) 
73  uf.wizard_apply_button = False 
74  uf.wizard_image = WIZARD_IMAGE_PATH + 'object-locked-unlocked.png' 
75