Skip to content

Commit 69dd1a1

Browse files
committed
a little cleaning
1 parent fab5a64 commit 69dd1a1

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

util/runparams.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,7 @@ def print_all_params(self):
224224
"""
225225
Print out all runtime parameters and their values
226226
"""
227-
keys = list(self.params.keys())
228-
keys.sort()
229-
230-
for key in keys:
227+
for key in sorted(self.params.keys()):
231228
print(key, "=", self.params[key])
232229

233230
print(" ")
@@ -246,10 +243,7 @@ def write_params(self, f):
246243

247244
def __str__(self):
248245
ostr = ""
249-
keys = list(self.params.keys())
250-
keys.sort()
251-
252-
for key in keys:
246+
for key in sorted(self.params.keys()):
253247
ostr += "{} = {}\n".format(key, self.params[key])
254248

255249
return ostr
@@ -333,4 +327,4 @@ def print_sphinx_tables(self, outfile="params-sphinx.inc"):
333327
if __name__ == "__main__":
334328
rp = RuntimeParameters()
335329
rp.load_params("inputs.test")
336-
rp.print_sphinx_tables()
330+
rp.print_all_params()

0 commit comments

Comments
 (0)