Author: bugman Date: Tue Jan 4 09:36:28 2011 New Revision: 12109 URL: http://svn.gna.org/viewcvs/relax?rev=12109&view=rev Log: Shifted the status singleton instantiation to the import level in all modules. This should save execution time. The last commit omitted the main relax directories. Modified: 1.3/auto_analyses/dauvergne_protocol.py 1.3/auto_analyses/noe.py 1.3/auto_analyses/relax_fit.py 1.3/auto_analyses/stereochem_analysis.py 1.3/generic_fns/minimise.py 1.3/prompt/interpreter.py 1.3/relax_errors.py 1.3/relax_warnings.py Modified: 1.3/auto_analyses/dauvergne_protocol.py URL: http://svn.gna.org/viewcvs/relax/1.3/auto_analyses/dauvergne_protocol.py?rev=12109&r1=12108&r2=12109&view=diff ============================================================================== --- 1.3/auto_analyses/dauvergne_protocol.py (original) +++ 1.3/auto_analyses/dauvergne_protocol.py Tue Jan 4 09:36:28 2011 @@ -150,7 +150,7 @@ from generic_fns import pipes from prompt.interpreter import Interpreter from relax_errors import RelaxError -from status import Status +from status import Status; status = Status() @@ -200,11 +200,8 @@ @type conv_loop: bool """ - # Initialise the status. - self.status = Status() - # Execution lock. - self.status.exec_lock.acquire('auto dauvergne protocol') + status.exec_lock.acquire('auto dauvergne protocol') # Store the args. self.diff_model = diff_model @@ -231,9 +228,9 @@ self.check_vars() # Some info for the status. - self.status.dAuvergne_protocol.diff_model = diff_model - self.status.dAuvergne_protocol.mf_models = mf_models - self.status.dAuvergne_protocol.local_tm_models = local_tm_models + status.dAuvergne_protocol.diff_model = diff_model + status.dAuvergne_protocol.mf_models = mf_models + status.dAuvergne_protocol.local_tm_models = local_tm_models # Initialise the convergence data structures. self.conv_data = Container() @@ -292,7 +289,7 @@ while True: # Determine which round of optimisation to do (init, round_1, round_2, etc). self.round = self.determine_rnd(model=self.diff_model) - self.status.dAuvergne_protocol.round = self.round + status.dAuvergne_protocol.round = self.round # Inital round of optimisation for diffusion models MII to MV. if self.round == 0: @@ -379,7 +376,7 @@ break # Unset the status. - self.status.dAuvergne_protocol.round = None + status.dAuvergne_protocol.round = None # Final run. @@ -458,12 +455,12 @@ raise RelaxError("Unknown diffusion model, change the value of 'self.diff_model'") # Unset the status info. - self.status.dAuvergne_protocol.diff_model = None - self.status.dAuvergne_protocol.mf_models = None - self.status.dAuvergne_protocol.local_tm_models = None + status.dAuvergne_protocol.diff_model = None + status.dAuvergne_protocol.mf_models = None + status.dAuvergne_protocol.local_tm_models = None # Unlock execution. - self.status.exec_lock.release() + status.exec_lock.release() def check_vars(self): @@ -703,7 +700,7 @@ print("\nConvergence:") if converged: # Update the status. - self.status.dAuvergne_protocol.convergence = True + status.dAuvergne_protocol.convergence = True # Print out. print(" [ Yes ]") @@ -796,7 +793,7 @@ # Loop over the data pipes. for name in self.pipes: # Place the model name into the status container. - self.status.dAuvergne_protocol.current_model = name + status.dAuvergne_protocol.current_model = name # Create the data pipe. if pipes.has_pipe(name): @@ -851,7 +848,7 @@ self.interpreter.results.write(file='results', dir=dir, force=True) # Unset the status. - self.status.dAuvergne_protocol.current_model = None + status.dAuvergne_protocol.current_model = None class Container: Modified: 1.3/auto_analyses/noe.py URL: http://svn.gna.org/viewcvs/relax/1.3/auto_analyses/noe.py?rev=12109&r1=12108&r2=12109&view=diff ============================================================================== --- 1.3/auto_analyses/noe.py (original) +++ 1.3/auto_analyses/noe.py Tue Jan 4 09:36:28 2011 @@ -31,7 +31,7 @@ # relax module imports. from prompt.interpreter import Interpreter import generic_fns.structure.main -from status import Status +from status import Status; status = Status() @@ -69,11 +69,8 @@ @type heteronuc_pdb: str """ - # Initialise the status. - self.status = Status() - # Execution lock. - self.status.exec_lock.acquire('auto noe') + status.exec_lock.acquire('auto noe') # Store the args. self.pipe_name = pipe_name @@ -107,7 +104,7 @@ self.run() # Unlock execution. - self.status.exec_lock.release() + status.exec_lock.release() def run(self): Modified: 1.3/auto_analyses/relax_fit.py URL: http://svn.gna.org/viewcvs/relax/1.3/auto_analyses/relax_fit.py?rev=12109&r1=12108&r2=12109&view=diff ============================================================================== --- 1.3/auto_analyses/relax_fit.py (original) +++ 1.3/auto_analyses/relax_fit.py Tue Jan 4 09:36:28 2011 @@ -25,7 +25,7 @@ # relax module imports. from prompt.interpreter import Interpreter -from status import Status +from status import Status; status = Status() @@ -47,11 +47,8 @@ @type mc_num: int """ - # Initialise the status. - self.status = Status() - # Execution lock. - self.status.exec_lock.acquire('auto relax fit') + status.exec_lock.acquire('auto relax fit') # Store the args. self.pipe_name = pipe_name @@ -73,7 +70,7 @@ self.run() # Unlock execution. - self.status.exec_lock.release() + status.exec_lock.release() def run(self): Modified: 1.3/auto_analyses/stereochem_analysis.py URL: http://svn.gna.org/viewcvs/relax/1.3/auto_analyses/stereochem_analysis.py?rev=12109&r1=12108&r2=12109&view=diff ============================================================================== --- 1.3/auto_analyses/stereochem_analysis.py (original) +++ 1.3/auto_analyses/stereochem_analysis.py Tue Jan 4 09:36:28 2011 @@ -72,7 +72,7 @@ from prompt.interpreter import Interpreter from relax_errors import RelaxError from relax_io import mkdir_nofail -from status import Status +from status import Status; status = Status() @@ -140,11 +140,8 @@ @type upper_lim_rdc: int """ - # Initialise the status. - self.status = Status() - # Execution lock. - self.status.exec_lock.acquire('auto stereochem analysis') + status.exec_lock.acquire('auto stereochem analysis') # Store all the args. self.stage = stage @@ -194,7 +191,7 @@ mkdir_nofail(self.results_dir + sep + "logs") # Unlock execution. - self.status.exec_lock.release() + status.exec_lock.release() def run(self): Modified: 1.3/generic_fns/minimise.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/minimise.py?rev=12109&r1=12108&r2=12109&view=diff ============================================================================== --- 1.3/generic_fns/minimise.py (original) +++ 1.3/generic_fns/minimise.py Tue Jan 4 09:36:28 2011 @@ -31,7 +31,7 @@ from generic_fns import pipes from relax_errors import RelaxError import specific_fns -from status import Status +from status import Status; status = Status() def calc(verbosity=1): @@ -48,9 +48,6 @@ # Specific calculate function setup. calculate = specific_fns.setup.get_specific_fn('calculate', cdp.pipe_type) overfit_deselect = specific_fns.setup.get_specific_fn('overfit_deselect', cdp.pipe_type) - - # The status object. - status = Status() # Deselect spins lacking data: overfit_deselect() @@ -104,9 +101,6 @@ # Specific grid search function. grid_search = specific_fns.setup.get_specific_fn('grid_search', cdp.pipe_type) overfit_deselect = specific_fns.setup.get_specific_fn('overfit_deselect', cdp.pipe_type) - - # The status object. - status = Status() # Deselect spins lacking data: overfit_deselect() @@ -168,9 +162,6 @@ minimise = specific_fns.setup.get_specific_fn('minimise', cdp.pipe_type) overfit_deselect = specific_fns.setup.get_specific_fn('overfit_deselect', cdp.pipe_type) - # The status object. - status = Status() - # Deselect spins lacking data: overfit_deselect() Modified: 1.3/prompt/interpreter.py URL: http://svn.gna.org/viewcvs/relax/1.3/prompt/interpreter.py?rev=12109&r1=12108&r2=12109&view=diff ============================================================================== --- 1.3/prompt/interpreter.py (original) +++ 1.3/prompt/interpreter.py Tue Jan 4 09:36:28 2011 @@ -49,7 +49,7 @@ from info import Info_box if dep_check.readline_module: from tab_completion import Tab_completion -from status import Status +from status import Status; status = Status() # User functions. from angles import Angles @@ -344,7 +344,6 @@ """Execute the script.""" # Execution lock. - status = Status() status.exec_lock.acquire('script UI') # The module path. @@ -469,9 +468,6 @@ sys.stdout.write("----------------------------------------------------------------------------------------------------\n") file.close() - # The status object. - status = Status() - # The execution flag. exec_pass = True @@ -485,7 +481,7 @@ status.exec_lock.release() # Throw the error. - if Status().debug: + if status.debug: raise # Be nicer to the user. @@ -507,7 +503,7 @@ # Nice output for the user. else: # Print the scary traceback normally hidden from the user. - if Status().debug: + if status.debug: self.showtraceback() # Print the RelaxError message line. Modified: 1.3/relax_errors.py URL: http://svn.gna.org/viewcvs/relax/1.3/relax_errors.py?rev=12109&r1=12108&r2=12109&view=diff ============================================================================== --- 1.3/relax_errors.py (original) +++ 1.3/relax_errors.py Tue Jan 4 09:36:28 2011 @@ -37,7 +37,7 @@ from types import ClassType # relax module imports -from status import Status +from status import Status; status = Status() # Text variables. @@ -102,7 +102,7 @@ """Modify the behaviour of the error system.""" # Save the state if debugging is turned on. - if Status().debug: + if status.debug: save_state() # Modify the error message to include 'RelaxError' at the start. Modified: 1.3/relax_warnings.py URL: http://svn.gna.org/viewcvs/relax/1.3/relax_warnings.py?rev=12109&r1=12108&r2=12109&view=diff ============================================================================== --- 1.3/relax_warnings.py (original) +++ 1.3/relax_warnings.py Tue Jan 4 09:36:28 2011 @@ -30,7 +30,7 @@ # relax module imports. from relax_errors import BaseError -from status import Status +from status import Status; status = Status() # The warning formatting function. @@ -42,7 +42,7 @@ message = "RelaxWarning: %s\n" % message # Print stack-trace in debug mode. - if Status().debug: + if status.debug: tb = "" for frame in inspect.stack()[4:]: file = frame[1]