Author: bugman Date: Thu Apr 10 14:36:03 2008 New Revision: 5551 URL: http://svn.gna.org/viewcvs/relax?rev=5551&view=rev Log: Changed the flag args of the structre.create_vect_dist() user function to bools. The flags args have been shifted to the end as well. Modified: 1.3/prompt/structure.py Modified: 1.3/prompt/structure.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/structure.py?rev=5551&r1=5550&r2=5551&view=diff ============================================================================== --- 1.3/prompt/structure.py (original) +++ 1.3/prompt/structure.py Thu Apr 10 14:36:03 2008 @@ -167,7 +167,7 @@ generic_fns.structure.geometric.create_diff_tensor_pdb(scale=scale, file=file, dir=dir, force=force) - def create_vector_dist(self, length=2e-9, symmetry=1, file='XH_dist.pdb', dir=None, force=0): + def create_vector_dist(self, length=2e-9, file='XH_dist.pdb', dir=None, symmetry=True, force=False): """Create a PDB file representation of the distribution of XH bond vectors. Keyword Arguments @@ -175,14 +175,14 @@ length: The length of the vectors in the PDB representation (meters). - symmetry: A flag which, if set to 1, will create a second chain with reversed XH bond + file: The name of the PDB file. + + dir: The directory to place the file into. + + symmetry: A flag which if True will create a second chain with reversed XH bond orientations. - file: The name of the PDB file. - - dir: The directory to place the file into. - - force: A flag which, if set to 1, will overwrite the file if it already exists. + force: A flag which if True will overwrite the file if it already exists. Description @@ -203,9 +203,9 @@ if self.__relax__.interpreter.intro: text = sys.ps3 + "structure.create_vector_dist(" text = text + "length=" + `length` - text = text + ", symmetry=" + `symmetry` text = text + ", file=" + `file` text = text + ", dir=" + `dir` + text = text + ", symmetry=" + `symmetry` text = text + ", force=" + `force` + ")" print text @@ -213,10 +213,6 @@ if type(length) != float: raise RelaxFloatError, ('vector length', length) - # The symmetry flag. - if type(symmetry) != int or (symmetry != 0 and symmetry != 1): - raise RelaxBinError, ('symmetry flag', symmetry) - # File name. if type(file) != str: raise RelaxStrError, ('file name', file) @@ -225,9 +221,13 @@ if dir != None and type(dir) != str: raise RelaxNoneStrError, ('directory name', dir) + # The symmetry flag. + if type(symmetry) != bool: + raise RelaxBoolError, ('symmetry flag', symmetry) + # The force flag. - if type(force) != int or (force != 0 and force != 1): - raise RelaxBinError, ('force flag', force) + if type(force) != bool: + raise RelaxBoolError, ('force flag', force) # Execute the functional code. generic_fns.structure.geometric.create_vector_dist(length=length, symmetry=symmetry, file=file, dir=dir, force=force)