diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 22dfac72..920b4677 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -1404,7 +1404,10 @@ def interactive_flex_chart2(id=0,promember=0, if rowdata.empty: return "","No valid data" else: - rowdata.sort_values(by='time',ascending=True,inplace=True) + try: + rowdata.sort_values(by='time',ascending=True,inplace=True) + except KeyError: + pass workoutstateswork = [1,4,5,8,9,6,7] workoutstatesrest = [3] diff --git a/rowers/views.py b/rowers/views.py index 1621f41e..79547d54 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -4368,18 +4368,20 @@ def workout_stats_view(request,id=0,message="",successmessage=""): intensityfactor = normp/float(r.ftp) tss = 100.*((duration*normp*intensityfactor)/(3600.*r.ftp)) + if not np.isnan(tss): + otherstats['tss'] = { + 'verbose_name':'rScore', + 'value':int(tss), + 'unit':'' + } + + if not np.isnan(normp): otherstats['np'] = { 'verbose_name':'rPower', 'value':int(10*normp)/10., 'unit':'Watt' } - - otherstats['tss'] = { - 'verbose_name':'rScore', - 'value':int(tss), - 'unit':'' - } - + # HR Drift tmax = datadf['time'].max() tmin = datadf['time'].min()