Author: bugman
Date: Tue Feb 10 12:55:10 2015
New Revision: 27615

URL: http://svn.gna.org/viewcvs/relax?rev=27615&view=rev
Log:
Merged revisions 27614 via svnmerge from 
svn+ssh://bug...@svn.gna.org/svn/relax/trunk

........
  r27614 | bugman | 2015-02-10 12:54:17 +0100 (Tue, 10 Feb 2015) | 8 lines
  
  Huge speed up of the internal structural object validate_models() method.
  
  The string formatting to create pseudo-PDB records and the large number of 
calls to the _translate()
  method for atomic information string formatting has been shifted to only be 
called when atomic
  information does not match.  Instead the structural information is directly 
compared within a large
  if-else statement.
........

Modified:
    branches/frame_order_cleanup/   (props changed)
    branches/frame_order_cleanup/lib/structure/internal/object.py

Propchange: branches/frame_order_cleanup/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Feb 10 12:55:10 2015
@@ -1 +1 @@
-/trunk:1-27612
+/trunk:1-27614

Modified: branches/frame_order_cleanup/lib/structure/internal/object.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/lib/structure/internal/object.py?rev=27615&r1=27614&r2=27615&view=diff
==============================================================================
--- branches/frame_order_cleanup/lib/structure/internal/object.py       
(original)
+++ branches/frame_order_cleanup/lib/structure/internal/object.py       Tue Feb 
10 12:55:10 2015
@@ -2692,14 +2692,27 @@
 
                 # Loop over the atoms.
                 for k in range(len(mol.atom_name)):
-                    # Create pseudo-pdb formatted records (with no atomic 
coordinates).
-                    atom = "%-6s%5s %4s%1s%3s %1s%4s%1s   %8s%8s%8s%6.2f%6.2f  
    %4s%2s%2s" % ('ATOM', mol.atom_num[k], self._translate(mol.atom_name[k]), 
'', self._translate(mol.res_name[k]), self._translate(mol.chain_id[k]), 
self._translate(mol.res_num[k]), '', '#', '#', '#', 1.0, 0, 
self._translate(mol.seg_id[k]), self._translate(mol.element[k]), '')
-                    atom_ref = "%-6s%5s %4s%1s%3s %1s%4s%1s   
%8s%8s%8s%6.2f%6.2f      %4s%2s%2s" % ('ATOM', mol_ref.atom_num[k], 
self._translate(mol_ref.atom_name[k]), '', 
self._translate(mol_ref.res_name[k]), self._translate(mol_ref.chain_id[k]), 
self._translate(mol_ref.res_num[k]), '', '#', '#', '#', 1.0, 0, 
self._translate(mol_ref.seg_id[k]), self._translate(mol_ref.element[k]), '')
-
-                    # Check the atom info.
-                    if atom != atom_ref:
-                        print(atom)
-                        print(atom_ref)
+                    # Check all data.
+                    same = True
+                    if mol.chain_id[k] != mol_ref.chain_id[k]:
+                        same = False
+                    elif mol.atom_num[k] != mol_ref.atom_num[k]:
+                        same = False
+                    elif mol.atom_name[k] != mol_ref.atom_name[k]:
+                        same = False
+                    elif mol.res_name[k] != mol_ref.res_name[k]:
+                        same = False
+                    elif mol.res_num[k] != mol_ref.res_num[k]:
+                        same = False
+                    elif mol.seg_id[k] != mol_ref.seg_id[k]:
+                        same = False
+                    elif mol.element[k] != mol_ref.element[k]:
+                        same = False
+
+                    # Failure.
+                    if not same:
+                        print("%-6s%5s %4s%1s%3s %1s%4s%1s   
%8s%8s%8s%6.2f%6.2f      %4s%2s%2s" % ('ATOM', mol.atom_num[k], 
self._translate(mol.atom_name[k]), '', self._translate(mol.res_name[k]), 
self._translate(mol.chain_id[k]), self._translate(mol.res_num[k]), '', '#', 
'#', '#', 1.0, 0, self._translate(mol.seg_id[k]), 
self._translate(mol.element[k]), ''))
+                        print("%-6s%5s %4s%1s%3s %1s%4s%1s   
%8s%8s%8s%6.2f%6.2f      %4s%2s%2s" % ('ATOM', mol_ref.atom_num[k], 
self._translate(mol_ref.atom_name[k]), '', 
self._translate(mol_ref.res_name[k]), self._translate(mol_ref.chain_id[k]), 
self._translate(mol_ref.res_num[k]), '', '#', '#', '#', 1.0, 0, 
self._translate(mol_ref.seg_id[k]), self._translate(mol_ref.element[k]), ''))
                         raise RelaxError("The atoms of model %i do not match 
the first model." % self.structural_data[i].num)
 
         # Final printout.


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
relax-commits@gna.org

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits

Reply via email to