Private
Public Access
1
0

Merge branch 'release/v10.24'

This commit is contained in:
Sander Roosendaal
2019-09-22 10:10:06 +02:00
11 changed files with 64 additions and 16 deletions
+6
View File
@@ -111,6 +111,9 @@ def alert_get_stats(alert,nperiod=0):
'nr_strokes_qualifying':0, 'nr_strokes_qualifying':0,
'percentage':0, 'percentage':0,
'nperiod':nperiod, 'nperiod':nperiod,
'median': 0,
'median_q': 0,
'standard_dev': 0,
} }
# check if filters are in columns list # check if filters are in columns list
@@ -143,6 +146,9 @@ def alert_get_stats(alert,nperiod=0):
'nr_strokes_qualifying':0, 'nr_strokes_qualifying':0,
'percentage':0, 'percentage':0,
'nperiod':nperiod, 'nperiod':nperiod,
'median': 0,
'median_q': 0,
'standard_dev': 0,
} }
+5 -1
View File
@@ -1104,7 +1104,11 @@ def dataprep(rowdatadf,id=0,bands=True,barchart=True,otwpower=True,
if barchart: if barchart:
# time increments for bar chart # time increments for bar chart
time_increments = rowdatadf.loc[:,' ElapsedTime (sec)'].diff() time_increments = rowdatadf.loc[:,' ElapsedTime (sec)'].diff()
time_increments[0] = time_increments[1] try:
time_increments.iloc[0] = time_increments.iloc[1]
except (KeyError, IndexError):
time_increments.iloc[1] = 1.
time_increments = 0.5*time_increments+0.5*np.abs(time_increments) time_increments = 0.5*time_increments+0.5*np.abs(time_increments)
x_right = (t2+time_increments.apply(lambda x:timedeltaconv(x))) x_right = (t2+time_increments.apply(lambda x:timedeltaconv(x)))
+6 -6
View File
@@ -77,7 +77,7 @@ stmapping = collections.OrderedDict({
'water':'Rowing', 'water':'Rowing',
'rower':'Rowing', 'rower':'Rowing',
'skierg':'Skiing:Nordic', 'skierg':'Skiing:Nordic',
'bike':'Cycling', 'Bike':'Cycling',
'bikeerg':'Cycling', 'bikeerg':'Cycling',
'dynamic':'Rowing', 'dynamic':'Rowing',
'slides':'Rowing', 'slides':'Rowing',
@@ -110,7 +110,7 @@ rkmapping = collections.OrderedDict({
'water':'Rowing', 'water':'Rowing',
'rower':'Rowing', 'rower':'Rowing',
'skierg':'Cross-Country Skiing', 'skierg':'Cross-Country Skiing',
'bike':'Cycling', 'Bike':'Cycling',
'bikeerg':'Cycling', 'bikeerg':'Cycling',
'dynamic':'Rowing', 'dynamic':'Rowing',
'slides':'Rowing', 'slides':'Rowing',
@@ -141,7 +141,7 @@ polarmapping = collections.OrderedDict({
'water':'Rowing', 'water':'Rowing',
'rower':'Rowing', 'rower':'Rowing',
'skierg':'Skiing', 'skierg':'Skiing',
'bike':'Cycling', 'Bike':'Cycling',
'bikeerg':'Cycling', 'bikeerg':'Cycling',
'dynamic':'Rowing', 'dynamic':'Rowing',
'slides':'Rowing', 'slides':'Rowing',
@@ -172,8 +172,8 @@ tpmapping = collections.OrderedDict({
'water':'rowing', 'water':'rowing',
'rower':'rowing', 'rower':'rowing',
'skierg':'xc-ski', 'skierg':'xc-ski',
'bike':'bike', 'Bike':'bike',
'bikeerg':'bike', 'Bikeerg':'bike',
'dynamic':'rowing', 'dynamic':'rowing',
'slides':'rowing', 'slides':'rowing',
'paddle':'other', 'paddle':'other',
@@ -203,7 +203,7 @@ c2mapping = collections.OrderedDict({
'water':'water', 'water':'water',
'rower':'rower', 'rower':'rower',
'skierg':'skierg', 'skierg':'skierg',
'bike':'bike', 'Bike':'bike',
'bikeerg':'bike', 'bikeerg':'bike',
'dynamic':'dynamic', 'dynamic':'dynamic',
'slides':'slides', 'slides':'slides',
+19
View File
@@ -791,14 +791,33 @@ def handle_send_email_alert(
othertexts = None othertexts = None
report = {} report = {}
try:
report['Percentage'] = int(stats['percentage']) report['Percentage'] = int(stats['percentage'])
except KeyError:
pass
try:
report['Number of workouts'] = int(stats['workouts']) report['Number of workouts'] = int(stats['workouts'])
except KeyError:
pass
try:
report['Data set'] = "{a} strokes out of {b}".format( report['Data set'] = "{a} strokes out of {b}".format(
a = stats['nr_strokes_qualifying'], a = stats['nr_strokes_qualifying'],
b = stats['nr_strokes'] b = stats['nr_strokes']
) )
except KeyError:
pass
try:
report['Median'] = sigdig(stats['median']) report['Median'] = sigdig(stats['median'])
except KeyError:
pass
try:
report['Median of qualifying strokes'] = sigdig(stats['median_q']) report['Median of qualifying strokes'] = sigdig(stats['median_q'])
except KeyError:
pass
subject = "Rowsandall.com: {alertname} ({startdate} to {enddate})".format( subject = "Rowsandall.com: {alertname} ({startdate} to {enddate})".format(
startdate = stats['startdate'], startdate = stats['startdate'],
-1
View File
@@ -22,7 +22,6 @@
<h2>{{ alert.name }}</h2> <h2>{{ alert.name }}</h2>
<p>{{ alert }}</p> <p>{{ alert }}</p>
<p>{{ alert.description }}</p> <p>{{ alert.description }}</p>
<p>This is a page under construction. Currently with minimal information</p>
</li> </li>
<li class="rounder"> <li class="rounder">
<h2>Score</h2> <h2>Score</h2>
+12
View File
@@ -131,6 +131,18 @@
Analyse power vs piece duration to make predictions, for erg pieces. Analyse power vs piece duration to make predictions, for erg pieces.
</p> </p>
</li> </li>
<li class="rounder">
<h2>Alerts</h2>
<a href="/rowers/alerts/">
<div class="vignet">
<img src="/static/img/alert2.png" alt="Alerts">
</div>
</a>
<p>
Need to monitor a metric? Set up automatic alerting and see the reports for your workouts.
</p>
</li>
</ul> </ul>
+6 -1
View File
@@ -64,7 +64,12 @@
</li> </li>
<li id="stats-histo"> <li id="stats-histo">
<a href="/rowers/user-analysis-select/histo/"> <a href="/rowers/user-analysis-select/histo/">
<i class="fas fa-chart-bar"></i>&nbsp;Histogram <i class="fas fa-chart-bar fa-fw"></i>&nbsp;Histogram
</a>
</li>
<li>
<a href="/rowers/alerts/">
<i class="fas fa-bell fa-fw"></i>&nbsp;Alerts
</a> </a>
</li> </li>
</ul> </ul>
Binary file not shown.
+3
View File
@@ -100,7 +100,10 @@ def workout_strava_upload_view(request,id=0):
if w.workouttype in mytypes.rowtypes: if w.workouttype in mytypes.rowtypes:
activity_type = r.stravaexportas activity_type = r.stravaexportas
else: else:
try:
activity_type = mytypes.stravamapping[w.workouttype] activity_type = mytypes.stravamapping[w.workouttype]
except KeyError:
activity_type = 'Ride'
res,mes = stravastuff.handle_stravaexport( res,mes = stravastuff.handle_stravaexport(
f,w.name, f,w.name,
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB