Author: bugman Date: Thu Nov 27 15:23:05 2014 New Revision: 26783 URL: http://svn.gna.org/viewcvs/relax?rev=26783&view=rev Log: Merged revisions 26782 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r26782 | bugman | 2014-11-27 15:16:48 +0100 (Thu, 27 Nov 2014) | 8 lines Modified the printouts from the structure.write_pdb user function if models are present. Instead of printing out 'MODEL', 'ATOM, HETATM, TER' and 'ENDMDL' for each model, the header 'MODEL records' is printed followed by a single '.' character for each model. For structures with many models, this results in a huge speed up of the user function which is strongly limited by how fast the terminal can display text. ........ 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 Thu Nov 27 15:23:05 2014 @@ -1 +1 @@ -/trunk:1-26771 +/trunk:1-26782 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=26783&r1=26782&r2=26783&view=diff ============================================================================== --- branches/frame_order_cleanup/lib/structure/internal/object.py (original) +++ branches/frame_order_cleanup/lib/structure/internal/object.py Thu Nov 27 15:23:05 2014 @@ -29,6 +29,7 @@ from os import F_OK, access, curdir, sep from os.path import abspath from re import search +import sys from time import asctime from warnings import warn @@ -2802,6 +2803,10 @@ # Coordinate section # ###################### + # Initial printout if models are present. + if model_records: + print("\nMODEL records:") + # Loop over the models. for model in self.model_loop(model_num): # Initialise record counts. @@ -2814,8 +2819,8 @@ #################################### if model_records: - # Print out. - print("\nMODEL %s" % model.num) + # Printout. + sys.stdout.write('.') # Write the model record. pdb_write.model(file, serial=model.num) @@ -2828,8 +2833,9 @@ index = 0 atom_serial = 0 for mol in model.mol_loop(): - # Print out. - print("ATOM, HETATM, TER") + # Printout. + if not model_records: + print("ATOM, HETATM, TER") # Loop over the atomic data. atom_record = False @@ -2892,7 +2898,8 @@ ######################################## if model_records: - print("ENDMDL") + if not model_records: + print("ENDMDL") pdb_write.endmdl(file) @@ -2900,6 +2907,8 @@ ############################ # Print out. + if model_records: + sys.stdout.write('\n') print("CONECT") # Initialise record counts.