Author: bugman Date: Mon May 7 15:27:58 2012 New Revision: 16053 URL: http://svn.gna.org/viewcvs/relax?rev=16053&view=rev Log: Converted the consistency_tests user functions to the auto-generation design. Added: branches/uf_redesign/graphics/relax_icons/16x16/consistency_testing.png (with props) branches/uf_redesign/graphics/relax_icons/22x22/consistency_testing.png (with props) branches/uf_redesign/graphics/relax_icons/32x32/consistency_testing.png (with props) branches/uf_redesign/graphics/relax_icons/48x48/consistency_testing.png (with props) branches/uf_redesign/user_functions/consistency_tests.py - copied, changed from r16051, branches/uf_redesign/prompt/consistency_tests.py Removed: branches/uf_redesign/prompt/consistency_tests.py Modified: branches/uf_redesign/prompt/__init__.py branches/uf_redesign/prompt/interpreter.py branches/uf_redesign/user_functions/__init__.py Added: branches/uf_redesign/graphics/relax_icons/16x16/consistency_testing.png URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/graphics/relax_icons/16x16/consistency_testing.png?rev=16053&view=auto ============================================================================== Binary file - no diff available. Propchange: branches/uf_redesign/graphics/relax_icons/16x16/consistency_testing.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: branches/uf_redesign/graphics/relax_icons/22x22/consistency_testing.png URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/graphics/relax_icons/22x22/consistency_testing.png?rev=16053&view=auto ============================================================================== Binary file - no diff available. Propchange: branches/uf_redesign/graphics/relax_icons/22x22/consistency_testing.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: branches/uf_redesign/graphics/relax_icons/32x32/consistency_testing.png URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/graphics/relax_icons/32x32/consistency_testing.png?rev=16053&view=auto ============================================================================== Binary file - no diff available. Propchange: branches/uf_redesign/graphics/relax_icons/32x32/consistency_testing.png ------------------------------------------------------------------------------ svn:mime-type = image/png Added: branches/uf_redesign/graphics/relax_icons/48x48/consistency_testing.png URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/graphics/relax_icons/48x48/consistency_testing.png?rev=16053&view=auto ============================================================================== Binary file - no diff available. Propchange: branches/uf_redesign/graphics/relax_icons/48x48/consistency_testing.png ------------------------------------------------------------------------------ svn:mime-type = image/png Modified: branches/uf_redesign/prompt/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/__init__.py?rev=16053&r1=16052&r2=16053&view=diff ============================================================================== --- branches/uf_redesign/prompt/__init__.py (original) +++ branches/uf_redesign/prompt/__init__.py Mon May 7 15:27:58 2012 @@ -21,10 +21,8 @@ ############################################################################### -__all__ = ['angles', - 'base_class', +__all__ = ['base_class', 'command', - 'consistency_tests', 'dasha', 'deselect', 'diffusion_tensor', Removed: branches/uf_redesign/prompt/consistency_tests.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/consistency_tests.py?rev=16052&view=auto ============================================================================== --- branches/uf_redesign/prompt/consistency_tests.py (original) +++ branches/uf_redesign/prompt/consistency_tests.py (removed) @@ -1,71 +1,0 @@ -############################################################################### -# # -# Copyright (C) 2004-2012 Edward d'Auvergne # -# Copyright (C) 2007-2008 Sebastien Morin # -# # -# 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 # -# # -############################################################################### - -# Module docstring. -"""Module containing the 'consistency_tests' user function class.""" -__docformat__ = 'plaintext' - -# relax module imports. -from base_class import User_fn_class -import arg_check -from specific_fns.setup import consistency_tests_obj -from status import Status; status = Status() - - -class Consistency_tests(User_fn_class): - """Class containing functions specific to consistency tests for datasets from different fields.""" - - def set_frq(self, frq=None): - """Function for selecting which relaxation data to use in the consistency tests. - - Keyword Arguments - ~~~~~~~~~~~~~~~~~ - - frq: The spectrometer frequency in Hz. - - - Description - ~~~~~~~~~~~ - - This function will select the relaxation data to use in the consistency tests corresponding - to the given frequencies. - - - Examples - ~~~~~~~~ - - relax> consistency_tests.set_frq(600.0 * 1e6) - relax> consistency_tests.set_frq(frq=600.0 * 1e6) - """ - - # Function intro text. - if status.prompt_intro: - text = status.ps3 + "consistency_tests.set_frq(" - text = text + "frq=" + repr(frq) + ")" - print(text) - - # The argument checks. - arg_check.is_num(frq, 'spectrometer frequency') - - # Execute the functional code. - consistency_tests_obj._set_frq(frq=frq) Modified: branches/uf_redesign/prompt/interpreter.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/interpreter.py?rev=16053&r1=16052&r2=16053&view=diff ============================================================================== --- branches/uf_redesign/prompt/interpreter.py (original) +++ branches/uf_redesign/prompt/interpreter.py Mon May 7 15:27:58 2012 @@ -66,7 +66,6 @@ from temperature import Temp # User classes. -from consistency_tests import Consistency_tests from dasha import Dasha from diffusion_tensor import Diffusion_tensor from frame_order import Frame_order @@ -216,7 +215,6 @@ objects['temperature'] = temp.set # Place the user classes in the local namespace. - objects['consistency_tests'] = Consistency_tests() objects['dasha'] = Dasha() objects['deselect'] = Deselect() objects['diffusion_tensor'] = Diffusion_tensor() Modified: branches/uf_redesign/user_functions/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/__init__.py?rev=16053&r1=16052&r2=16053&view=diff ============================================================================== --- branches/uf_redesign/user_functions/__init__.py (original) +++ branches/uf_redesign/user_functions/__init__.py Mon May 7 15:27:58 2012 @@ -38,6 +38,7 @@ 'angles', 'bmrb', 'bruker', + 'consistency_tests', 'pipe', 'relax_data', 'state' @@ -48,6 +49,7 @@ import user_functions.angles import user_functions.bmrb import user_functions.bruker +import user_functions.consistency_tests import user_functions.pipe import user_functions.relax_data import user_functions.state Copied: branches/uf_redesign/user_functions/consistency_tests.py (from r16051, branches/uf_redesign/prompt/consistency_tests.py) URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/consistency_tests.py?p2=branches/uf_redesign/user_functions/consistency_tests.py&p1=branches/uf_redesign/prompt/consistency_tests.py&r1=16051&r2=16053&rev=16053&view=diff ============================================================================== --- branches/uf_redesign/prompt/consistency_tests.py (original) +++ branches/uf_redesign/user_functions/consistency_tests.py Mon May 7 15:27:58 2012 @@ -22,50 +22,39 @@ ############################################################################### # Module docstring. -"""Module containing the 'consistency_tests' user function class.""" -__docformat__ = 'plaintext' +"""Module containing the 'consistency_tests' user function data.""" # relax module imports. -from base_class import User_fn_class -import arg_check from specific_fns.setup import consistency_tests_obj -from status import Status; status = Status() +from graphics import ANALYSIS_IMAGE_PATH +from user_functions.data import Uf_info; uf_info = Uf_info() -class Consistency_tests(User_fn_class): - """Class containing functions specific to consistency tests for datasets from different fields.""" - - def set_frq(self, frq=None): - """Function for selecting which relaxation data to use in the consistency tests. - - Keyword Arguments - ~~~~~~~~~~~~~~~~~ - - frq: The spectrometer frequency in Hz. +# The user function class. +uf_class = uf_info.add_class('consistency_tests') +uf_class.title = "Class containing functions specific to consistency tests for datasets from different fields." +uf_class.menu_text = "&consistency_tests" +uf_class.gui_icon = "relax.consistency_testing" - Description - ~~~~~~~~~~~ - - This function will select the relaxation data to use in the consistency tests corresponding - to the given frequencies. - - - Examples - ~~~~~~~~ - - relax> consistency_tests.set_frq(600.0 * 1e6) - relax> consistency_tests.set_frq(frq=600.0 * 1e6) - """ - - # Function intro text. - if status.prompt_intro: - text = status.ps3 + "consistency_tests.set_frq(" - text = text + "frq=" + repr(frq) + ")" - print(text) - - # The argument checks. - arg_check.is_num(frq, 'spectrometer frequency') - - # Execute the functional code. - consistency_tests_obj._set_frq(frq=frq) +# The consistency_tests.set_frq user function. +uf = uf_info.add_uf('consistency_tests.set_frq') +uf.title = "Select which relaxation data to use in the consistency tests." +uf.title_short = "Relaxation data selection." +uf.add_keyarg( + name = "frq", + py_type = "float", + desc_short = "frequency in Hz", + desc = "The spectrometer frequency in Hz. This must match the currently loaded data to the last decimal point." +) +uf.desc = """ +This will select the relaxation data to use in the consistency tests corresponding to the given frequencies. +""" +uf.prompt_examples = """ +relax> consistency_tests.set_frq(600.0 * 1e6) +relax> consistency_tests.set_frq(frq=600.0 * 1e6) +""" +uf.backend = consistency_tests_obj._set_frq +uf.menu_text = "&set_frq" +uf.wizard_size = (700, 400) +uf.wizard_image = ANALYSIS_IMAGE_PATH + 'consistency_testing_200x94.png'