trivial changes white space
This commit is contained in:
@@ -49,7 +49,7 @@ from rowingdata import (
|
|||||||
SpeedCoach2Parser, FITParser, fitsummarydata,
|
SpeedCoach2Parser, FITParser, fitsummarydata,
|
||||||
RitmoTimeParser,KinoMapParser,
|
RitmoTimeParser,KinoMapParser,
|
||||||
make_cumvalues,cumcpdata,ExcelTemplate,
|
make_cumvalues,cumcpdata,ExcelTemplate,
|
||||||
summarydata, get_file_type,
|
summarydata, get_file_type,
|
||||||
)
|
)
|
||||||
|
|
||||||
from rowingdata.csvparsers import HumonParser
|
from rowingdata.csvparsers import HumonParser
|
||||||
@@ -128,12 +128,12 @@ def polarization_index(df,rower):
|
|||||||
df.dropna(axis=0,inplace=True)
|
df.dropna(axis=0,inplace=True)
|
||||||
df['dt'] = df['dt'].clip(upper=4,lower=0)
|
df['dt'] = df['dt'].clip(upper=4,lower=0)
|
||||||
|
|
||||||
|
|
||||||
masklow = (df['power']>0) & (df['power']<int(rower.pw_at))
|
masklow = (df['power']>0) & (df['power']<int(rower.pw_at))
|
||||||
maskmid = (df['power']>=rower.pw_at) & (df['power']<int(rower.pw_an))
|
maskmid = (df['power']>=rower.pw_at) & (df['power']<int(rower.pw_an))
|
||||||
maskhigh = (df['power']>rower.pw_an)
|
maskhigh = (df['power']>rower.pw_an)
|
||||||
|
|
||||||
|
|
||||||
time_low_pw = df.loc[masklow,'dt'].sum()
|
time_low_pw = df.loc[masklow,'dt'].sum()
|
||||||
time_mid_pw = df.loc[maskmid,'dt'].sum()
|
time_mid_pw = df.loc[maskmid,'dt'].sum()
|
||||||
time_high_pw = df.loc[maskhigh,'dt'].sum()
|
time_high_pw = df.loc[maskhigh,'dt'].sum()
|
||||||
@@ -143,7 +143,7 @@ def polarization_index(df,rower):
|
|||||||
frac_high = time_high_pw/(time_low_pw+time_mid_pw+time_high_pw)
|
frac_high = time_high_pw/(time_low_pw+time_mid_pw+time_high_pw)
|
||||||
|
|
||||||
index = math.log10(frac_high*100.*frac_low/frac_mid)
|
index = math.log10(frac_high*100.*frac_low/frac_mid)
|
||||||
|
|
||||||
return index
|
return index
|
||||||
|
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ def get_latlon(id):
|
|||||||
rowdata = rdata(w.csvfilename)
|
rowdata = rdata(w.csvfilename)
|
||||||
|
|
||||||
if rowdata.df.empty:
|
if rowdata.df.empty:
|
||||||
return [pd.Series([]), pd.Series([])]
|
return [pd.Series([]), pd.Series([])]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
@@ -216,7 +216,7 @@ def workout_summary_to_df(
|
|||||||
trimps.append(workout_trimp(w)[0])
|
trimps.append(workout_trimp(w)[0])
|
||||||
rscore = workout_rscore(w)
|
rscore = workout_rscore(w)
|
||||||
rscores.append(int(rscore[0]))
|
rscores.append(int(rscore[0]))
|
||||||
|
|
||||||
df = pd.DataFrame({
|
df = pd.DataFrame({
|
||||||
'name':names,
|
'name':names,
|
||||||
'date':startdatetimes,
|
'date':startdatetimes,
|
||||||
@@ -285,7 +285,7 @@ def join_workouts(r,ids,title='Joined Workout',
|
|||||||
else:
|
else:
|
||||||
makeprivate = False
|
makeprivate = False
|
||||||
|
|
||||||
startdatetime = parent.startdatetime
|
startdatetime = parent.startdatetime
|
||||||
else:
|
else:
|
||||||
oarlength = 2.89
|
oarlength = 2.89
|
||||||
inboard = 0.88
|
inboard = 0.88
|
||||||
@@ -311,7 +311,7 @@ def join_workouts(r,ids,title='Joined Workout',
|
|||||||
workouttype = parent.workouttype
|
workouttype = parent.workouttype
|
||||||
notes = parent.notes
|
notes = parent.notes
|
||||||
summary = parent.summary
|
summary = parent.summary
|
||||||
|
|
||||||
files = [w.csvfilename for w in ws]
|
files = [w.csvfilename for w in ws]
|
||||||
|
|
||||||
row = rdata(files[0])
|
row = rdata(files[0])
|
||||||
@@ -353,7 +353,7 @@ def clean_df_stats(datadf, workstrokesonly=True, ignorehr=True,
|
|||||||
ignoreadvanced=False):
|
ignoreadvanced=False):
|
||||||
# clean data remove zeros and negative values
|
# clean data remove zeros and negative values
|
||||||
|
|
||||||
|
|
||||||
# bring metrics which have negative values to positive domain
|
# bring metrics which have negative values to positive domain
|
||||||
if len(datadf)==0:
|
if len(datadf)==0:
|
||||||
return datadf
|
return datadf
|
||||||
@@ -377,7 +377,7 @@ def clean_df_stats(datadf, workstrokesonly=True, ignorehr=True,
|
|||||||
datadf['spm'] = datadf['spm'] + 1.0
|
datadf['spm'] = datadf['spm'] + 1.0
|
||||||
except (KeyError,TypeError) as e:
|
except (KeyError,TypeError) as e:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
datadf = datadf.clip(lower=0)
|
datadf = datadf.clip(lower=0)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
@@ -421,13 +421,13 @@ def clean_df_stats(datadf, workstrokesonly=True, ignorehr=True,
|
|||||||
datadf.mask(mask,inplace=True)
|
datadf.mask(mask,inplace=True)
|
||||||
except (KeyError,TypeError):
|
except (KeyError,TypeError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mask = datadf['efficiency'] > 200.
|
mask = datadf['efficiency'] > 200.
|
||||||
datadf.mask(mask,inplace=True)
|
datadf.mask(mask,inplace=True)
|
||||||
except (KeyError,TypeError):
|
except (KeyError,TypeError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mask = datadf['spm'] < 10
|
mask = datadf['spm'] < 10
|
||||||
datadf.mask(mask,inplace=True)
|
datadf.mask(mask,inplace=True)
|
||||||
@@ -648,7 +648,7 @@ def fitnessmetric_to_sql(m,table='powertimefitnessmetric',debug=False):
|
|||||||
placeholders = ", ".join(["?"] * len(m))
|
placeholders = ", ".join(["?"] * len(m))
|
||||||
|
|
||||||
query = "INSERT into %s ( %s ) Values (%s)" % (table, columns, placeholders)
|
query = "INSERT into %s ( %s ) Values (%s)" % (table, columns, placeholders)
|
||||||
|
|
||||||
values = tuple(m[key] for key in m.keys())
|
values = tuple(m[key] for key in m.keys())
|
||||||
with engine.connect() as conn, conn.begin():
|
with engine.connect() as conn, conn.begin():
|
||||||
result = conn.execute(query,values)
|
result = conn.execute(query,values)
|
||||||
@@ -684,8 +684,8 @@ def deletecpdata_sql(rower_id,table='cpdata'):
|
|||||||
conn.close()
|
conn.close()
|
||||||
engine.dispose()
|
engine.dispose()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def updatecpdata_sql(rower_id,delta,cp,table='cpdata',distance=[]):
|
def updatecpdata_sql(rower_id,delta,cp,table='cpdata',distance=[]):
|
||||||
deletecpdata_sql(rower_id)
|
deletecpdata_sql(rower_id)
|
||||||
df = pd.DataFrame(
|
df = pd.DataFrame(
|
||||||
@@ -836,7 +836,7 @@ def create_row_df(r,distance,duration,startdatetime,workouttype='rower',
|
|||||||
spm = 20.
|
spm = 20.
|
||||||
else:
|
else:
|
||||||
spm = avgspm
|
spm = avgspm
|
||||||
|
|
||||||
step = totalseconds/float(nr_strokes)
|
step = totalseconds/float(nr_strokes)
|
||||||
|
|
||||||
elapsed = np.arange(nr_strokes)*totalseconds/(float(nr_strokes-1))
|
elapsed = np.arange(nr_strokes)*totalseconds/(float(nr_strokes-1))
|
||||||
@@ -867,7 +867,7 @@ def create_row_df(r,distance,duration,startdatetime,workouttype='rower',
|
|||||||
hr = avghr
|
hr = avghr
|
||||||
else:
|
else:
|
||||||
hr = 0
|
hr = 0
|
||||||
|
|
||||||
df = pd.DataFrame({
|
df = pd.DataFrame({
|
||||||
'TimeStamp (sec)': unixtime,
|
'TimeStamp (sec)': unixtime,
|
||||||
' Horizontal (meters)': d,
|
' Horizontal (meters)': d,
|
||||||
@@ -902,7 +902,7 @@ def create_row_df(r,distance,duration,startdatetime,workouttype='rower',
|
|||||||
return (id, message)
|
return (id, message)
|
||||||
|
|
||||||
from rowers.utils import totaltime_sec_to_string
|
from rowers.utils import totaltime_sec_to_string
|
||||||
|
|
||||||
# Processes painsled CSV file to database
|
# Processes painsled CSV file to database
|
||||||
def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
||||||
boattype='1x',
|
boattype='1x',
|
||||||
@@ -934,7 +934,7 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
|||||||
|
|
||||||
if row.df.empty:
|
if row.df.empty:
|
||||||
return (0, 'Error: CSV data file was empty')
|
return (0, 'Error: CSV data file was empty')
|
||||||
|
|
||||||
dtavg = row.df['TimeStamp (sec)'].diff().mean()
|
dtavg = row.df['TimeStamp (sec)'].diff().mean()
|
||||||
|
|
||||||
if dtavg < 1:
|
if dtavg < 1:
|
||||||
@@ -1025,7 +1025,7 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
|||||||
if dosummary:
|
if dosummary:
|
||||||
summary = row.allstats()
|
summary = row.allstats()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
timezone_str = 'UTC'
|
timezone_str = 'UTC'
|
||||||
try:
|
try:
|
||||||
@@ -1094,7 +1094,7 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
|||||||
)
|
)
|
||||||
|
|
||||||
ws2 = []
|
ws2 = []
|
||||||
|
|
||||||
for ww in ws:
|
for ww in ws:
|
||||||
t = ww.duration
|
t = ww.duration
|
||||||
delta = datetime.timedelta(hours=t.hour, minutes=t.minute, seconds=t.second)
|
delta = datetime.timedelta(hours=t.hour, minutes=t.minute, seconds=t.second)
|
||||||
@@ -1146,7 +1146,7 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
|||||||
|
|
||||||
rscore,normp = workout_rscore(w)
|
rscore,normp = workout_rscore(w)
|
||||||
trimp,hrtss = workout_trimp(w)
|
trimp,hrtss = workout_trimp(w)
|
||||||
|
|
||||||
isbreakthrough = False
|
isbreakthrough = False
|
||||||
ishard = False
|
ishard = False
|
||||||
if workouttype == 'water':
|
if workouttype == 'water':
|
||||||
@@ -1184,7 +1184,7 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
|||||||
r.user.first_name,
|
r.user.first_name,
|
||||||
r.user.last_name,
|
r.user.last_name,
|
||||||
btvalues=btvalues.to_json())
|
btvalues=btvalues.to_json())
|
||||||
|
|
||||||
# submit email task to send email about breakthrough workout
|
# submit email task to send email about breakthrough workout
|
||||||
if ishard:
|
if ishard:
|
||||||
if r.getemailnotifications and not r.emailbounced:
|
if r.getemailnotifications and not r.emailbounced:
|
||||||
@@ -1194,7 +1194,7 @@ def save_workout_database(f2, r, dosmooth=True, workouttype='rower',
|
|||||||
r.user.first_name,
|
r.user.first_name,
|
||||||
r.user.last_name,
|
r.user.last_name,
|
||||||
btvalues=btvalues.to_json())
|
btvalues=btvalues.to_json())
|
||||||
|
|
||||||
|
|
||||||
return (w.id, message)
|
return (w.id, message)
|
||||||
|
|
||||||
@@ -1266,7 +1266,7 @@ def handle_nonpainsled(f2, fileformat, summary=''):
|
|||||||
|
|
||||||
if not hasrecognized:
|
if not hasrecognized:
|
||||||
return (0,'',0,0,'')
|
return (0,'',0,0,'')
|
||||||
|
|
||||||
f_to_be_deleted = f2
|
f_to_be_deleted = f2
|
||||||
# should delete file
|
# should delete file
|
||||||
f2 = f2[:-4] + 'o.csv'
|
f2 = f2[:-4] + 'o.csv'
|
||||||
@@ -1322,7 +1322,7 @@ def new_workout_from_file(r, f2,
|
|||||||
f3 = f3[6:]
|
f3 = f3[6:]
|
||||||
a = MessageAttachment(message=msg,document=f3)
|
a = MessageAttachment(message=msg,document=f3)
|
||||||
a.save()
|
a.save()
|
||||||
|
|
||||||
return -1, message, f2
|
return -1, message, f2
|
||||||
|
|
||||||
# Some people try to upload Concept2 logbook summaries
|
# Some people try to upload Concept2 logbook summaries
|
||||||
@@ -1340,7 +1340,7 @@ def new_workout_from_file(r, f2,
|
|||||||
os.remove(f2)
|
os.remove(f2)
|
||||||
message = "KML files are not supported"
|
message = "KML files are not supported"
|
||||||
return (0, message, f2)
|
return (0, message, f2)
|
||||||
|
|
||||||
# Some people upload corrupted zip files
|
# Some people upload corrupted zip files
|
||||||
if fileformat == 'notgzip':
|
if fileformat == 'notgzip':
|
||||||
os.remove(f2)
|
os.remove(f2)
|
||||||
@@ -1371,7 +1371,7 @@ def new_workout_from_file(r, f2,
|
|||||||
handle_sendemail_unrecognized,
|
handle_sendemail_unrecognized,
|
||||||
f4,
|
f4,
|
||||||
r.user.email)
|
r.user.email)
|
||||||
|
|
||||||
return (0, message, f2)
|
return (0, message, f2)
|
||||||
if fileformat == 'att':
|
if fileformat == 'att':
|
||||||
# email attachment which can safely be ignored
|
# email attachment which can safely be ignored
|
||||||
@@ -1393,7 +1393,7 @@ def new_workout_from_file(r, f2,
|
|||||||
|
|
||||||
if workoutsource is None:
|
if workoutsource is None:
|
||||||
workoutsource = fileformat
|
workoutsource = fileformat
|
||||||
|
|
||||||
id, message = save_workout_database(
|
id, message = save_workout_database(
|
||||||
f2, r,
|
f2, r,
|
||||||
notes=notes,
|
notes=notes,
|
||||||
@@ -1657,7 +1657,7 @@ def getrowdata_db(id=0, doclean=False, convertnewtons=True,
|
|||||||
else:
|
else:
|
||||||
row = Workout.objects.get(id=id)
|
row = Workout.objects.get(id=id)
|
||||||
|
|
||||||
|
|
||||||
if not data.empty and data['efficiency'].mean() == 0 and data['power'].mean() != 0 and checkefficiency == True:
|
if not data.empty and data['efficiency'].mean() == 0 and data['power'].mean() != 0 and checkefficiency == True:
|
||||||
data = add_efficiency(id=id)
|
data = add_efficiency(id=id)
|
||||||
|
|
||||||
@@ -1692,10 +1692,10 @@ def getsmallrowdata_db(columns, ids=[], doclean=True,workstrokesonly=True,comput
|
|||||||
|
|
||||||
df = pd.concat(data,axis=0)
|
df = pd.concat(data,axis=0)
|
||||||
# df = dd.concat(data,axis=0)
|
# df = dd.concat(data,axis=0)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
df = pd.read_parquet(csvfilenames[0],columns=columns)
|
df = pd.read_parquet(csvfilenames[0],columns=columns)
|
||||||
except OSError:
|
except OSError:
|
||||||
rowdata,row = getrowdata(id=ids[0])
|
rowdata,row = getrowdata(id=ids[0])
|
||||||
if rowdata and len(rowdata.df):
|
if rowdata and len(rowdata.df):
|
||||||
@@ -1707,7 +1707,7 @@ def getsmallrowdata_db(columns, ids=[], doclean=True,workstrokesonly=True,comput
|
|||||||
|
|
||||||
# df = df.loc[:,~df.columns.duplicated()]
|
# df = df.loc[:,~df.columns.duplicated()]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if compute:
|
if compute:
|
||||||
data = df.copy()
|
data = df.copy()
|
||||||
@@ -1717,7 +1717,7 @@ def getsmallrowdata_db(columns, ids=[], doclean=True,workstrokesonly=True,comput
|
|||||||
data.dropna(axis=1,how='all',inplace=True)
|
data.dropna(axis=1,how='all',inplace=True)
|
||||||
data.dropna(axis=0,how='any',inplace=True)
|
data.dropna(axis=0,how='any',inplace=True)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
return df
|
return df
|
||||||
|
|
||||||
def getsmallrowdata_db_dask(columns, ids=[], doclean=True,workstrokesonly=True,compute=True):
|
def getsmallrowdata_db_dask(columns, ids=[], doclean=True,workstrokesonly=True,compute=True):
|
||||||
@@ -1744,10 +1744,10 @@ def getsmallrowdata_db_dask(columns, ids=[], doclean=True,workstrokesonly=True,c
|
|||||||
|
|
||||||
df = dd.concat(data,axis=0)
|
df = dd.concat(data,axis=0)
|
||||||
# df = dd.concat(data,axis=0)
|
# df = dd.concat(data,axis=0)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
df = dd.read_parquet(csvfilenames[0],columns=columns)
|
df = dd.read_parquet(csvfilenames[0],columns=columns)
|
||||||
except OSError:
|
except OSError:
|
||||||
rowdata,row = getrowdata(id=ids[0])
|
rowdata,row = getrowdata(id=ids[0])
|
||||||
if rowdata and len(rowdata.df):
|
if rowdata and len(rowdata.df):
|
||||||
@@ -1759,7 +1759,7 @@ def getsmallrowdata_db_dask(columns, ids=[], doclean=True,workstrokesonly=True,c
|
|||||||
|
|
||||||
# df = df.loc[:,~df.columns.duplicated()]
|
# df = df.loc[:,~df.columns.duplicated()]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if compute:
|
if compute:
|
||||||
data = df.compute()
|
data = df.compute()
|
||||||
@@ -1769,7 +1769,7 @@ def getsmallrowdata_db_dask(columns, ids=[], doclean=True,workstrokesonly=True,c
|
|||||||
data.dropna(axis=1,how='all',inplace=True)
|
data.dropna(axis=1,how='all',inplace=True)
|
||||||
data.dropna(axis=0,how='any',inplace=True)
|
data.dropna(axis=0,how='any',inplace=True)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
return df
|
return df
|
||||||
|
|
||||||
def getsmallrowdata_db_old(columns, ids=[], doclean=True, workstrokesonly=True):
|
def getsmallrowdata_db_old(columns, ids=[], doclean=True, workstrokesonly=True):
|
||||||
@@ -1787,7 +1787,7 @@ def getsmallrowdata_db_old(columns, ids=[], doclean=True, workstrokesonly=True):
|
|||||||
f = row.df['TimeStamp (sec)'].diff().mean()
|
f = row.df['TimeStamp (sec)'].diff().mean()
|
||||||
except (AttributeError,KeyError) as e:
|
except (AttributeError,KeyError) as e:
|
||||||
f = 0
|
f = 0
|
||||||
|
|
||||||
if f != 0 and not np.isnan(f):
|
if f != 0 and not np.isnan(f):
|
||||||
windowsize = 2 * (int(10. / (f))) + 1
|
windowsize = 2 * (int(10. / (f))) + 1
|
||||||
else:
|
else:
|
||||||
@@ -1808,7 +1808,7 @@ def getsmallrowdata_db_old(columns, ids=[], doclean=True, workstrokesonly=True):
|
|||||||
except (KeyError, AttributeError):
|
except (KeyError, AttributeError):
|
||||||
data[c] = 0
|
data[c] = 0
|
||||||
|
|
||||||
|
|
||||||
# convert newtons
|
# convert newtons
|
||||||
|
|
||||||
if doclean:
|
if doclean:
|
||||||
@@ -1907,7 +1907,7 @@ def read_cols_df_sql(ids, columns, convertnewtons=True):
|
|||||||
data.append(df)
|
data.append(df)
|
||||||
|
|
||||||
df = pd.concat(data,axis=0)
|
df = pd.concat(data,axis=0)
|
||||||
|
|
||||||
|
|
||||||
df = df.fillna(value=0)
|
df = df.fillna(value=0)
|
||||||
|
|
||||||
@@ -2215,9 +2215,9 @@ def add_efficiency(id=0):
|
|||||||
rowdata = remove_invalid_columns(rowdata)
|
rowdata = remove_invalid_columns(rowdata)
|
||||||
rowdata = rowdata.replace([-np.inf, np.inf], np.nan)
|
rowdata = rowdata.replace([-np.inf, np.inf], np.nan)
|
||||||
rowdata = rowdata.fillna(method='ffill')
|
rowdata = rowdata.fillna(method='ffill')
|
||||||
|
|
||||||
delete_strokedata(id)
|
delete_strokedata(id)
|
||||||
|
|
||||||
if id != 0:
|
if id != 0:
|
||||||
rowdata['workoutid'] = id
|
rowdata['workoutid'] = id
|
||||||
filename = 'media/strokedata_{id}.parquet.gz'.format(id=id)
|
filename = 'media/strokedata_{id}.parquet.gz'.format(id=id)
|
||||||
@@ -2250,7 +2250,7 @@ def dataprep(rowdatadf, id=0, bands=True, barchart=True, otwpower=True,
|
|||||||
velo = rowdatadf.loc[:,' AverageBoatSpeed (m/s)']
|
velo = rowdatadf.loc[:,' AverageBoatSpeed (m/s)']
|
||||||
except KeyError:
|
except KeyError:
|
||||||
velo = 500./p
|
velo = 500./p
|
||||||
|
|
||||||
hr = rowdatadf.loc[:, ' HRCur (bpm)']
|
hr = rowdatadf.loc[:, ' HRCur (bpm)']
|
||||||
spm = rowdatadf.loc[:, ' Cadence (stokes/min)']
|
spm = rowdatadf.loc[:, ' Cadence (stokes/min)']
|
||||||
cumdist = rowdatadf.loc[:, 'cum_dist']
|
cumdist = rowdatadf.loc[:, 'cum_dist']
|
||||||
@@ -2316,7 +2316,7 @@ def dataprep(rowdatadf, id=0, bands=True, barchart=True, otwpower=True,
|
|||||||
|
|
||||||
powerhr = 60.*power/hr
|
powerhr = 60.*power/hr
|
||||||
powerhr = powerhr.fillna(value=0)
|
powerhr = powerhr.fillna(value=0)
|
||||||
|
|
||||||
if driveenergy.mean() == 0 and driveenergy.std() == 0:
|
if driveenergy.mean() == 0 and driveenergy.std() == 0:
|
||||||
driveenergy = 0*driveenergy+100
|
driveenergy = 0*driveenergy+100
|
||||||
|
|
||||||
@@ -2521,7 +2521,7 @@ def workout_trimp(w):
|
|||||||
|
|
||||||
if w.trimp > 0:
|
if w.trimp > 0:
|
||||||
return w.trimp,w.hrtss
|
return w.trimp,w.hrtss
|
||||||
|
|
||||||
r = w.user
|
r = w.user
|
||||||
ftp = float(r.ftp)
|
ftp = float(r.ftp)
|
||||||
if w.workouttype in otwtypes:
|
if w.workouttype in otwtypes:
|
||||||
@@ -2557,13 +2557,13 @@ def workout_trimp(w):
|
|||||||
r.hrftp,
|
r.hrftp,
|
||||||
r.max,
|
r.max,
|
||||||
r.rest)
|
r.rest)
|
||||||
|
|
||||||
return 0,0
|
return 0,0
|
||||||
|
|
||||||
def workout_rscore(w):
|
def workout_rscore(w):
|
||||||
if w.rscore > 0:
|
if w.rscore > 0:
|
||||||
return w.rscore,w.normp
|
return w.rscore,w.normp
|
||||||
|
|
||||||
r = w.user
|
r = w.user
|
||||||
ftp = float(r.ftp)
|
ftp = float(r.ftp)
|
||||||
if w.workouttype in otwtypes:
|
if w.workouttype in otwtypes:
|
||||||
@@ -2574,7 +2574,7 @@ def workout_rscore(w):
|
|||||||
r.hrftp = int(hrftp)
|
r.hrftp = int(hrftp)
|
||||||
r.save()
|
r.save()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
job = myqueue(
|
job = myqueue(
|
||||||
queuehigh,
|
queuehigh,
|
||||||
@@ -2586,7 +2586,7 @@ def workout_rscore(w):
|
|||||||
r.hrftp,
|
r.hrftp,
|
||||||
r.max,
|
r.max,
|
||||||
r.rest)
|
r.rest)
|
||||||
|
|
||||||
return 0,0
|
return 0,0
|
||||||
|
|
||||||
def workout_normv(w,pp=4.0):
|
def workout_normv(w,pp=4.0):
|
||||||
@@ -2603,7 +2603,7 @@ def workout_normv(w,pp=4.0):
|
|||||||
r.hrftp = int(hrftp)
|
r.hrftp = int(hrftp)
|
||||||
r.save()
|
r.save()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
job = myqueue(
|
job = myqueue(
|
||||||
queuehigh,
|
queuehigh,
|
||||||
@@ -2615,7 +2615,5 @@ def workout_normv(w,pp=4.0):
|
|||||||
r.hrftp,
|
r.hrftp,
|
||||||
r.max,
|
r.max,
|
||||||
r.rest)
|
r.rest)
|
||||||
|
|
||||||
return 0,0
|
|
||||||
|
|
||||||
|
return 0,0
|
||||||
|
|||||||
Reference in New Issue
Block a user