mailr17045 - in /branches/interatomic: ./ specific_fns/n_state_model.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on June 25, 2012 - 09:41:
Author: bugman
Date: Mon Jun 25 09:41:05 2012
New Revision: 17045

URL: http://svn.gna.org/viewcvs/relax?rev=17045&view=rev
Log:
Merged revisions 17044 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk

........
  r17044 | bugman | 2012-06-25 09:34:49 +0200 (Mon, 25 Jun 2012) | 6 lines
  
  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:
    branches/interatomic/   (props changed)
    branches/interatomic/specific_fns/n_state_model.py

Propchange: branches/interatomic/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Jun 25 09:41:05 2012
@@ -1,1 +1,1 @@
-/trunk:1-17040
+/trunk:1-17044

Modified: branches/interatomic/specific_fns/n_state_model.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/interatomic/specific_fns/n_state_model.py?rev=17045&r1=17044&r2=17045&view=diff
==============================================================================
--- branches/interatomic/specific_fns/n_state_model.py (original)
+++ branches/interatomic/specific_fns/n_state_model.py Mon Jun 25 09:41:05 
2012
@@ -603,41 +603,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):




Related Messages


Powered by MHonArc, Updated Mon Jun 25 11:20:01 2012