Author: bugman Date: Wed May 21 23:18:10 2008 New Revision: 6215 URL: http://svn.gna.org/viewcvs/relax?rev=6215&view=rev Log: Converted the select_all_sims() function to the new design. Modified: 1.3/generic_fns/monte_carlo.py Modified: 1.3/generic_fns/monte_carlo.py URL: http://svn.gna.org/viewcvs/relax/1.3/generic_fns/monte_carlo.py?rev=6215&r1=6214&r2=6215&view=diff ============================================================================== --- 1.3/generic_fns/monte_carlo.py (original) +++ 1.3/generic_fns/monte_carlo.py Wed May 21 23:18:10 2008 @@ -309,31 +309,7 @@ def select_all_sims(number=None, all_select_sim=None): - """Set the select flag of all simulations of all instances to one.""" - - # Specific number of instances and set the selected simulation array functions. - count_num_instances = get_specific_fn('num_instances', cdp.pipe_type) - set_selected_sim = get_specific_fn('set_selected_sim', cdp.pipe_type) - - # Count the number of instances. - num_instances = count_num_instances(self.run) - - # Create the selected simulation array with all simulations selected. - if all_select_sim == None: - select_sim = ones(number, int) - - # Loop over the instances. - for instance in xrange(num_instances): - # Set up the selected simulation array. - if all_select_sim != None: - select_sim = all_select_sim[instance].tolist() - - # Set the selected simulation array. - set_selected_sim(self.run, instance, select_sim) - - -def setup(number=None, all_select_sim=None): - """Function for setting up Monte Carlo simulations. + """Set the select flag of all simulations of all instances to one. @keyword number: The number of Monte Carlo simulations to set up. @type number: int @@ -343,6 +319,41 @@ @type all_select_sim: numpy matrix (int) """ + # Alias the current data pipe. + cdp = relax_data_store[relax_data_store.current_pipe] + + # Specific number of instances and set the selected simulation array functions. + count_num_instances = get_specific_fn('num_instances', cdp.pipe_type) + set_selected_sim = get_specific_fn('set_selected_sim', cdp.pipe_type) + + # Count the number of instances. + num_instances = count_num_instances() + + # Create the selected simulation array with all simulations selected. + if all_select_sim == None: + select_sim = ones(number, int) + + # Loop over the instances. + for instance in xrange(num_instances): + # Set up the selected simulation array. + if all_select_sim != None: + select_sim = all_select_sim[instance].tolist() + + # Set the selected simulation array. + set_selected_sim(instance, select_sim) + + +def setup(number=None, all_select_sim=None): + """Function for setting up Monte Carlo simulations. + + @keyword number: The number of Monte Carlo simulations to set up. + @type number: int + @keyword all_select_sim: The selection status of the Monte Carlo simulations. The first + dimension of this matrix corresponds to the simulation and the + second corresponds to the instance. + @type all_select_sim: numpy matrix (int) + """ + # Test if the current data pipe exists. if not relax_data_store.current_pipe: raise RelaxNoPipeError