Update string formatting to modern version.

Focuses only on complex formatting.
This commit is contained in:
Nathan Baker
2020-05-27 16:26:52 -07:00
parent 557ab19312
commit 6e7c188dbd
7 changed files with 90 additions and 77 deletions

View File

@@ -575,9 +575,11 @@ class ConformationContainer:
def __str__(self):
"""String that lists statistics of atoms and groups."""
str_ = (
'Conformation container %s with %d atoms and %d groups'
% (self.name, len(self), len(self.groups)))
fmt = (
"Conformation container {name} with {natoms:d} atoms and "
"{ngroups:d} groups")
str_ = fmt.format(
name=self.name, natoms=len(self), ngroups=len(self.groups))
return str_
def __len__(self):