Private
Public Access
1
0

Merge branch 'release/v14.70'

This commit is contained in:
Sander Roosendaal
2020-11-30 18:36:01 +01:00
6 changed files with 23 additions and 12 deletions

View File

@@ -192,7 +192,7 @@ requests==2.23.0
requests-oauthlib==1.2.0
requests-toolbelt==0.9.1
rfc3986==1.4.0
rowingdata==3.0.1
rowingdata==3.0.4
rowingphysics==0.5.0
rq==0.13.0
rules==2.1

View File

@@ -1608,8 +1608,9 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
res = dataprep(row.df, id=w.id, bands=True,
barchart=True, otwpower=True, empower=True, inboard=inboard)
rscore,normp = workout_rscore(w)
trimp,hrtss = workout_trimp(w)
job = myqueue(queuehigh,handle_calctrimp,w.id,f2,r.ftp,r.sex,r.hrftp,r.max,r.rest)
isbreakthrough = False
ishard = False
@@ -1949,8 +1950,6 @@ def new_workout_from_file(r, f2,
impeller=impeller,
)
job = myqueue(queuehigh,handle_calctrimp,id,f2,r.ftp,r.sex,r.hrftp,r.max,r.rest)
return (id, message, f2)

View File

@@ -259,6 +259,8 @@ def garmin_workouts_from_details(data):
w.summary=summary
w.uploadedtogarmin = garminid
w.save()
trimp,hrtss = dataprep.workout_trimp(w)
rscore,normp = dataprep.workout_rscore(w)
except Rower.DoesNotExist:
pass

View File

@@ -23,7 +23,7 @@ from bokeh.palettes import Set1_4 as palette2
from bokeh.models.glyphs import MultiLine
import itertools
from bokeh.plotting import figure, ColumnDataSource, Figure,curdoc
from bokeh.models import CustomJS,Slider, TextInput,BoxAnnotation
from bokeh.models import CustomJS,Slider, TextInput,BoxAnnotation, Band
from rowers.utils import myqueue
import django_rq
@@ -1694,6 +1694,13 @@ def fitnessfit_chart(workouts,user,workoutmode='water',startdate=None,
weight = 0
for w in ws:
weight += getattr(w,metricchoice)
if getattr(w,metricchoice) == 0:
if metricchoice == 'rscore' and w.hrtss != 0:
weight+= w.hrtss
else:
trimp,hrtss = dataprep.workout_trimp(w)
rscore,normp = dataprep.workout_rscore(w)
fatigue = (1-lambda_a)*fatigue+weight*lambda_a
fitness = (1-lambda_c)*fitness+weight*lambda_c
@@ -1790,7 +1797,7 @@ def fitnessfit_chart(workouts,user,workoutmode='water',startdate=None,
legend_label = 'Test Score'
yaxlabel = 'Test Score'
else:
legend_label = '{fitnesstest} min power'
legend_label = '{fitnesstest} min power'.format(fitnesstest=fitnesstest)
yaxlabel = 'Test Power (Watt)'
plot.circle('date','testpower',source=source,fill_color='green',size=10,
@@ -1807,6 +1814,9 @@ def fitnessfit_chart(workouts,user,workoutmode='water',startdate=None,
plot.line('date','fitness',source=source,color='blue',
legend_label=fitlabel,y_range_name="yax2")
band = Band(base='date', upper='fitness', source=source, level='underlay',
fill_alpha=0.2, fill_color='blue',y_range_name="yax2")
plot.add_layout(band)
plot.line('date','fatigue',source=source,color='red',
legend_label=fatiguelabel,y_range_name="yax2")
plot.line('date','form',source=source,color='green',

View File

@@ -308,7 +308,10 @@ def getagegrouprecord(age,sex='male',weightcategory='hwt',
df = pd.DataFrame()
else:
duration = 60*int(duration)
df = indf[indf['duration'] == duration]
try:
df = indf[indf['duration'] == duration]
except KeyError:
df = pd.DataFrame()
if not df.empty:
ages = df['age']
@@ -3064,8 +3067,6 @@ def fetch_strava_workout(stravatoken,oauth_data,stravaid,csvfilename,userid,debu
'stravaid':stravaid,
}
print(uploadoptions)
session = requests.session()
newHeaders = {'Content-type': 'application/json', 'Accept': 'text/plain'}
session.headers.update(newHeaders)

View File

@@ -3411,8 +3411,7 @@ def workout_stats_view(request,id=0,message="",successmessage=""):
stats = {}
fieldlist,fielddict = dataprep.getstatsfields()
# fielddict.pop('workoutstate')
# fielddict.pop('workoutid')
try:
fielddict.pop('pace')
except KeyError: