Add pace to output
This commit is contained in:
parent
9f3ef9e0e1
commit
4bc6b618f9
1 changed files with 6 additions and 3 deletions
|
|
@ -172,7 +172,8 @@ def summarise(descr=""):
|
|||
continue
|
||||
time = make_pretty_td(duration)
|
||||
speed = exer['distance'] / (exer['time'] / 3600)
|
||||
s = f"{exer['describe']:7} {exer['distance']:6.2f} km in {time} ({speed:>5.2f} km/h)"
|
||||
pace = f"{int(60 / speed)}:{round((3600/speed) % 60):>02.0f}"
|
||||
s = f"{exer['describe']:7} {exer['distance']:6.2f} km in {time} ({speed:>5.2f} km/h) ({pace} m/km)"
|
||||
if descr:
|
||||
s += f" ({descr})"
|
||||
print(s)
|
||||
|
|
@ -369,7 +370,8 @@ def textout(start=datetime.date.today().replace(day=1), end=(datetime.date.today
|
|||
except ValueError:
|
||||
date = datetime.datetime.strptime(date_str, '%Y-%m-%d %H:%M:%S.%f')
|
||||
if each:
|
||||
s = f"{exer_type(dist, time, speed, date):7} on {date.strftime('%d %b, %H:%M')} {dist:6.2f} km in {make_pretty_td(time)} ({speed:>5.2f} km/h)"
|
||||
pace = f"{int(60 / speed)}:{round((3600/speed) % 60):>02.0f}"
|
||||
s = f"{exer_type(dist, time, speed, date):7} on {date.strftime('%d %b, %H:%M')} {dist:6.2f} km in {make_pretty_td(time)} ({speed:>5.2f} km/h) ({pace} m/km)"
|
||||
print(s)
|
||||
else:
|
||||
dists[exer_type(dist, time, speed, date)] += dist
|
||||
|
|
@ -380,7 +382,8 @@ def textout(start=datetime.date.today().replace(day=1), end=(datetime.date.today
|
|||
continue
|
||||
time = make_pretty_td(duration)
|
||||
speed = dists[exer['describe']] / (duration / 3600)
|
||||
s = f"{exer['describe']:7} {dists[exer['describe']]:6.2f} km in {time} ({speed:>5.2f} km/h)"
|
||||
pace = f"{int(60 / speed)}:{round((3600/speed) % 60):>02.0f}"
|
||||
s = f"{exer['describe']:7} {dists[exer['describe']]:6.2f} km in {time} ({speed:>5.2f} km/h) ({pace} m/km)"
|
||||
print(s)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue