Skip to content

Commit ddf8ab9

Browse files
author
Michael Kincaid
committed
Fix TypeError in logging
Avoid type errors at verbose=2 by accepting any printable type in progress messages
1 parent acd2ad1 commit ddf8ab9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SparseSC/utils/print_progress.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ def print_progress(iteration, total=100, prefix='', suffix='', decimals=1, bar_l
5252
def it_progressmsg(it, prefix="Loop", file=sys.stdout, count=None):
5353
for i, item in enumerate(it):
5454
if count is None:
55-
file.write(prefix + ": " + i + "\n")
55+
file.write(f"{prefix}: {i}\n")
5656
else:
57-
file.write(prefix + ": " + i + " of " + count + "\n")
57+
file.write(f"{prefix}: {i} of {count}\n")
5858
file.flush()
5959
yield item
6060
file.write(prefix + ": FINISHED\n")

0 commit comments

Comments
 (0)