Author: bugman Date: Thu Jan 29 19:35:06 2015 New Revision: 27376 URL: http://svn.gna.org/viewcvs/relax?rev=27376&view=rev Log: Merged revisions 27373-27375 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk ........ r27373 | bugman | 2015-01-29 19:27:18 +0100 (Thu, 29 Jan 2015) | 6 lines Fix for the new Internal_selection.count_atoms() internal structural object selection method. The method was previously returning the total number of molecules, not the total number of atoms in the selection. ........ r27374 | bugman | 2015-01-29 19:28:34 +0100 (Thu, 29 Jan 2015) | 6 lines Printout fix for the backend of the structure.translate and structure.rotate user functions. Model numbers of zero were not correctly identified. This also affects the structure.align and structure.superimpose user functions which uses this backend code. ........ r27375 | bugman | 2015-01-29 19:34:32 +0100 (Thu, 29 Jan 2015) | 3 lines Another fix for the Internal_selection.count_atoms() internal structural object selection method. ........ Modified: branches/frame_order_cleanup/ (props changed) branches/frame_order_cleanup/lib/structure/internal/selection.py branches/frame_order_cleanup/pipe_control/structure/main.py Propchange: branches/frame_order_cleanup/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Thu Jan 29 19:35:06 2015 @@ -1 +1 @@ -/trunk:1-27371 +/trunk:1-27375 Modified: branches/frame_order_cleanup/lib/structure/internal/selection.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/lib/structure/internal/selection.py?rev=27376&r1=27375&r2=27376&view=diff ============================================================================== --- branches/frame_order_cleanup/lib/structure/internal/selection.py (original) +++ branches/frame_order_cleanup/lib/structure/internal/selection.py Thu Jan 29 19:35:06 2015 @@ -69,7 +69,17 @@ def count_atoms(self): """Return the number of atoms in the selection.""" - return len(self._atom_indices) + # No data. + if self._atom_indices == []: + return 0 + + # Sum the atoms of all molecules. + sum = 0 + for i in range(len(self._atom_indices)): + sum += len(self._atom_indices[i]) + + # Return the sum. + return sum def loop(self): Modified: branches/frame_order_cleanup/pipe_control/structure/main.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/pipe_control/structure/main.py?rev=27376&r1=27375&r2=27376&view=diff ============================================================================== --- branches/frame_order_cleanup/pipe_control/structure/main.py (original) +++ branches/frame_order_cleanup/pipe_control/structure/main.py Thu Jan 29 19:35:06 2015 @@ -1249,7 +1249,7 @@ dp.structure.rotate(R=R, origin=origin, model=model, selection=selection) # Final printout. - if model: + if model != None: print("Rotated %i atoms of model %i." % (selection.count_atoms(), model)) else: print("Rotated %i atoms." % selection.count_atoms()) @@ -1392,7 +1392,7 @@ dp.structure.translate(T=T, model=model, selection=selection) # Final printout. - if model: + if model != None: print("Translated %i atoms of model %i." % (selection.count_atoms(), model)) else: print("Translated %i atoms." % selection.count_atoms())