Private
Public Access
1
0

adding fitscore

This commit is contained in:
Sander Roosendaal
2020-11-25 18:35:40 +01:00
parent 5f683d1e2e
commit cace69a63d
4 changed files with 86 additions and 9 deletions

View File

@@ -265,15 +265,15 @@ def update_records(url=c2url,verbose=True):
for nr,row in df.iterrows():
if 'm' in row['Record']:
df.ix[nr,'Distance'] = row['Record'][:-1]
df.ix[nr,'Duration'] = 60*row['Event']
df.loc[nr,'Distance'] = row['Record'][:-1]
df.loc[nr,'Duration'] = 60*row['Event']
else:
df.ix[nr,'Distance'] = row['Event']
df.loc[nr,'Distance'] = row['Event']
try:
tobj = datetime.datetime.strptime(row['Record'],'%M:%S.%f')
except ValueError:
tobj = datetime.datetime.strptime(row['Record'],'%H:%M:%S.%f')
df.ix[nr,'Duration'] = 3600.*tobj.hour+60.*tobj.minute+tobj.second+tobj.microsecond/1.e6
df.loc[nr,'Duration'] = 3600.*tobj.hour+60.*tobj.minute+tobj.second+tobj.microsecond/1.e6
for nr,row in df.iterrows():
try:
@@ -334,6 +334,15 @@ class CalcAgePerformance(models.Model):
class Meta:
db_table = 'calcagegrouprecords'
def __str_(self):
stri = 'Calculated World Class Performance for {s}, {a}, {d} secs, {p} Watts'.format(
s = self.sex,
a = self.age,
d = self.duration,
p = self.power
)
return stri
class PowerTimeFitnessMetric(models.Model):
modechoices = (
('rower','Rower'),