mirror of
https://github.com/nqrduck/LimeDriver.git
synced 2024-11-25 11:32:27 +00:00
Refactor dictionary iteration and output formatting
Standardized the iteration over dictionary keys in `limr.py` to directly call `.keys()` method for clarity. Additionally, streamlined the output formatting by removing redundant data in `print_params()` method, resulting in cleaner output without extraneous details. This enhances code readability and maintains a tidy console display.
This commit is contained in:
parent
99e20dbf9d
commit
83f3221162
1 changed files with 3 additions and 3 deletions
|
@ -56,10 +56,10 @@ class limr:
|
|||
|
||||
# print the arguments that have been set
|
||||
def print_params(self, allel=False):
|
||||
for key in sorted(self.parsinp):
|
||||
for key in sorted(self.parsinp.keys()):
|
||||
val = getattr(self, key)
|
||||
if (val != []) | (allel):
|
||||
print("{:<5}: {:>50} {:<25}".format(key, val, self.parsinp[key][1]))
|
||||
print("{:<5}: {:>50} {:<25}".format(key, val, self.parsinp[key]))
|
||||
|
||||
# add parameter variation:
|
||||
# key is the argument to vary
|
||||
|
@ -282,7 +282,7 @@ class limr:
|
|||
|
||||
str2call = self.Cprog
|
||||
|
||||
for key in self.parsinp:
|
||||
for key in self.parsinp.keys():
|
||||
vals = getattr(self, key)
|
||||
if vals == []:
|
||||
continue # ignore arguments that are not set
|
||||
|
|
Loading…
Reference in a new issue