fixing training zones with empty df bug
This commit is contained in:
@@ -6805,6 +6805,11 @@ def get_zones_report(rower,startdate,enddate,trainingzones='hr',date_agg='week',
|
||||
|
||||
def interactive_zoneschart(rower,data,startdate,enddate,trainingzones='hr',date_agg='week',
|
||||
yaxis='time'):
|
||||
if startdate >= enddate:
|
||||
st = startdate
|
||||
startdate = enddate
|
||||
enddate = st
|
||||
|
||||
duration = enddate-startdate
|
||||
|
||||
totaldays = duration.total_seconds()/(24*3600)
|
||||
@@ -6866,6 +6871,8 @@ def interactive_zoneschart(rower,data,startdate,enddate,trainingzones='hr',date_
|
||||
df.sort_values('date_sorting',inplace=True)
|
||||
df.drop('date_sorting',inplace=True,axis='columns')
|
||||
df['totaltime'] = 0
|
||||
if df.empty:
|
||||
return '','No Data Found'
|
||||
|
||||
if yaxis == 'percentage':
|
||||
dates = list(set(df['date'].values))
|
||||
|
||||
Reference in New Issue
Block a user