Author: bugman Date: Tue Dec 11 16:08:14 2012 New Revision: 18110 URL: http://svn.gna.org/viewcvs/relax?rev=18110&view=rev Log: Implemented the pipe.change_type user function front and back ends. Modified: trunk/generic_fns/pipes.py trunk/user_functions/pipe.py Modified: trunk/generic_fns/pipes.py URL: http://svn.gna.org/viewcvs/relax/trunk/generic_fns/pipes.py?rev=18110&r1=18109&r2=18110&view=diff ============================================================================== --- trunk/generic_fns/pipes.py (original) +++ trunk/generic_fns/pipes.py Tue Dec 11 16:08:14 2012 @@ -93,6 +93,29 @@ return list(ds.pipe_bundles.keys()) +def change_type(pipe_type=None): + """Change the type of the current data pipe. + + @keyword pipe_type: The new data pipe type which can be one of the following: + 'ct': Consistency testing, + 'frame order': The Frame Order theories. + 'jw': Reduced spectral density mapping, + 'hybrid': The hybridised data pipe. + 'mf': Model-free analysis, + 'N-state': N-state model of domain dynamics, + 'noe': Steady state NOE calculation, + 'relax_fit': Relaxation curve fitting, + 'relax_disp': Relaxation dispersion, + @type pipe_type: str + """ + + # Tests for the pipe type. + check_type(pipe_type) + + # Change the type. + cdp.pipe_type = pipe_type + + def copy(pipe_from=None, pipe_to=None, bundle_to=None): """Copy the contents of the source data pipe to a new target data pipe. Modified: trunk/user_functions/pipe.py URL: http://svn.gna.org/viewcvs/relax/trunk/user_functions/pipe.py?rev=18110&r1=18109&r2=18110&view=diff ============================================================================== --- trunk/user_functions/pipe.py (original) +++ trunk/user_functions/pipe.py Tue Dec 11 16:08:14 2012 @@ -74,6 +74,35 @@ uf.wizard_image = WIZARD_IMAGE_PATH + 'pipe_bundle.png' +# The pipe.change_type user function. +uf = uf_info.add_uf('pipe.change_type') +uf.title = "Change the type of the current data pipe." +uf.title_short = "Data pipe type change." +uf.add_keyarg( + name = "pipe_type", + py_type = "str", + desc_short = "type of data pipe", + desc = "The type of data pipe.", + wiz_element_type = 'combo', + wiz_combo_choices = pipes.PIPE_DESC_LIST, + wiz_combo_data = pipes.VALID_TYPES, + wiz_read_only = True +) +uf.backend = pipes.change_type +# Description. +uf.desc.append(Desc_container()) +uf.desc[-1].add_paragraph("The data pipe type must be one of the following:") +for name in pipes.VALID_TYPES: + uf.desc[-1].add_item_list_element("'%s'" % name, "%s." % pipes.PIPE_DESC[name]) +# Prompt examples. +uf.desc.append(Desc_container("Prompt examples")) +uf.desc[-1].add_paragraph("To change the type of the current 'frame order' data pipe to the N-state model, type one of:") +uf.desc[-1].add_prompt("relax> pipe.change_type('N-state')") +uf.desc[-1].add_prompt("relax> pipe.change_type(pipe_type='N-state')") +uf.menu_text = "change_&type" +uf.wizard_image = WIZARD_IMAGE_PATH + 'pipe.png' + + # The pipe.copy user function. uf = uf_info.add_uf('pipe.copy') uf.title = "Copy a data pipe."