r22181 - in /trunk: lib/errors.py lib/warnings.py relax.py status.py
Author: tlinnet Date: Fri Feb 14 10:32:15 2014 New Revision: 22181 URL: http://svn.gna.org/viewcvs/relax?rev=22181view=rev Log: Shifted the pedantic flag to escalate flag. The option -p would insted be used for the option --prompt. Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i Modified: trunk/lib/errors.py trunk/lib/warnings.py trunk/relax.py trunk/status.py Modified: trunk/lib/errors.py URL: http://svn.gna.org/viewcvs/relax/trunk/lib/errors.py?rev=22181r1=22180r2=22181view=diff == --- trunk/lib/errors.py (original) +++ trunk/lib/errors.py Fri Feb 14 10:32:15 2014 @@ -131,9 +131,9 @@ def __str__(self): Modify the behaviour of the error system. -# Save the state if the pedantic flag is turned on. +# Save the state if the escalate flag is turned on. from status import Status; status = Status() -if status.pedantic: +if status.escalate: save_state() # Modify the error message to include 'RelaxError' at the start (using coloured text if a TTY). Modified: trunk/lib/warnings.py URL: http://svn.gna.org/viewcvs/relax/trunk/lib/warnings.py?rev=22181r1=22180r2=22181view=diff == --- trunk/lib/warnings.py (original) +++ trunk/lib/warnings.py Fri Feb 14 10:32:15 2014 @@ -39,8 +39,8 @@ # Add the text 'RelaxWarning: ' to the start of the warning message. message = RelaxWarning: %s\n % message -# Print stack-trace in pedantic mode. -if status.pedantic: +# Print stack-trace in escalate mode. +if status.escalate: tb = for frame in inspect.stack()[4:]: file = frame[1] @@ -77,7 +77,7 @@ warnings.formatwarning = format # Set warning filters. -if status.pedantic: +if status.escalate: warnings.filterwarnings('error', category=BaseWarning) else: warnings.filterwarnings('always', category=BaseWarning) Modified: trunk/relax.py URL: http://svn.gna.org/viewcvs/relax/trunk/relax.py?rev=22181r1=22180r2=22181view=diff == --- trunk/relax.py (original) +++ trunk/relax.py Fri Feb 14 10:32:15 2014 @@ -279,7 +279,7 @@ parser.add_option('--licence', action='store_true', dest='licence', default=0, help='display the licence') parser.add_option('-t', '--tee', action='store', type='string', dest='tee', help='tee relax output to stdout and the file LOG_FILE', metavar='LOG_FILE') parser.add_option('-g', '--gui', action='store_true', dest='gui', default=0, help='launch the relax GUI') -parser.add_option('-p', '--pedantic', action='store_true', dest='pedantic', default=0, help='escalate all warnings to errors') +parser.add_option('-e', '--escalate', action='store_true', dest='escalate', default=0, help='escalate all warnings to errors') parser.add_option('--test', action='store_true', dest='test', default=0, help='run relax in test mode') parser.add_option('-x', '--test-suite', action='store_true', dest='test_suite', default=0, help='execute the relax test suite') parser.add_option('-s', '--system-tests', action='store_true', dest='system_tests', default=0, help='execute the relax system/functional tests (part of the test suite)') @@ -301,9 +301,9 @@ if options.numpy_raise: numpy.seterr(all='raise') -# Pedantic flag. -if options.pedantic: -status.pedantic = True +# escalate flag. +if options.escalate: +status.escalate = True # Logging. if options.log: Modified: trunk/status.py URL: http://svn.gna.org/viewcvs/relax/trunk/status.py?rev=22181r1=22180r2=22181view=diff == --- trunk/status.py (original) +++ trunk/status.py Fri Feb 14 10:32:15 2014 @@ -51,7 +51,7 @@ # Initialise some variables. self._instance.debug = False -self._instance.pedantic = False +self._instance.escalate = False self._instance.test_mode = False self._instance.uf_intro = False self._instance.show_gui = False ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r22182 - in /trunk: relax.py status.py
Author: tlinnet Date: Fri Feb 14 10:32:17 2014 New Revision: 22182 URL: http://svn.gna.org/viewcvs/relax?rev=22182view=rev Log: Added the -p --prompt option for running a relax script and inspect interactively. Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i Modified: trunk/relax.py trunk/status.py Modified: trunk/relax.py URL: http://svn.gna.org/viewcvs/relax/trunk/relax.py?rev=22182r1=22181r2=22182view=diff == --- trunk/relax.py (original) +++ trunk/relax.py Fri Feb 14 10:32:17 2014 @@ -280,6 +280,7 @@ parser.add_option('-t', '--tee', action='store', type='string', dest='tee', help='tee relax output to stdout and the file LOG_FILE', metavar='LOG_FILE') parser.add_option('-g', '--gui', action='store_true', dest='gui', default=0, help='launch the relax GUI') parser.add_option('-e', '--escalate', action='store_true', dest='escalate', default=0, help='escalate all warnings to errors') +parser.add_option('-p', '--prompt', action='store_true', dest='prompt', default=0, help='execute the given script and continue into the prompt mode to allow for interactive inspection') parser.add_option('--test', action='store_true', dest='test', default=0, help='run relax in test mode') parser.add_option('-x', '--test-suite', action='store_true', dest='test_suite', default=0, help='execute the relax test suite') parser.add_option('-s', '--system-tests', action='store_true', dest='system_tests', default=0, help='execute the relax system/functional tests (part of the test suite)') @@ -305,6 +306,10 @@ if options.escalate: status.escalate = True +# Script prompt interactive inspection flag. +if options.prompt: +status.prompt = True + # Logging. if options.log: # Exclusive modes. Modified: trunk/status.py URL: http://svn.gna.org/viewcvs/relax/trunk/status.py?rev=22182r1=22181r2=22182view=diff == --- trunk/status.py (original) +++ trunk/status.py Fri Feb 14 10:32:17 2014 @@ -52,6 +52,7 @@ # Initialise some variables. self._instance.debug = False self._instance.escalate = False +self._instance.prompt = False self._instance.test_mode = False self._instance.uf_intro = False self._instance.show_gui = False ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r22183 - /trunk/prompt/interpreter.py
Author: tlinnet Date: Fri Feb 14 11:22:56 2014 New Revision: 22183 URL: http://svn.gna.org/viewcvs/relax?rev=22183view=rev Log: Second Modified: trunk/prompt/interpreter.py Modified: trunk/prompt/interpreter.py URL: http://svn.gna.org/viewcvs/relax/trunk/prompt/interpreter.py?rev=22183r1=22182r2=22183view=diff == --- trunk/prompt/interpreter.py (original) +++ trunk/prompt/interpreter.py Fri Feb 14 11:22:56 2014 @@ -266,12 +266,16 @@ readline.parse_and_bind(tab: complete) # Execute the script file if given. -if script_file: +if script_file and not status.prompt: # Turn on the user function intro flag. status.uf_intro = True # Run the script. return run_script(intro=self.__intro_string, local=locals(), script_file=script_file, show_script=self.__show_script, raise_relax_error=self.__raise_relax_error) + +if script_file and status.prompt: +run_script(intro=self.__intro_string, local=locals(), script_file=script_file, show_script=self.__show_script, raise_relax_error=self.__raise_relax_error) +prompt(intro=None, local=locals()) # Go to the prompt. else: @@ -333,12 +337,13 @@ sys.path.reverse() # Execute the script as a module. -if dep_check.runpy_module: -runpy.run_module(module, globals) +#if dep_check.runpy_module: +#runpy.run_module(module, globals) # Allow scripts to run under Python = 2.4. -else: -exec(compile(open(name).read(), name, 'exec'), globals) +#else: +#exec(compile(open(name).read(), name, 'exec'), globals) +exec(compile(open(name).read(), name, 'exec'), globals) finally: # Switch back to the original working directory. ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r22184 - in /trunk: prompt/interpreter.py relax.py
Author: tlinnet Date: Fri Feb 14 11:22:57 2014 New Revision: 22184 URL: http://svn.gna.org/viewcvs/relax?rev=22184view=rev Log: Modified the help text to explain that -p will launch relax in prompt mode after running any optionally supplied scripts. Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i This is to allow the -p --prompt option to be given without a script. relax should support this so that a user doesn't get too confused when trying to start in prompt mode with the --prompt flag and support the --prompt argument without a script being supplied. Modified: trunk/prompt/interpreter.py trunk/relax.py Modified: trunk/prompt/interpreter.py URL: http://svn.gna.org/viewcvs/relax/trunk/prompt/interpreter.py?rev=22184r1=22183r2=22184view=diff == --- trunk/prompt/interpreter.py (original) +++ trunk/prompt/interpreter.py Fri Feb 14 11:22:57 2014 @@ -336,14 +336,18 @@ # Reverse the system path so that the script path is first. sys.path.reverse() -# Execute the script as a module. -#if dep_check.runpy_module: -#runpy.run_module(module, globals) +# Execute the script as a module if the inspect interactively prompt flag is not true. +if dep_check.runpy_module and not status.prompt: +runpy.run_module(module, globals) + +# Execute the script as a module if the inspect interactively prompt flag is not true. +elif dep_check.runpy_module and not status.prompt: +runpy.run_module(module, globals) # Allow scripts to run under Python = 2.4. -#else: -#exec(compile(open(name).read(), name, 'exec'), globals) -exec(compile(open(name).read(), name, 'exec'), globals) +else: +exec(compile(open(name).read(), name, 'exec'), globals) + finally: # Switch back to the original working directory. Modified: trunk/relax.py URL: http://svn.gna.org/viewcvs/relax/trunk/relax.py?rev=22184r1=22183r2=22184view=diff == --- trunk/relax.py (original) +++ trunk/relax.py Fri Feb 14 11:22:57 2014 @@ -215,7 +215,7 @@ # Only import the module in the test modes (to improve program start up speeds). from test_suite.test_suite_runner import Test_suite_runner -# Load the interpreter and turn intros on. +# Load the interpreter and turn intros on.launch relax in prompt mode after running any optionally supplied scripts self.interpreter = interpreter.Interpreter(show_script=False, raise_relax_error=True) self.interpreter.on() @@ -280,7 +280,7 @@ parser.add_option('-t', '--tee', action='store', type='string', dest='tee', help='tee relax output to stdout and the file LOG_FILE', metavar='LOG_FILE') parser.add_option('-g', '--gui', action='store_true', dest='gui', default=0, help='launch the relax GUI') parser.add_option('-e', '--escalate', action='store_true', dest='escalate', default=0, help='escalate all warnings to errors') -parser.add_option('-p', '--prompt', action='store_true', dest='prompt', default=0, help='execute the given script and continue into the prompt mode to allow for interactive inspection') +parser.add_option('-p', '--prompt', action='store_true', dest='prompt', default=0, help='launch relax in prompt mode after running any optionally supplied scripts') parser.add_option('--test', action='store_true', dest='test', default=0, help='run relax in test mode') parser.add_option('-x', '--test-suite', action='store_true', dest='test_suite', default=0, help='execute the relax test suite') parser.add_option('-s', '--system-tests', action='store_true', dest='system_tests', default=0, help='execute the relax system/functional tests (part of the test suite)') ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r22185 - in /trunk: prompt/interpreter.py relax.py
Author: tlinnet Date: Fri Feb 14 11:47:33 2014 New Revision: 22185 URL: http://svn.gna.org/viewcvs/relax?rev=22185view=rev Log: Manually reverted the temporary change of r22184 and 22183. The command used was: svn merge -r22184:r22182 . . r22184 | tlinnet | 2014-02-14 11:22:57 +0100 (Fri, 14 Feb 2014) | 6 lines Modified the help text to explain that -p will launch relax in prompt mode after running any optionally supplied scripts. Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i This is to allow the -p --prompt option to be given without a script. relax should support this so that a user doesn't get too confused when trying to start in prompt mode with the --prompt flag and support the --prompt argument without a script being supplied. r22183 | tlinnet | 2014-02-14 11:22:56 +0100 (Fri, 14 Feb 2014) | 1 line Second . Modified: trunk/prompt/interpreter.py trunk/relax.py Modified: trunk/prompt/interpreter.py URL: http://svn.gna.org/viewcvs/relax/trunk/prompt/interpreter.py?rev=22185r1=22184r2=22185view=diff == --- trunk/prompt/interpreter.py (original) +++ trunk/prompt/interpreter.py Fri Feb 14 11:47:33 2014 @@ -266,16 +266,12 @@ readline.parse_and_bind(tab: complete) # Execute the script file if given. -if script_file and not status.prompt: +if script_file: # Turn on the user function intro flag. status.uf_intro = True # Run the script. return run_script(intro=self.__intro_string, local=locals(), script_file=script_file, show_script=self.__show_script, raise_relax_error=self.__raise_relax_error) - -if script_file and status.prompt: -run_script(intro=self.__intro_string, local=locals(), script_file=script_file, show_script=self.__show_script, raise_relax_error=self.__raise_relax_error) -prompt(intro=None, local=locals()) # Go to the prompt. else: @@ -336,18 +332,13 @@ # Reverse the system path so that the script path is first. sys.path.reverse() -# Execute the script as a module if the inspect interactively prompt flag is not true. -if dep_check.runpy_module and not status.prompt: +# Execute the script as a module. +if dep_check.runpy_module: runpy.run_module(module, globals) -# Execute the script as a module if the inspect interactively prompt flag is not true. -elif dep_check.runpy_module and not status.prompt: -runpy.run_module(module, globals) - # Allow scripts to run under Python = 2.4. else: exec(compile(open(name).read(), name, 'exec'), globals) - finally: # Switch back to the original working directory. Modified: trunk/relax.py URL: http://svn.gna.org/viewcvs/relax/trunk/relax.py?rev=22185r1=22184r2=22185view=diff == --- trunk/relax.py (original) +++ trunk/relax.py Fri Feb 14 11:47:33 2014 @@ -215,7 +215,7 @@ # Only import the module in the test modes (to improve program start up speeds). from test_suite.test_suite_runner import Test_suite_runner -# Load the interpreter and turn intros on.launch relax in prompt mode after running any optionally supplied scripts +# Load the interpreter and turn intros on. self.interpreter = interpreter.Interpreter(show_script=False, raise_relax_error=True) self.interpreter.on() @@ -280,7 +280,7 @@ parser.add_option('-t', '--tee', action='store', type='string', dest='tee', help='tee relax output to stdout and the file LOG_FILE', metavar='LOG_FILE') parser.add_option('-g', '--gui', action='store_true', dest='gui', default=0, help='launch the relax GUI') parser.add_option('-e', '--escalate', action='store_true', dest='escalate', default=0, help='escalate all warnings to errors') -parser.add_option('-p', '--prompt', action='store_true', dest='prompt', default=0, help='launch relax in prompt mode after running any optionally supplied scripts') +parser.add_option('-p', '--prompt', action='store_true', dest='prompt', default=0, help='execute the given script and continue into the prompt mode to allow for interactive inspection') parser.add_option('--test', action='store_true', dest='test', default=0, help='run relax in test mode') parser.add_option('-x', '--test-suite', action='store_true', dest='test_suite', default=0, help='execute the relax test suite') parser.add_option('-s', '--system-tests', action='store_true', dest='system_tests', default=0, help='execute the relax
r22186 - /trunk/relax.py
Author: tlinnet Date: Fri Feb 14 11:54:44 2014 New Revision: 22186 URL: http://svn.gna.org/viewcvs/relax?rev=22186view=rev Log: Modified the help text to explain that -p will launch relax in prompt mode after running any optionally supplied scripts. Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i This is to allow the -p --prompt option to be given without a script. relax should support this so that a user doesn't get too confused when trying to start in prompt mode with the --prompt flag and support the --prompt argument without a script being supplied. Modified: trunk/relax.py Modified: trunk/relax.py URL: http://svn.gna.org/viewcvs/relax/trunk/relax.py?rev=22186r1=22185r2=22186view=diff == --- trunk/relax.py (original) +++ trunk/relax.py Fri Feb 14 11:54:44 2014 @@ -280,7 +280,7 @@ parser.add_option('-t', '--tee', action='store', type='string', dest='tee', help='tee relax output to stdout and the file LOG_FILE', metavar='LOG_FILE') parser.add_option('-g', '--gui', action='store_true', dest='gui', default=0, help='launch the relax GUI') parser.add_option('-e', '--escalate', action='store_true', dest='escalate', default=0, help='escalate all warnings to errors') -parser.add_option('-p', '--prompt', action='store_true', dest='prompt', default=0, help='execute the given script and continue into the prompt mode to allow for interactive inspection') +parser.add_option('-p', '--prompt', action='store_true', dest='prompt', default=0, help='launch relax in prompt mode after running any optionally supplied scripts') parser.add_option('--test', action='store_true', dest='test', default=0, help='run relax in test mode') parser.add_option('-x', '--test-suite', action='store_true', dest='test_suite', default=0, help='execute the relax test suite') parser.add_option('-s', '--system-tests', action='store_true', dest='system_tests', default=0, help='execute the relax system/functional tests (part of the test suite)') ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r22187 - /trunk/prompt/interpreter.py
Author: tlinnet Date: Fri Feb 14 12:13:05 2014 New Revision: 22187 URL: http://svn.gna.org/viewcvs/relax?rev=22187view=rev Log: Finished implementing the functionality of interacting with variables after executing a script. Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i For getting access to variables after executing a script, the variable should be saved under: cdp.X, where X define a container. The name space issue is discussed in: http://thread.gmane.org/gmane.science.nmr.relax.devel/5012 Modified: trunk/prompt/interpreter.py Modified: trunk/prompt/interpreter.py URL: http://svn.gna.org/viewcvs/relax/trunk/prompt/interpreter.py?rev=22187r1=22186r2=22187view=diff == --- trunk/prompt/interpreter.py (original) +++ trunk/prompt/interpreter.py Fri Feb 14 12:13:05 2014 @@ -266,12 +266,17 @@ readline.parse_and_bind(tab: complete) # Execute the script file if given. -if script_file: +if script_file and not status.prompt: # Turn on the user function intro flag. status.uf_intro = True # Run the script. return run_script(intro=self.__intro_string, local=locals(), script_file=script_file, show_script=self.__show_script, raise_relax_error=self.__raise_relax_error) + +# Execute the script and go into prompt if the interactive flag -p --prompt is given at startup. +if script_file and status.prompt: +run_script(intro=self.__intro_string, local=locals(), script_file=script_file, show_script=self.__show_script, raise_relax_error=self.__raise_relax_error) +prompt(intro=None, local=locals()) # Go to the prompt. else: ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r22188 - /trunk/prompt/interpreter.py
Author: tlinnet Date: Fri Feb 14 12:28:25 2014 New Revision: 22188 URL: http://svn.gna.org/viewcvs/relax?rev=22188view=rev Log: Added Copyright info to modified file. Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i Modified: trunk/prompt/interpreter.py Modified: trunk/prompt/interpreter.py URL: http://svn.gna.org/viewcvs/relax/trunk/prompt/interpreter.py?rev=22188r1=22187r2=22188view=diff == --- trunk/prompt/interpreter.py (original) +++ trunk/prompt/interpreter.py Fri Feb 14 12:28:25 2014 @@ -1,6 +1,7 @@ ### # # # Copyright (C) 2003-2014 Edward d'Auvergne # +# Copyright (C) 2014 Troels E. Linnet # # # # This file is part of the program relax (http://www.nmr-relax.com). # # # ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r22189 - /trunk/relax.py
Author: bugman Date: Fri Feb 14 14:24:25 2014 New Revision: 22189 URL: http://svn.gna.org/viewcvs/relax?rev=22189view=rev Log: Organisation of the relax command line options into distinct groups. This follows from the message at http://thread.gmane.org/gmane.science.nmr.relax.devel/5024. The optparse.OptionGroup object is now used to cluster the arguments. This cleans up the output of 'relax -h' and explains the options to the user in a clearer way. Modified: trunk/relax.py Modified: trunk/relax.py URL: http://svn.gna.org/viewcvs/relax/trunk/relax.py?rev=22189r1=22188r2=22189view=diff == --- trunk/relax.py (original) +++ trunk/relax.py Fri Feb 14 14:24:25 2014 @@ -41,7 +41,7 @@ # Python modules. import numpy -from optparse import Option, OptionParser +from optparse import Option, OptionGroup, OptionParser from os import F_OK, access, getpid, putenv if dep_check.cprofile_module: import cProfile as profile @@ -273,25 +273,43 @@ # Parser object. parser = RelaxParser(self, usage=usage: %prog [options] [script_file]) -# Recognised command line options. -parser.add_option('-d', '--debug', action='store_true', dest='debug', default=0, help='enable debugging output') -parser.add_option('-l', '--log', action='store', type='string', dest='log', help='log relax output to the file LOG_FILE', metavar='LOG_FILE') -parser.add_option('--licence', action='store_true', dest='licence', default=0, help='display the licence') -parser.add_option('-t', '--tee', action='store', type='string', dest='tee', help='tee relax output to stdout and the file LOG_FILE', metavar='LOG_FILE') -parser.add_option('-g', '--gui', action='store_true', dest='gui', default=0, help='launch the relax GUI') -parser.add_option('-e', '--escalate', action='store_true', dest='escalate', default=0, help='escalate all warnings to errors') -parser.add_option('-p', '--prompt', action='store_true', dest='prompt', default=0, help='launch relax in prompt mode after running any optionally supplied scripts') -parser.add_option('--test', action='store_true', dest='test', default=0, help='run relax in test mode') -parser.add_option('-x', '--test-suite', action='store_true', dest='test_suite', default=0, help='execute the relax test suite') -parser.add_option('-s', '--system-tests', action='store_true', dest='system_tests', default=0, help='execute the relax system/functional tests (part of the test suite)') -parser.add_option('-u', '--unit-tests', action='store_true', dest='unit_tests', default=0, help='execute the relax unit tests (part of the test suite)') -parser.add_option('--gui-tests', action='store_true', dest='gui_tests', default=0, help='execute the relax GUI tests (part of the test suite)') -parser.add_option('--time', action='store_true', dest='tt', default=0, help='enable the timing of individual tests in the test suite') -parser.add_option('-i', '--info', action='store_true', dest='info', default=0, help='display information about this version of relax') -parser.add_option('-v', '--version', action='store_true', dest='version', default=0, help='show the version number and exit') -parser.add_option('-m', '--multi', action='store', type='string', dest='multiprocessor', default='uni', help='set multi processor method') -parser.add_option('-n', '--processors', action='store', type='int', dest='n_processors', default=-1, help='set number of processors (may be ignored)') -parser.add_option('--numpy-raise', action='store_true', dest='numpy_raise', default=0, help='convert numpy warnings to errors') +# Recognised command line options for the UI. +group = OptionGroup(parser, 'UI options') +group.add_option('-p', '--prompt', action='store_true', dest='prompt', default=0, help='launch relax in prompt mode after running any optionally supplied scripts') +group.add_option('-g', '--gui', action='store_true', dest='gui', default=0, help='launch the relax GUI') +group.add_option('-i', '--info', action='store_true', dest='info', default=0, help='display information about this version of relax') +group.add_option('-v', '--version', action='store_true', dest='version', default=0, help='show the version number and exit') +group.add_option('--licence', action='store_true', dest='licence', default=0, help='display the licence') +group.add_option('--test', action='store_true', dest='test', default=0, help='run relax in test mode') +parser.add_option_group(group) + +# Recognised command line options for the multiprocessor. +group = OptionGroup(parser, 'Multi-processor options') +group.add_option('-m', '--multi', action='store', type='string', dest='multiprocessor', default='uni',
r22190 - in /branches/double_rotor: ./ lib/errors.py lib/warnings.py prompt/interpreter.py relax.py status.py
Author: bugman Date: Fri Feb 14 14:32:41 2014 New Revision: 22190 URL: http://svn.gna.org/viewcvs/relax?rev=22190view=rev Log: Merged revisions 22181-22189 via svnmerge from svn+ssh://bug...@svn.gna.org/svn/relax/trunk r22181 | tlinnet | 2014-02-14 10:32:15 +0100 (Fri, 14 Feb 2014) | 3 lines Shifted the pedantic flag to escalate flag. The option -p would insted be used for the option --prompt. Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i r22182 | tlinnet | 2014-02-14 10:32:17 +0100 (Fri, 14 Feb 2014) | 3 lines Added the -p --prompt option for running a relax script and inspect interactively. Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i r22183 | tlinnet | 2014-02-14 11:22:56 +0100 (Fri, 14 Feb 2014) | 1 line Second r22184 | tlinnet | 2014-02-14 11:22:57 +0100 (Fri, 14 Feb 2014) | 6 lines Modified the help text to explain that -p will launch relax in prompt mode after running any optionally supplied scripts. Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i This is to allow the -p --prompt option to be given without a script. relax should support this so that a user doesn't get too confused when trying to start in prompt mode with the --prompt flag and support the --prompt argument without a script being supplied. r22185 | tlinnet | 2014-02-14 11:47:33 +0100 (Fri, 14 Feb 2014) | 22 lines Manually reverted the temporary change of r22184 and 22183. The command used was: svn merge -r22184:r22182 . . r22184 | tlinnet | 2014-02-14 11:22:57 +0100 (Fri, 14 Feb 2014) | 6 lines Modified the help text to explain that -p will launch relax in prompt mode after running any optionally supplied scripts. Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i This is to allow the -p --prompt option to be given without a script. relax should support this so that a user doesn't get too confused when trying to start in prompt mode with the --prompt flag and support the --prompt argument without a script being supplied. r22183 | tlinnet | 2014-02-14 11:22:56 +0100 (Fri, 14 Feb 2014) | 1 line Second . r22186 | tlinnet | 2014-02-14 11:54:44 +0100 (Fri, 14 Feb 2014) | 6 lines Modified the help text to explain that -p will launch relax in prompt mode after running any optionally supplied scripts. Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i This is to allow the -p --prompt option to be given without a script. relax should support this so that a user doesn't get too confused when trying to start in prompt mode with the --prompt flag and support the --prompt argument without a script being supplied. r22187 | tlinnet | 2014-02-14 12:13:05 +0100 (Fri, 14 Feb 2014) | 6 lines Finished implementing the functionality of interacting with variables after executing a script. Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i For getting access to variables after executing a script, the variable should be saved under: cdp.X, where X define a container. The name space issue is discussed in: http://thread.gmane.org/gmane.science.nmr.relax.devel/5012 r22188 | tlinnet | 2014-02-14 12:28:25 +0100 (Fri, 14 Feb 2014) | 3 lines Added Copyright info to modified file. Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i r22189 | bugman | 2014-02-14 14:24:25 +0100 (Fri, 14 Feb 2014) | 8 lines Organisation of the relax command line options into distinct groups. This follows from the message at http://thread.gmane.org/gmane.science.nmr.relax.devel/5024. The optparse.OptionGroup object is now used to cluster the arguments. This cleans up the output of 'relax -h' and explains the options to the user in a clearer way. Modified: branches/double_rotor/ (props changed) branches/double_rotor/lib/errors.py branches/double_rotor/lib/warnings.py branches/double_rotor/prompt/interpreter.py branches/double_rotor/relax.py branches/double_rotor/status.py Propchange: branches/double_rotor/ -- --- svnmerge-integrated (original) +++ svnmerge-integrated Fri Feb 14
r22191 - /trunk/prompt/interpreter.py
Author: tlinnet Date: Fri Feb 14 15:19:58 2014 New Revision: 22191 URL: http://svn.gna.org/viewcvs/relax?rev=22191view=rev Log: Fix for the user function intro flag. Fix for sr #3117, (https://gna.org/support/?3117) - Functionality to inspect interactively after running script - The equivalence to python -i It should be turned on for the script so you see the relax messages, and then turned off again for the prompt so that the user function text and relax is not printed out twice. Modified: trunk/prompt/interpreter.py Modified: trunk/prompt/interpreter.py URL: http://svn.gna.org/viewcvs/relax/trunk/prompt/interpreter.py?rev=22191r1=22190r2=22191view=diff == --- trunk/prompt/interpreter.py (original) +++ trunk/prompt/interpreter.py Fri Feb 14 15:19:58 2014 @@ -276,7 +276,16 @@ # Execute the script and go into prompt if the interactive flag -p --prompt is given at startup. if script_file and status.prompt: +# Turn on the user function intro flag. +status.uf_intro = True + +# Run the script. run_script(intro=self.__intro_string, local=locals(), script_file=script_file, show_script=self.__show_script, raise_relax_error=self.__raise_relax_error) + +# Turn off the user function intro flag. +status.uf_intro = False + +# Go to the prompt. prompt(intro=None, local=locals()) # Go to the prompt. ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r22192 - in /branches/double_rotor/test_suite/system_tests/scripts/frame_order/cam: base_script.py rotor.py
Author: bugman Date: Fri Feb 14 17:25:00 2014 New Revision: 22192 URL: http://svn.gna.org/viewcvs/relax?rev=22192view=rev Log: Converted the Frame_order.test_cam_rotor system script test to use the new rotor model parameters. The rotor frame order parameters {P_alpha, P_beta, P_gamma, T_x, T_y, T_z, E_theta, E_phi, p_x, p_y, p_z}, where P_i are the Euler angles defining the average domain position, T_i are the translations defining the average domain position, E_i are the Eigenframe angles defining the rotation axis, and p_i are the pivot point coordinates, will be converted to {P_alpha, P_beta, P_gamma, T_x, T_y, T_z, Ax_alpha, p_x, p_y, p_z}. Ax_alpha is the new parameter which defines the rotation axis together with the pivot using the minimal parameter set {p_x, p_y, p_z, Ax_alpha}. Modified: branches/double_rotor/test_suite/system_tests/scripts/frame_order/cam/base_script.py branches/double_rotor/test_suite/system_tests/scripts/frame_order/cam/rotor.py Modified: branches/double_rotor/test_suite/system_tests/scripts/frame_order/cam/base_script.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/test_suite/system_tests/scripts/frame_order/cam/base_script.py?rev=22192r1=22191r2=22192view=diff == --- branches/double_rotor/test_suite/system_tests/scripts/frame_order/cam/base_script.py (original) +++ branches/double_rotor/test_suite/system_tests/scripts/frame_order/cam/base_script.py Fri Feb 14 17:25:00 2014 @@ -129,6 +129,8 @@ self._execute_uf(uf_name='value.set', val=self.AXIS_THETA, param='axis_theta') if self.AXIS_PHI != None: self._execute_uf(uf_name='value.set', val=self.AXIS_PHI, param='axis_phi') +if self.AXIS_ALPHA != None: +self._execute_uf(uf_name='value.set', val=self.AXIS_ALPHA, param='axis_alpha') if self.CONE_THETA_X != None: self._execute_uf(uf_name='value.set', val=self.CONE_THETA_X, param='cone_theta_x') if self.CONE_THETA_Y != None: Modified: branches/double_rotor/test_suite/system_tests/scripts/frame_order/cam/rotor.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/test_suite/system_tests/scripts/frame_order/cam/rotor.py?rev=22192r1=22191r2=22192view=diff == --- branches/double_rotor/test_suite/system_tests/scripts/frame_order/cam/rotor.py (original) +++ branches/double_rotor/test_suite/system_tests/scripts/frame_order/cam/rotor.py Fri Feb 14 17:25:00 2014 @@ -22,8 +22,12 @@ # Module docstring. Script for optimising the rotor frame order test model of CaM. +# Python module imports +from numpy import arcsin, array, dot, float64, zeros + # relax module imports. from base_script import Base_script +from lib.geometry.coord_transform import spherical_to_cartesian class Analysis(Base_script): @@ -31,10 +35,14 @@ # Set up some class variables. DIRECTORY = 'rotor' MODEL = 'rotor' -AXIS_THETA = 0.9600799785953431 -AXIS_PHI = 4.0322755062196229 CONE_SIGMA_MAX = 30.0 / 360.0 * 2.0 * pi +# Translate the system. +axis_theta = 0.9600799785953431 +axis_phi = 4.0322755062196229 +r_ax = zeros(3, float64) +spherical_to_cartesian([1, axis_theta, axis_phi], r_ax) +AXIS_ALPHA = arcsin(dot(r_ax, array([0, 0, 1], float64))) # Execute the analysis. Analysis(self._execute_uf) ___ relax (http://www.nmr-relax.com) This is the relax-commits mailing list relax-commits@gna.org To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
r22193 - in /branches/double_rotor/specific_analyses/frame_order: api.py parameters.py
Author: bugman Date: Fri Feb 14 17:26:33 2014 New Revision: 22193 URL: http://svn.gna.org/viewcvs/relax?rev=22193view=rev Log: Added support for the new axis_alpha frame order parameter to the specific_analyses.frame_order package. Modified: branches/double_rotor/specific_analyses/frame_order/api.py branches/double_rotor/specific_analyses/frame_order/parameters.py Modified: branches/double_rotor/specific_analyses/frame_order/api.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/specific_analyses/frame_order/api.py?rev=22193r1=22192r2=22193view=diff == --- branches/double_rotor/specific_analyses/frame_order/api.py (original) +++ branches/double_rotor/specific_analyses/frame_order/api.py Fri Feb 14 17:26:33 2014 @@ -71,6 +71,7 @@ self.PARAMS.add('eigen_gamma', scope='global', units='rad', desc='The Eigenframe gamma Euler angle', py_type=float, set='params', err=True, sim=True) self.PARAMS.add('axis_theta', scope='global', units='rad', desc='The cone axis polar angle (for the isotropic cone model)', py_type=float, set='params', err=True, sim=True) self.PARAMS.add('axis_phi', scope='global', units='rad', desc='The cone axis azimuthal angle (for the isotropic cone model)', py_type=float, set='params', err=True, sim=True) +self.PARAMS.add('axis_alpha', scope='global', units='rad', desc='The rotor axis alpha angle (the rotation angle out of the xy plane)', py_type=float, set='params', err=True, sim=True) self.PARAMS.add('cone_theta_x', scope='global', units='rad', desc='The pseudo-ellipse cone opening half-angle for the x-axis', py_type=float, set='params', err=True, sim=True) self.PARAMS.add('cone_theta_y', scope='global', units='rad', desc='The pseudo-ellipse cone opening half-angle for the y-axis', py_type=float, set='params', err=True, sim=True) self.PARAMS.add('cone_theta', scope='global', units='rad', desc='The isotropic cone opening half-angle', py_type=float, set='params', err=True, sim=True) @@ -420,7 +421,7 @@ upper = 5 # Linear angle grid from 0 to one inc before 2pi. -if cdp.params[i] in ['ave_pos_alpha', 'ave_pos_gamma', 'eigen_alpha', 'eigen_gamma', 'axis_phi']: +if cdp.params[i] in ['ave_pos_alpha', 'ave_pos_gamma', 'eigen_alpha', 'eigen_gamma', 'axis_phi', 'axis_alpha']: lower = 0.0 upper = 2*pi * (1.0 - 1.0/incs[i]) @@ -544,6 +545,10 @@ # Axis spherical coordinate phi. if param == 'axis_phi': +return [0.0, 2*pi] + +# Axis alpha angle. +if param == 'axis_alpha': return [0.0, 2*pi] # Cone angle. Modified: branches/double_rotor/specific_analyses/frame_order/parameters.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/specific_analyses/frame_order/parameters.py?rev=22193r1=22192r2=22193view=diff == --- branches/double_rotor/specific_analyses/frame_order/parameters.py (original) +++ branches/double_rotor/specific_analyses/frame_order/parameters.py Fri Feb 14 17:26:33 2014 @@ -86,7 +86,7 @@ param_vect.append(cdp.eigen_gamma) # Frame order eigenframe - the isotropic cone axis. -elif cdp.model in ['iso cone', 'free rotor', 'iso cone, torsionless', 'iso cone, free rotor', 'rotor', 'double rotor']: +elif cdp.model in ['iso cone', 'free rotor', 'iso cone, torsionless', 'iso cone, free rotor', 'double rotor']: param_vect.append(cdp.axis_theta) param_vect.append(cdp.axis_phi) @@ -94,6 +94,10 @@ if cdp.model in ['double rotor']: param_vect.append(cdp.axis_theta_2) param_vect.append(cdp.axis_phi_2) + +# Frame order eigenframe - the rotor axis alpha angle. +if cdp.model in ['rotor']: +param_vect.append(cdp.axis_alpha) # Cone parameters - pseudo-elliptic cone parameters. if cdp.model in ['pseudo-ellipse', 'pseudo-ellipse, torsionless', 'pseudo-ellipse, free rotor']: @@ -138,7 +142,7 @@ param_vect.append(cdp.eigen_gamma_sim[sim_index]) # Frame order eigenframe - the isotropic cone axis. -elif cdp.model in ['iso cone', 'free rotor', 'iso cone, torsionless', 'iso cone, free rotor', 'rotor', 'double rotor']: +elif cdp.model in ['iso cone', 'free rotor', 'iso cone, torsionless', 'iso cone, free rotor', 'double rotor']: param_vect.append(cdp.axis_theta_sim[sim_index]) param_vect.append(cdp.axis_phi_sim[sim_index]) @@ -146,6 +150,10 @@ if cdp.model in ['double rotor']: param_vect.append(cdp.axis_theta_sim_2[sim_index]) param_vect.append(cdp.axis_phi_sim_2[sim_index]) + +# Frame order eigenframe - the rotor axis alpha angle. +
r22194 - in /branches/double_rotor: specific_analyses/frame_order/optimisation.py target_functions/frame_order.py
Author: bugman Date: Fri Feb 14 17:54:31 2014 New Revision: 22194 URL: http://svn.gna.org/viewcvs/relax?rev=22194view=rev Log: Implemented the new frame order rotor model parameters in the target function. The parameters {axis_theta, axis_phi} have been replaced by the single axis_alpha. To support the new model construct, the CoM of the entire system is now passed into the target function. Modified: branches/double_rotor/specific_analyses/frame_order/optimisation.py branches/double_rotor/target_functions/frame_order.py Modified: branches/double_rotor/specific_analyses/frame_order/optimisation.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/specific_analyses/frame_order/optimisation.py?rev=22194r1=22193r2=22194view=diff == --- branches/double_rotor/specific_analyses/frame_order/optimisation.py (original) +++ branches/double_rotor/specific_analyses/frame_order/optimisation.py Fri Feb 14 17:54:31 2014 @@ -683,14 +683,18 @@ if not hasattr(cdp, 'num_int_pts'): cdp.num_int_pts = 20 +# The centre of mass, for use in the rotor models. +com = pipe_centre_of_mass(verbosity=0) +com = array(com, float64) + # The centre of mass of the moving domain - to use as the centroid for the average domain position rotation. if cdp.ave_pos_pivot == 'com': -com = pipe_centre_of_mass(atom_id=domain_moving(), verbosity=0) +ave_pos_pivot = pipe_centre_of_mass(atom_id=domain_moving(), verbosity=0) ave_pos_piv_sync = False # The centre of mass of the moving domain - to use as the centroid for the average domain position rotation. if cdp.ave_pos_pivot == 'motional': -com = pivot +ave_pos_pivot = pivot ave_pos_piv_sync = True # Print outs. @@ -709,7 +713,7 @@ sys.stdout.write(Base data: %s\n % repr(base_data)) # Set up the optimisation function. -target = frame_order.Frame_order(model=cdp.model, init_params=param_vector, full_tensors=full_tensors, full_in_ref_frame=full_in_ref_frame, rdcs=rdcs, rdc_errors=rdc_err, rdc_weights=rdc_weight, rdc_vect=rdc_vect, dip_const=rdc_const, pcs=pcs, pcs_errors=pcs_err, pcs_weights=pcs_weight, atomic_pos=atomic_pos, temp=temp, frq=frq, paramag_centre=paramag_centre, scaling_matrix=scaling_matrix, ave_pos_pivot=com, ave_pos_piv_sync=ave_pos_piv_sync, translation_opt=translation_opt, pivot=pivot, pivot2=pivot2, pivot_opt=pivot_opt, num_int_pts=cdp.num_int_pts, quad_int=cdp.quad_int) +target = frame_order.Frame_order(model=cdp.model, init_params=param_vector, full_tensors=full_tensors, full_in_ref_frame=full_in_ref_frame, rdcs=rdcs, rdc_errors=rdc_err, rdc_weights=rdc_weight, rdc_vect=rdc_vect, dip_const=rdc_const, pcs=pcs, pcs_errors=pcs_err, pcs_weights=pcs_weight, atomic_pos=atomic_pos, temp=temp, frq=frq, paramag_centre=paramag_centre, scaling_matrix=scaling_matrix, com=com, ave_pos_pivot=ave_pos_pivot, ave_pos_piv_sync=ave_pos_piv_sync, translation_opt=translation_opt, pivot=pivot, pivot2=pivot2, pivot_opt=pivot_opt, num_int_pts=cdp.num_int_pts, quad_int=cdp.quad_int) # Return the data. return target, param_vector, data_types, scaling_matrix Modified: branches/double_rotor/target_functions/frame_order.py URL: http://svn.gna.org/viewcvs/relax/branches/double_rotor/target_functions/frame_order.py?rev=22194r1=22193r2=22194view=diff == --- branches/double_rotor/target_functions/frame_order.py (original) +++ branches/double_rotor/target_functions/frame_order.py Fri Feb 14 17:54:31 2014 @@ -25,7 +25,7 @@ # Python module imports. from copy import deepcopy from math import acos, pi, sqrt -from numpy import array, dot, float32, float64, ones, transpose, uint8, zeros +from numpy import array, cross, dot, float32, float64, ones, transpose, uint8, zeros from numpy.linalg import norm # relax module imports. @@ -46,7 +46,7 @@ from lib.frame_order.pseudo_ellipse_torsionless import compile_2nd_matrix_pseudo_ellipse_torsionless, pcs_numeric_int_pseudo_ellipse_torsionless, pcs_numeric_int_pseudo_ellipse_torsionless_qrint from lib.frame_order.rotor import compile_2nd_matrix_rotor, pcs_numeric_int_rotor, pcs_numeric_int_rotor_qrint from lib.geometry.coord_transform import spherical_to_cartesian -from lib.geometry.rotations import euler_to_R_zyz, two_vect_to_R +from lib.geometry.rotations import axis_angle_to_R, euler_to_R_zyz, two_vect_to_R from lib.linear_algebra.kronecker_product import kron_prod from lib.order import order_parameters from lib.physical_constants import pcs_constant @@ -56,7 +56,7 @@ class Frame_order: Class containing the target function of the optimisation of Frame Order matrix components. -def __init__(self, model=None, init_params=None, full_tensors=None, full_in_ref_frame=None, rdcs=None, rdc_errors=None,