From 39c969e18e160208e3b56dce3e1cd14a59165ecf Mon Sep 17 00:00:00 2001 From: Jonathan Barnoud Date: Wed, 16 Dec 2015 06:49:14 +0100 Subject: [PATCH] Remove some bangs from formated string Cody (quantifiedcode) uses exclamation marks in its format srtings. Some appear to cause error. --- package/MDAnalysis/analysis/align.py | 2 +- package/MDAnalysis/coordinates/XYZ.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/MDAnalysis/analysis/align.py b/package/MDAnalysis/analysis/align.py index 66eecb277c0..c5f7d075be0 100644 --- a/package/MDAnalysis/analysis/align.py +++ b/package/MDAnalysis/analysis/align.py @@ -922,7 +922,7 @@ def get_atoms_byres(g, match_mask=np.logical_not(mismatch_mask)): logger.error("Atoms: reference | trajectory") for ar, at in itertools.izip(ag1[mismatch_atomindex], ag2[mismatch_atomindex]): - logger.error("{0:4!s} {1:3d} {2:3!s} {3:3!s} {4:6.3f} | {5:4!s} {6:3d} {7:3!s} {8:3!s} {9:6.3f}".format(ar.segid, ar.resid, ar.resname, ar.name, ar.mass, + logger.error("{0:4s} {1:3d} {2:3s} {3:3s} {4:6.3f} | {5:4s} {6:3d} {7:3s} {8:3s} {9:6.3f}".format(ar.segid, ar.resid, ar.resname, ar.name, ar.mass, at.segid, at.resid, at.resname, at.name, at.mass)) errmsg = ("Inconsistent selections, masses differ by more than {0}; " + \ "mis-matching atoms are shown above.").format(tol_mass) diff --git a/package/MDAnalysis/coordinates/XYZ.py b/package/MDAnalysis/coordinates/XYZ.py index 6b9bcfcbf88..cdb4daeeb2f 100644 --- a/package/MDAnalysis/coordinates/XYZ.py +++ b/package/MDAnalysis/coordinates/XYZ.py @@ -246,7 +246,7 @@ def write_next_timestep(self, ts=None): self._xyz.write("{0:d}\n".format(ts.n_atoms)) self._xyz.write("frame {0}\n".format(ts.frame)) for atom, (x, y, z) in itertools.izip(self.atomnames, coordinates): - self._xyz.write("{0:8!s} {1:10.5f} {2:10.5f} {3:10.5f}\n".format(atom, x, y, z)) + self._xyz.write("{0:8s} {1:10.5f} {2:10.5f} {3:10.5f}\n".format(atom, x, y, z)) class XYZReader(base.Reader):