Skip to content

Commit

Permalink
Round percentage complete in CLI and add initial 0% complete (#100) (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
Colelyman authored and mbowcut2 committed Oct 14, 2024
1 parent d1f4475 commit 288291e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CRISPResso2/CRISPRessoShared.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ def format(self, record):
self.last_percent_complete = record.percent_complete
elif hasattr(self, 'last_percent_complete'): # if we don't have a percent complete, use the last one
record.percent_complete = self.last_percent_complete
else:
record.percent_complete = 0.0
return super().format(record)


Expand All @@ -115,7 +117,7 @@ class LogStreamHandler(logging.StreamHandler):
def __init__(self, stream=None):
super().__init__(stream)
self.setFormatter(StatusFormatter(
'%(levelname)-5s @ %(asctime)s (%(percent_complete)s%% done):\n\t %(message)s \n',
'%(levelname)-5s @ %(asctime)s (%(percent_complete).1f%% done):\n\t %(message)s \n',
datefmt='%a, %d %b %Y %H:%M:%S',
))
self.setLevel(logging.INFO)
Expand Down

0 comments on commit 288291e

Please sign in to comment.