Author: bugman Date: Mon Jun 25 09:34:49 2012 New Revision: 17044 URL: http://svn.gna.org/viewcvs/relax?rev=17044&view=rev Log: Modified the working of the n_state_model.elim_no_prob backend. This user function is not functional anyway and is not tested by the relax test suite, but will remain as it might be useful in the future. Modified: trunk/specific_fns/n_state_model.py Modified: trunk/specific_fns/n_state_model.py URL: http://svn.gna.org/viewcvs/relax/trunk/specific_fns/n_state_model.py?rev=17044&r1=17043&r2=17044&view=diff ============================================================================== --- trunk/specific_fns/n_state_model.py (original) +++ trunk/specific_fns/n_state_model.py Mon Jun 25 09:34:49 2012 @@ -605,41 +605,15 @@ if not hasattr(cdp, 'probs'): raise RelaxError("The N-state model populations do not exist.") + # Create the data structure if needed. + if not hasattr(cdp, 'select_models'): + cdp.state_select = [True] * cdp.N + # Loop over the structures. - i = 0 - while True: - # End condition. - if i == cdp.N - 1: - break - + for i in range(len(cdp.N)): # No probability. if cdp.probs[i] < 1e-5: - # Remove the probability. - cdp.probs.pop(i) - - # Remove the structure. - cdp.structure.structural_data.pop(i) - - # Eliminate bond vectors. - for spin in spin_loop(): - # Position info. - if hasattr(spin, 'pos'): - spin.pos.pop(i) - - # Vector info. - if hasattr(spin, 'xh_vect'): - spin.xh_vect.pop(i) - if hasattr(spin, 'bond_vect'): - spin.bond_vect.pop(i) - - # Update N. - cdp.N -= 1 - - # Start the loop again without incrementing i. - continue - - # Increment i. - i += 1 + cdp.state_select[i] = False def _linear_constraints(self, data_types=None, scaling_matrix=None):