diff --git a/rowers/dataprep.py b/rowers/dataprep.py index 71e6d585..d7497a78 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -772,7 +772,27 @@ def smalldataprep(therows,xparam,yparam1,yparam2): pass return df - + +# data fusion +def datafusion(id1,id2,column,offset): + df1 = getrowdata_db(id=id1) + columns = ['time',column] + df2 = getsmallrowdata_db(columns,ids=[id2]) + + keep1 = set(df1.columns) + keep1.pop(column) + + for c in df1.columns: + if not c in keep1: + df1 = df1.drop(c,1,errors='ignore') + + df = pd.concat([df1,df2],ignore_index=True) + df = df.sort_value(['time']) + df.interpolate(method='linear',axis=0,limit_direction='both') + df.fillna(method='bfill',inplace=True) + + return df + # This is the main routine. # it reindexes, sorts, filters, and smooths the data, then # saves it to the stroke_data table in the database diff --git a/rowers/views.py b/rowers/views.py index 26ad82c9..dbf7f9d8 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -3601,7 +3601,7 @@ def workout_unsubscribe_view(request,id=0): user=request.user).order_by("created") for c in comments: - c.notify = False + c.notification = False c.save() form = WorkoutCommentForm()