mailr17259 - in /branches/frame_order_testing: prompt/domain.py user_functions/__init__.py user_functions/domain.py


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

Header


Content

Posted by edward on July 16, 2012 - 19:56:
Author: bugman
Date: Mon Jul 16 19:56:50 2012
New Revision: 17259

URL: http://svn.gna.org/viewcvs/relax?rev=17259&view=rev
Log:
Converted the domain user function to the new relax 2.x auto-generation 
design.


Added:
    branches/frame_order_testing/user_functions/domain.py
      - copied, changed from r17256, 
branches/frame_order_testing/prompt/domain.py
Removed:
    branches/frame_order_testing/prompt/domain.py
Modified:
    branches/frame_order_testing/user_functions/__init__.py

Removed: branches/frame_order_testing/prompt/domain.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/prompt/domain.py?rev=17258&view=auto
==============================================================================
--- branches/frame_order_testing/prompt/domain.py (original)
+++ branches/frame_order_testing/prompt/domain.py (removed)
@@ -1,62 +1,0 @@
-###############################################################################
-#                                                                            
 #
-# Copyright (C) 2003-2012 Edward d'Auvergne                                  
 #
-#                                                                            
 #
-# This file is part of the program relax (http://www.nmr-relax.com).         
 #
-#                                                                            
 #
-# This program 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 3 of the License, or          
 #
-# (at your option) any later version.                                        
 #
-#                                                                            
 #
-# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.      
 #
-#                                                                            
 #
-###############################################################################
-
-# Module docstring.
-"""Module containing the 'domain' user function for defining structural 
domains."""
-__docformat__ = 'plaintext'
-
-# relax module imports.
-from base_class import Basic_class, _build_doc
-import arg_check
-from generic_fns import domain
-from relax_errors import RelaxListStrError, RelaxNoneStrListError, 
RelaxNoneTupleError
-from specific_fns.model_free import Model_free
-
-
-class Domain(Basic_class):
-    """Class containing the user function for defining domains."""
-
-    def domain(self, id=None, spin_id=None):
-        # Function intro text.
-        if self._exec_info.intro:
-            text = self._exec_info.ps3 + "domain("
-            text = text + "id=" + repr(id)
-            text = text + ", spin_id=" + repr(spin_id) + ")"
-            print(text)
-
-        # The argument checks.
-        arg_check.is_str(id, 'domain ID string')
-        arg_check.is_str(spin_id, 'spin ID string', can_be_none=True)
-
-        # Execute the functional code.
-        domain.define(id=id, spin_id=spin_id)
-
-    # The function doc info.
-    domain._doc_title = "Definition of structural domains."
-    domain._doc_title_short = "Domain definition."
-    domain._doc_args = [
-        ["id", "The domain ID string."],
-        ["spin_id", "The spin ID string of all atomic members of the 
domain."]
-    ]
-    domain._doc_desc = """
-        This is used to define structural domains.  Multiple domains can be 
defined, and these can overlap.  Rather than labelling the currently loaded 
spins with the ID string, the spin ID string is stored for later use.  This 
allows new spins to be loaded later and still be included within the same 
domain.
-        """
-    _build_doc(domain)

Modified: branches/frame_order_testing/user_functions/__init__.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/user_functions/__init__.py?rev=17259&r1=17258&r2=17259&view=diff
==============================================================================
--- branches/frame_order_testing/user_functions/__init__.py (original)
+++ branches/frame_order_testing/user_functions/__init__.py Mon Jul 16 
19:56:50 2012
@@ -42,6 +42,7 @@
     'deselect',
     'diffusion_tensor',
     'dipole_pair',
+    'domain',
     'dx',
     'eliminate',
     'fix',
@@ -91,6 +92,7 @@
 import user_functions.deselect
 import user_functions.diffusion_tensor
 import user_functions.dipole_pair
+import user_functions.domain
 import user_functions.dx
 import user_functions.eliminate
 import user_functions.fix

Copied: branches/frame_order_testing/user_functions/domain.py (from r17256, 
branches/frame_order_testing/prompt/domain.py)
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_testing/user_functions/domain.py?p2=branches/frame_order_testing/user_functions/domain.py&p1=branches/frame_order_testing/prompt/domain.py&r1=17256&r2=17259&rev=17259&view=diff
==============================================================================
--- branches/frame_order_testing/prompt/domain.py (original)
+++ branches/frame_order_testing/user_functions/domain.py Mon Jul 16 19:56:50 
2012
@@ -20,43 +20,34 @@
 
###############################################################################
 
 # Module docstring.
-"""Module containing the 'domain' user function for defining structural 
domains."""
-__docformat__ = 'plaintext'
+"""The domain user function definitions."""
 
 # relax module imports.
-from base_class import Basic_class, _build_doc
-import arg_check
 from generic_fns import domain
-from relax_errors import RelaxListStrError, RelaxNoneStrListError, 
RelaxNoneTupleError
-from specific_fns.model_free import Model_free
+from user_functions.data import Uf_info; uf_info = Uf_info()
+from user_functions.objects import Desc_container
 
 
-class Domain(Basic_class):
-    """Class containing the user function for defining domains."""
-
-    def domain(self, id=None, spin_id=None):
-        # Function intro text.
-        if self._exec_info.intro:
-            text = self._exec_info.ps3 + "domain("
-            text = text + "id=" + repr(id)
-            text = text + ", spin_id=" + repr(spin_id) + ")"
-            print(text)
-
-        # The argument checks.
-        arg_check.is_str(id, 'domain ID string')
-        arg_check.is_str(spin_id, 'spin ID string', can_be_none=True)
-
-        # Execute the functional code.
-        domain.define(id=id, spin_id=spin_id)
-
-    # The function doc info.
-    domain._doc_title = "Definition of structural domains."
-    domain._doc_title_short = "Domain definition."
-    domain._doc_args = [
-        ["id", "The domain ID string."],
-        ["spin_id", "The spin ID string of all atomic members of the 
domain."]
-    ]
-    domain._doc_desc = """
-        This is used to define structural domains.  Multiple domains can be 
defined, and these can overlap.  Rather than labelling the currently loaded 
spins with the ID string, the spin ID string is stored for later use.  This 
allows new spins to be loaded later and still be included within the same 
domain.
-        """
-    _build_doc(domain)
+# The domain user function.
+uf = uf_info.add_uf('domain')
+uf.title = "Definition of structural domains."
+uf.title_short = "Domain definition."
+uf.add_keyarg(
+    name = "id",
+    py_type = "str",
+    desc_short = "domain ID string",
+    desc = "The ID string used to identify molecular domains.",
+)
+uf.add_keyarg(
+    name = "spin_id",
+    py_type = "str",
+    arg_type = "spin ID",
+    desc_short = "spin ID string",
+    desc = "The spin ID string of all atomic members of the domain.",
+    can_be_none = True
+)
+# Description.
+uf.desc.append(Desc_container())
+uf.desc[-1].add_paragraph("This is used to define structural domains.  
Multiple domains can be defined, and these can overlap.  Rather than 
labelling the currently loaded spins with the ID string, the spin ID string 
is stored for later use.  This allows new spins to be loaded later and still 
be included within the same domain.")
+uf.backend = domain.define
+uf.menu_text = "&domain"




Related Messages


Powered by MHonArc, Updated Mon Jul 16 20:00:02 2012