Private
Public Access
1
0

fixing some more copywarnings

This commit is contained in:
Sander Roosendaal
2021-04-27 19:43:44 +02:00
parent b2a8e15dcb
commit f7d2890eba
2 changed files with 6 additions and 6 deletions

View File

@@ -133,14 +133,14 @@ def coursetime_paths(data,paths,finalmaxmin='min',polygons=[],logfile=None):
if len(paths) > 1: if len(paths) > 1:
try: try:
time,dist = time_in_path(data, paths[0],name=polygons[0][1],logfile=logfile) time,dist = time_in_path(data, paths[0],name=polygons[0][1],logfile=logfile)
data = data[data['time']>time] data2 = data[data['time']>time].copy()
data['time'] = data['time']-time data2['time'] = data2['time'].apply(lambda x:x-time)
data['cum_dist'] = data['cum_dist']-dist data2['cum_dist'] = data2['cum_dist'].apply(lambda x:x-dist)
( (
timenext, timenext,
distnext, distnext,
coursecompleted coursecompleted
) = coursetime_paths(data,paths[1:],polygons=polygons[1:],logfile=logfile) ) = coursetime_paths(data2,paths[1:],polygons=polygons[1:],logfile=logfile)
return time+timenext, dist+distnext,coursecompleted return time+timenext, dist+distnext,coursecompleted
except InvalidTrajectoryError: # pragma: no cover except InvalidTrajectoryError: # pragma: no cover
entrytime = data['time'].max() entrytime = data['time'].max()

View File

@@ -433,12 +433,12 @@ def trendflexdata(workouts, options,userid=0):
if groupby != 'date': if groupby != 'date':
try: try:
df['groupval'] = groups.mean()[groupby] df['groupval'] = groups.mean()[groupby]
df['groupval'].loc[mask] = np.nan df.loc[mask,'groupval'] = np.nan
groupcols = df['groupval'] groupcols = df['groupval']
except (ValueError, AttributeError): # pragma: no cover except (ValueError, AttributeError): # pragma: no cover
df['groupval'] = groups.mean()[groupby].fillna(value=0) df['groupval'] = groups.mean()[groupby].fillna(value=0)
df['groupval'].loc[mask] = np.nan df.loc[mask,'groupval'] = np.nan
groupcols = df['groupval'] groupcols = df['groupval']
except KeyError: # pragma: no cover except KeyError: # pragma: no cover
messages.error(request,'Data selection error') messages.error(request,'Data selection error')