Author: bugman Date: Sat Jul 5 15:50:41 2008 New Revision: 6746 URL: http://svn.gna.org/viewcvs/relax?rev=6746&view=rev Log: Converted the fix() user function interface to the new design. Modified: 1.3/prompt/fix.py Modified: 1.3/prompt/fix.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/fix.py?rev=6746&r1=6745&r2=6746&view=diff ============================================================================== --- 1.3/prompt/fix.py (original) +++ 1.3/prompt/fix.py Sat Jul 5 15:50:41 2008 @@ -1,6 +1,6 @@ ############################################################################### # # -# Copyright (C) 2003, 2004 Edward d'Auvergne # +# Copyright (C) 2003, 2004, 2008 Edward d'Auvergne # # # # This file is part of the program relax. # # # @@ -35,8 +35,8 @@ self.relax = relax - def fix(self, element=None, fixed=1): - """Function for either fixing or allowing parameter values to change. + def fix(self, element=None, fixed=True): + """Function for either fixing or allowing parameter values to change during optimisation. Keyword Arguments ~~~~~~~~~~~~~~~~~ @@ -63,11 +63,8 @@ 'all_res'. - The flag 'fixed', if set to 1, will fix parameters, while a value of 0 will allow parameters - to vary. - - - Only current parameters will be affected. + The flag 'fixed', if set to True, will fix parameters during optimisation whereas a value of + False will allow parameters to vary. """ # Function intro text. @@ -82,8 +79,8 @@ raise RelaxIntStrError, ('element', element) # The fixed argument. - if type(fixed) != int or (fixed != 0 and fixed != 1): - raise RelaxBinError, ('fixed', fixed) + if type(fixed) != bool: + raise RelaxBoolError, ('fixed', fixed) # Execute the functional code. fix.fix(element=element, fixed=fixed)