mailr6000 - /1.3/prompt/spin.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on April 25, 2008 - 11:29:
Author: bugman
Date: Fri Apr 25 11:29:34 2008
New Revision: 6000

URL: http://svn.gna.org/viewcvs/relax?rev=6000&view=rev
Log:
Renamed the spin.rename() and spin.renumber() user fns to spin.name() and 
spin.number().


Modified:
    1.3/prompt/spin.py

Modified: 1.3/prompt/spin.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/spin.py?rev=6000&r1=5999&r2=6000&view=diff
==============================================================================
--- 1.3/prompt/spin.py (original)
+++ 1.3/prompt/spin.py Fri Apr 25 11:29:34 2008
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2007 Edward d'Auvergne                                       
 #
+# Copyright (C) 2007-2008 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -222,21 +222,21 @@
         spin.display(spin_id=spin_id)
 
 
-    def rename(self, spin_id=None, new_name=None):
-        """Function for renaming an existent spin(s).
+    def name(self, spin_id=None, name=None):
+        """Function for naming spins.
 
         Keyword Arguments
         ~~~~~~~~~~~~~~~~~
 
         spin_id:  The spin identification string corresponding to one or 
more spins.
 
-        new_name:  The new name.
-
-
-        Description
-        ~~~~~~~~~~~
-
-        This function simply allows spins to be renamed.
+        name:  The new name.
+
+
+        Description
+        ~~~~~~~~~~~
+
+        This function simply allows spins to be named (or renamed).
 
 
         Examples
@@ -245,16 +245,16 @@
         The following sequence of commands will rename the sequence {1 C1, 2 
C2, 3 C3} to {1 C11,
         2 C12, 3 C13}:
 
-        relax> spin.rename('@1', 'C11')
-        relax> spin.rename('@2', 'C12')
-        relax> spin.rename('@3', 'C13')
-        """
-
-        # Function intro text.
-        if self.__relax__.interpreter.intro:
-            text = sys.ps3 + "spin.rename("
+        relax> spin.name('@1', 'C11')
+        relax> spin.name('@2', 'C12')
+        relax> spin.name('@3', 'C13')
+        """
+
+        # Function intro text.
+        if self.__relax__.interpreter.intro:
+            text = sys.ps3 + "spin.name("
             text = text + "spin_id=" + `spin_id`
-            text = text + ", new_name=" + `new_name` + ")"
+            text = text + ", name=" + `name` + ")"
             print text
 
         # Spin identification string.
@@ -262,29 +262,29 @@
             raise RelaxStrError, ('spin identification string', spin_id)
 
         # New spin name.
-        if type(new_name) != str:
-            raise RelaxStrError, ('new spin name', new_name)
-
-        # Execute the functional code.
-        spin.rename(spin_id=spin_id, new_name=new_name)
-
-
-    def renumber(self, spin_id=None, new_number=None):
-        """Function for renumbering an existent spin.
+        if type(name) != str:
+            raise RelaxStrError, ('new spin name', name)
+
+        # Execute the functional code.
+        spin.rename(spin_id=spin_id, name=name)
+
+
+    def number(self, spin_id=None, number=None):
+        """Function for numbering spins.
 
         Keyword Arguments
         ~~~~~~~~~~~~~~~~~
 
         spin_id:  The spin identification string corresponding to a single 
spin.
 
-        new_number:  The new spin number.
-
-
-        Description
-        ~~~~~~~~~~~
-
-        This function simply allows spins to be renumbered.  The new number 
cannot correspond to
-        an existing spin number (for that residue or that molecule).
+        number:  The new spin number.
+
+
+        Description
+        ~~~~~~~~~~~
+
+        This function simply allows spins to be numbered.  The new number 
cannot correspond to
+        an existing spin number.
 
 
         Examples
@@ -293,17 +293,17 @@
         The following sequence of commands will renumber the sequence {1 C1, 
2 C2, 3 C3} to
         {-1 C1, -2 C2, -3 C3}:
 
-        relax> spin.renumber('@1', -1)
-        relax> spin.renumber('@2', -2)
-        relax> spin.renumber('@3', -3)
-
-        """
-
-        # Function intro text.
-        if self.__relax__.interpreter.intro:
-            text = sys.ps3 + "spin.renumber("
+        relax> spin.number('@1', -1)
+        relax> spin.number('@2', -2)
+        relax> spin.number('@3', -3)
+
+        """
+
+        # Function intro text.
+        if self.__relax__.interpreter.intro:
+            text = sys.ps3 + "spin.number("
             text = text + "spin_id=" + `spin_id`
-            text = text + ", new_number=" + `new_number` + ")"
+            text = text + ", number=" + `number` + ")"
             print text
 
         # Spin identification string.
@@ -311,11 +311,11 @@
             raise RelaxStrError, ('spin identification string', spin_id)
 
         # New spin number.
-        if type(new_number) != int:
-            raise RelaxIntError, ('new spin number', new_number)
-
-        # Execute the functional code.
-        spin.renumber(spin_id=spin_id, new_number=new_number)
+        if type(number) != int:
+            raise RelaxIntError, ('new spin number', number)
+
+        # Execute the functional code.
+        spin.number(spin_id=spin_id, number=number)
 
 
 
@@ -327,5 +327,5 @@
     create.__doc__ = create.__doc__ + "\n\n" + id_string_doc + "\n"
     delete.__doc__ = delete.__doc__ + "\n\n" + id_string_doc + "\n"
     display.__doc__ = display.__doc__ + "\n\n" + id_string_doc + "\n"
-    rename.__doc__ = rename.__doc__ + "\n\n" + id_string_doc + "\n"
-    renumber.__doc__ = renumber.__doc__ + "\n\n" + id_string_doc + "\n"
+    name.__doc__ = name.__doc__ + "\n\n" + id_string_doc + "\n"
+    number.__doc__ = number.__doc__ + "\n\n" + id_string_doc + "\n"




Related Messages


Powered by MHonArc, Updated Fri Apr 25 11:40:24 2008