Author: bugman Date: Thu Jan 7 17:00:40 2010 New Revision: 10137 URL: http://svn.gna.org/viewcvs/relax?rev=10137&view=rev Log: Code simplification. The build_mf() and run_command() methods have been collapsed into the run() method, significantly cutting the amount of jumping around in the code. Modified: branches/multi_processor_merge/specific_fns/model_free/multi_processor_commands.py Modified: branches/multi_processor_merge/specific_fns/model_free/multi_processor_commands.py URL: http://svn.gna.org/viewcvs/relax/branches/multi_processor_merge/specific_fns/model_free/multi_processor_commands.py?rev=10137&r1=10136&r2=10137&view=diff ============================================================================== --- branches/multi_processor_merge/specific_fns/model_free/multi_processor_commands.py (original) +++ branches/multi_processor_merge/specific_fns/model_free/multi_processor_commands.py Thu Jan 7 17:00:40 2010 @@ -161,10 +161,6 @@ self.info_map = {'spin_id':None, 'sim_index':None, 'grid_size':1} - def build_mf(self): - return Mf(**self.mf_map) - - def do_feedback(self): """Minimisation print out.""" @@ -223,9 +219,17 @@ # Run catching all errors. try: + # Set up. self.pre_run(processor) self.pre_command_feed_back(processor) - results = self.run_command(processor) + + # Initialise the function to minimise. + self.mf = Mf(**self.mf_map) + + # Minimisation. + results = generic_minimise(func=self.mf.func, dfunc=self.mf.dfunc, d2func=self.mf.d2func, **self.minimise_map) + + # Processing. self.post_command_feedback(results, processor) self.process_results(results, processor, completed) self.post_run(processor) @@ -236,11 +240,6 @@ raise e else: raise Capturing_exception(rank=processor.rank(), name=processor.get_name()) - - - def run_command(self, processor): - self.mf = self.build_mf() - return generic_minimise(func=self.mf.func, dfunc=self.mf.dfunc, d2func=self.mf.d2func, **self.minimise_map) #FIXME: bad names