mailr4427 - in /1.3: generic_fns/nuclei.py prompt/grace.py prompt/interpreter.py prompt/nuclei.py


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

Header


Content

Posted by edward on January 07, 2008 - 15:39:
Author: bugman
Date: Mon Jan  7 15:26:46 2008
New Revision: 4427

URL: http://svn.gna.org/viewcvs/relax?rev=4427&view=rev
Log:
Removed all of the modules for setting the nucleus type.

This has been shifted into the value.set() user function instead.


Removed:
    1.3/generic_fns/nuclei.py
    1.3/prompt/nuclei.py
Modified:
    1.3/prompt/grace.py
    1.3/prompt/interpreter.py

Removed: 1.3/generic_fns/nuclei.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/nuclei.py?rev=4426&view=auto
==============================================================================
--- 1.3/generic_fns/nuclei.py (original)
+++ 1.3/generic_fns/nuclei.py (removed)
@@ -1,93 +1,0 @@
-###############################################################################
-#                                                                            
 #
-# Copyright (C) 2003-2004, 2007 Edward d'Auvergne                            
 #
-#                                                                            
 #
-# This file is part of the program relax.                                    
 #
-#                                                                            
 #
-# relax is free software; you can redistribute it and/or modify              
 #
-# it under the terms of the GNU General Public License as published by       
 #
-# the Free Software Foundation; either version 2 of the License, or          
 #
-# (at your option) any later version.                                        
 #
-#                                                                            
 #
-# relax is distributed in the hope that it will be useful,                   
 #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of             
 #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              
 #
-# GNU General Public License for more details.                               
 #
-#                                                                            
 #
-# You should have received a copy of the GNU General Public License          
 #
-# along with relax; if not, write to the Free Software                       
 #
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
 #
-#                                                                            
 #
-###############################################################################
-
-# Python module imports.
-from re import match
-
-# relax module imports.
-from data import Data as relax_data_store
-from relax_errors import RelaxInvalidError
-
-
-# The relax data storage object.
-
-
-
-class Nuclei:
-    def __init__(self, relax):
-        """Class containing the function to set the gyromagnetic ratio of 
the heteronucleus."""
-
-        self.relax = relax
-
-
-    def find_nucleus(self):
-        """Function for finding the nucleus corresponding to 
'relax_data_store.gx'."""
-
-        # Not set.
-        if not hasattr(relax_data_store, 'gx'):
-            return
-
-        # Nitrogen.
-        if relax_data_store.gx == self.gn():
-            return 'N'
-
-        # Carbon
-        if relax_data_store.gx == self.gc():
-            return 'C'
-
-        # Oxygen.
-        if relax_data_store.gx == self.go():
-            return 'O'
-
-        # Phosphate.
-        if relax_data_store.gx == self.gp():
-            return 'P'
-
-
-    def set_values(self, heteronuc):
-        """Function for setting the gyromagnetic ratio of the 
heteronucleus."""
-
-        # Nitrogen.
-        if match('[Nn]', heteronuc):
-            relax_data_store.gx = self.gn()
-
-        # Carbon
-        elif match('[Cc]', heteronuc):
-            relax_data_store.gx = self.gc()
-
-        # Oxygen.
-        elif match('[Oo]', heteronuc):
-            relax_data_store.gx = self.go()
-
-        # Phosphate.
-        elif match('[Pp]', heteronuc):
-            relax_data_store.gx = self.gp()
-
-        # Incorrect arguement.
-        else:
-            raise RelaxInvalidError, ('heteronucleus', heteronuc)
-
-        # Set the proton gyromagnetic ratio.
-        relax_data_store.gh = self.gh()
-
-        # Calculate the ratio of the gyromagnetic ratios.
-        relax_data_store.g_ratio = relax_data_store.gh / relax_data_store.gx

Modified: 1.3/prompt/grace.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/grace.py?rev=4427&r1=4426&r2=4427&view=diff
==============================================================================
--- 1.3/prompt/grace.py (original)
+++ 1.3/prompt/grace.py Mon Jan  7 15:26:46 2008
@@ -26,7 +26,7 @@
 
 from doc_string import regexp_doc
 import help
-from generic_fns.minimise import Minimise
+from generic_fns import minimise
 from specific_fns.model_free import Model_free
 from specific_fns.jw_mapping import Jw_mapping
 from specific_fns.noe import Noe
@@ -260,7 +260,7 @@
 
     # Write function.
     write.__doc__ = write.__doc__ + "\n\n" + regexp_doc() + "\n"
-    write.__doc__ = write.__doc__ + Minimise.return_data_name.__doc__ + 
"\n\n"
+    write.__doc__ = write.__doc__ + minimise.return_data_name.__doc__ + 
"\n\n"
     write.__doc__ = write.__doc__ + Noe.return_data_name.__doc__ + "\n"
     write.__doc__ = write.__doc__ + Relax_fit.return_data_name.__doc__ + "\n"
     write.__doc__ = write.__doc__ + Jw_mapping.return_data_name.__doc__ + 
"\n\n"

Modified: 1.3/prompt/interpreter.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/prompt/interpreter.py?rev=4427&r1=4426&r2=4427&view=diff
==============================================================================
--- 1.3/prompt/interpreter.py (original)
+++ 1.3/prompt/interpreter.py Mon Jan  7 15:26:46 2008
@@ -48,7 +48,6 @@
 from reset import Reset
 from minimisation import Minimisation
 from model_selection import Modsel
-from nuclei import Nuclei
 
 # User classes.
 from dasha import Dasha
@@ -106,7 +105,6 @@
         self._Reset = Reset(relax)
         self._Minimisation = Minimisation(relax)
         self._Modsel = Modsel(relax)
-        self._Nuclei = Nuclei(relax)
         self._OpenDX = OpenDX(relax)
         self._system = system
 
@@ -169,7 +167,6 @@
         reset = self._Reset.reset
         minimise = self._Minimisation.minimise
         model_selection = self._Modsel.model_selection
-        nuclei = self._Nuclei.nuclei
 
         # Place the user classes in the local namespace.
         dasha = self._Dasha

Removed: 1.3/prompt/nuclei.py
URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/nuclei.py?rev=4426&view=auto
==============================================================================
--- 1.3/prompt/nuclei.py (original)
+++ 1.3/prompt/nuclei.py (removed)
@@ -1,64 +1,0 @@
-###############################################################################
-#                                                                            
 #
-# Copyright (C) 2003-2005 Edward d'Auvergne                                  
 #
-#                                                                            
 #
-# This file is part of the program relax.                                    
 #
-#                                                                            
 #
-# relax is free software; you can redistribute it and/or modify              
 #
-# it under the terms of the GNU General Public License as published by       
 #
-# the Free Software Foundation; either version 2 of the License, or          
 #
-# (at your option) any later version.                                        
 #
-#                                                                            
 #
-# relax is distributed in the hope that it will be useful,                   
 #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of             
 #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              
 #
-# GNU General Public License for more details.                               
 #
-#                                                                            
 #
-# You should have received a copy of the GNU General Public License          
 #
-# along with relax; if not, write to the Free Software                       
 #
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
 #
-#                                                                            
 #
-###############################################################################
-
-import sys
-
-from relax_errors import RelaxStrError
-
-
-class Nuclei:
-    def __init__(self, relax):
-        """Class containing the function for setting the gyromagnetic ratio 
of the heteronucleus."""
-
-        self.relax = relax
-
-
-    def nuclei(self, heteronuc='N'):
-        """Function for setting the gyromagnetic ratio of the heteronucleus.
-
-        Keyword arguments
-        ~~~~~~~~~~~~~~~~~
-
-        heteronuc:  The type of heteronucleus.
-
-
-        Description
-        ~~~~~~~~~~~
-
-        The heteronuc argument can be set to the following strings:
-
-            N:  Nitrogen, -2.7126e7
-            C:  Carbon, 2.2e7
-        """
-
-        # Function intro text.
-        if self.relax.interpreter.intro:
-            text = sys.ps3 + "nuclei("
-            text = text + "heteronuc=" + `heteronuc` + ")"
-            print text
-
-        # The heteronucleus argument.
-        if type(heteronuc) != str:
-            raise RelaxStrError, ('heteronucleus', heteronuc)
-
-        # Execute the functional code.
-        self.relax.generic.nuclei.set_values(heteronuc=heteronuc)




Related Messages


Powered by MHonArc, Updated Mon Jan 07 16:00:15 2008