Author: bugman Date: Wed May 9 10:04:30 2012 New Revision: 16133 URL: http://svn.gna.org/viewcvs/relax?rev=16133&view=rev Log: Converted the jw_mapping user functions to the auto-generation design. Added: branches/uf_redesign/user_functions/jw_mapping.py - copied, changed from r16130, branches/uf_redesign/prompt/jw_mapping.py Removed: branches/uf_redesign/prompt/jw_mapping.py Modified: branches/uf_redesign/prompt/__init__.py branches/uf_redesign/prompt/interpreter.py branches/uf_redesign/user_functions/__init__.py Modified: branches/uf_redesign/prompt/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/__init__.py?rev=16133&r1=16132&r2=16133&view=diff ============================================================================== --- branches/uf_redesign/prompt/__init__.py (original) +++ branches/uf_redesign/prompt/__init__.py Wed May 9 10:04:30 2012 @@ -27,7 +27,6 @@ 'gpl', 'help', 'interpreter', - 'jw_mapping', 'model_free', 'molecule', 'monte_carlo', Modified: branches/uf_redesign/prompt/interpreter.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/interpreter.py?rev=16133&r1=16132&r2=16133&view=diff ============================================================================== --- branches/uf_redesign/prompt/interpreter.py (original) +++ branches/uf_redesign/prompt/interpreter.py Wed May 9 10:04:30 2012 @@ -61,7 +61,6 @@ from temperature import Temp # User classes. -from jw_mapping import Jw_mapping from model_free import Model_free from molecule import Molecule from monte_carlo import Monte_carlo @@ -196,7 +195,6 @@ objects['temperature'] = temp.set # Place the user classes in the local namespace. - objects['jw_mapping'] = Jw_mapping() objects['model_free'] = Model_free() objects['molecule'] = Molecule() objects['monte_carlo'] = Monte_carlo() Removed: branches/uf_redesign/prompt/jw_mapping.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/prompt/jw_mapping.py?rev=16132&view=auto ============================================================================== --- branches/uf_redesign/prompt/jw_mapping.py (original) +++ branches/uf_redesign/prompt/jw_mapping.py (removed) @@ -1,70 +1,0 @@ -############################################################################### -# # -# Copyright (C) 2004-2012 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 # -# # -############################################################################### - -# Module docstring. -"""Module containing the Reduced Spectral Density Mapping 'jw_mapping' user function class.""" -__docformat__ = 'plaintext' - -# relax module imports. -from base_class import User_fn_class -import arg_check -from specific_fns.setup import jw_mapping_obj -from status import Status; status = Status() - - -class Jw_mapping(User_fn_class): - """Class containing functions specific to reduced spectral density mapping.""" - - def set_frq(self, frq=None): - """Function for selecting which relaxation data to use in the J(w) mapping. - - Keyword Arguments - ~~~~~~~~~~~~~~~~~ - - frq: The spectrometer frequency in Hz. - - - Description - ~~~~~~~~~~~ - - This function will select the relaxation data to use in the reduced spectral density mapping - corresponding to the given frequency. - - - Examples - ~~~~~~~~ - - relax> jw_mapping.set_frq(600.0 * 1e6) - relax> jw_mapping.set_frq(frq=600.0 * 1e6) - """ - - # Function intro text. - if status.prompt_intro: - text = status.ps3 + "jw_mapping.set_frq(" - text = text + "frq=" + repr(frq) + ")" - print(text) - - # The argument checks. - arg_check.is_num(frq, 'spectrometer frequency') - - # Execute the functional code. - jw_mapping_obj._set_frq(frq=frq) Modified: branches/uf_redesign/user_functions/__init__.py URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/__init__.py?rev=16133&r1=16132&r2=16133&view=diff ============================================================================== --- branches/uf_redesign/user_functions/__init__.py (original) +++ branches/uf_redesign/user_functions/__init__.py Wed May 9 10:04:30 2012 @@ -48,6 +48,7 @@ 'frame_order', 'frq', 'grace', + 'jw_mapping', 'minimisation', 'model_selection', 'molmol', @@ -74,6 +75,7 @@ import user_functions.frame_order import user_functions.frq import user_functions.grace +import user_functions.jw_mapping import user_functions.minimisation import user_functions.model_selection import user_functions.molmol Copied: branches/uf_redesign/user_functions/jw_mapping.py (from r16130, branches/uf_redesign/prompt/jw_mapping.py) URL: http://svn.gna.org/viewcvs/relax/branches/uf_redesign/user_functions/jw_mapping.py?p2=branches/uf_redesign/user_functions/jw_mapping.py&p1=branches/uf_redesign/prompt/jw_mapping.py&r1=16130&r2=16133&rev=16133&view=diff ============================================================================== --- branches/uf_redesign/prompt/jw_mapping.py (original) +++ branches/uf_redesign/user_functions/jw_mapping.py Wed May 9 10:04:30 2012 @@ -21,50 +21,37 @@ ############################################################################### # Module docstring. -"""Module containing the Reduced Spectral Density Mapping 'jw_mapping' user function class.""" -__docformat__ = 'plaintext' +"""Module containing the Reduced Spectral Density Mapping 'jw_mapping' user function data.""" # relax module imports. -from base_class import User_fn_class -import arg_check from specific_fns.setup import jw_mapping_obj -from status import Status; status = Status() +from graphics import WIZARD_IMAGE_PATH +from user_functions.data import Uf_info; uf_info = Uf_info() -class Jw_mapping(User_fn_class): - """Class containing functions specific to reduced spectral density mapping.""" - - def set_frq(self, frq=None): - """Function for selecting which relaxation data to use in the J(w) mapping. - - Keyword Arguments - ~~~~~~~~~~~~~~~~~ - - frq: The spectrometer frequency in Hz. +# The user function class. +uf_class = uf_info.add_class('jw_mapping') +uf_class.title = "Class containing functions specific to reduced spectral density mapping." +uf_class.menu_text = "&jw_mapping" - Description - ~~~~~~~~~~~ - - This function will select the relaxation data to use in the reduced spectral density mapping - corresponding to the given frequency. - - - Examples - ~~~~~~~~ - - relax> jw_mapping.set_frq(600.0 * 1e6) - relax> jw_mapping.set_frq(frq=600.0 * 1e6) - """ - - # Function intro text. - if status.prompt_intro: - text = status.ps3 + "jw_mapping.set_frq(" - text = text + "frq=" + repr(frq) + ")" - print(text) - - # The argument checks. - arg_check.is_num(frq, 'spectrometer frequency') - - # Execute the functional code. - jw_mapping_obj._set_frq(frq=frq) +# The jw_mapping.set_frq user function. +uf = uf_info.add_uf('jw_mapping.set_frq') +uf.title = "Select which relaxation data to use in the J(w) mapping by NMR spectrometer frequency." +uf.title_short = "Spectrometer selection." +uf.add_keyarg( + name = "frq", + py_type = "float", + desc_short = "spectrometer frequency in Hz", + desc = "The spectrometer frequency in Hz. This must match the currently loaded data to the last decimal point." +) +uf.desc = """ +This function will select the relaxation data to use in the reduced spectral density mapping corresponding to the given frequency. +""" +uf.prompt_examples = """ +relax> jw_mapping.set_frq(600.0 * 1e6) +relax> jw_mapping.set_frq(frq=600.0 * 1e6) +""" +uf.backend = jw_mapping_obj._set_frq +uf.menu_text = "&set_frq" +uf.wizard_size = (700, 400)