diff --git a/rowers/datautils.py b/rowers/datautils.py index ecf961dc..b19a7597 100644 --- a/rowers/datautils.py +++ b/rowers/datautils.py @@ -304,14 +304,15 @@ def getmaxwattinterval(tt,ww,i): if len(w_roll): # now goes with # data points - should be fixed seconds indexmax = w_roll.idxmax(axis=1) + indexmaxpos = indexmax.get_loc(indexmax) try: - t_0 = tt.ix[indexmax] - t_1 = tt.ix[indexmax-i] - deltas = tt.ix[indexmax-i:indexmax].diff().dropna() + t_0 = tt.iloc[indexmaxpos] + t_1 = tt.iloc[indexmaxpos-i] + deltas = tt.iloc[indexmaxpos-i:indexmaxpos].diff().dropna() testres = 1.0e-3*deltas.max() < 30. if testres: deltat = 1.0e-3*(t_0-t_1) - wmax = w_roll.ix[indexmax] + wmax = w_roll.iloc[indexmaxpos] #if wmax > 800 or wmax*5.0e-4*deltat > 800.0: # wmax = 0 else: diff --git a/rowers/tests/statements.py b/rowers/tests/statements.py index 310b127e..51f1f25a 100644 --- a/rowers/tests/statements.py +++ b/rowers/tests/statements.py @@ -30,7 +30,7 @@ from rowers.tasks import handle_makeplot from rowers.utils import serialize_list,deserialize_list from rowers.utils import NoTokenError from rowers.plannedsessions import get_dates_timeperiod -from shutil import copyfile +from shutil import copyfile, copy from nose.tools import assert_true from mock import Mock, patch from minimocktest import MockTestCase @@ -107,7 +107,8 @@ def get_random_file(filename='rowers/tests/testdata/testdata.csv',name=''): else: newfilename = 'rowers/tests/testdata/temp/'+fromstring+uuid4().hex[:16]+'.'+extension - copyfile(filename,newfilename) + # copyfile(filename,newfilename) + copy(filename,newfilename) thedict = { 'row':row, diff --git a/rowers/tests/testdata/testdata.csv.gz b/rowers/tests/testdata/testdata.csv.gz index ac467768..1130e114 100644 Binary files a/rowers/tests/testdata/testdata.csv.gz and b/rowers/tests/testdata/testdata.csv.gz differ