removing obsolete .ix calls to pandas
This commit is contained in:
@@ -31,7 +31,7 @@ class SimpleViewTest(TestCase):
|
||||
except (IOError, WindowsError,OSError):
|
||||
pass
|
||||
|
||||
def start_protrial(self):
|
||||
def test_start_protrial(self):
|
||||
login = self.c.login(username=self.u.username, password=self.password)
|
||||
self.assertTrue(login)
|
||||
|
||||
@@ -43,7 +43,7 @@ class SimpleViewTest(TestCase):
|
||||
expected_url='/rowers/list-workouts/',
|
||||
status_code=302,target_status_code=200)
|
||||
|
||||
def start_plantrial(self):
|
||||
def test_start_plantrial(self):
|
||||
login = self.c.login(username=self.u.username, password=self.password)
|
||||
self.assertTrue(login)
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class OTWCPChartTest(TestCase):
|
||||
row = rdata(a2)
|
||||
totaldist = row.df['cum_dist'].max()
|
||||
totaltime = row.df['TimeStamp (sec)'].max()-row.df['TimeStamp (sec)'].min()
|
||||
totaltime = totaltime+row.df.ix[0,' ElapsedTime (sec)']
|
||||
totaltime = totaltime+row.df.loc[:,' ElapsedTime (sec)'].iloc[0]
|
||||
|
||||
|
||||
hours = int(totaltime/3600.)
|
||||
@@ -124,16 +124,16 @@ class CPChartTest(TestCase):
|
||||
|
||||
recordsdf = pd.read_csv('rowers/tests/worldrecords.csv',encoding='utf-8')
|
||||
|
||||
for i in range(len(recordsdf)):
|
||||
for i in recordsdf.index:
|
||||
record = C2WorldClassAgePerformance(
|
||||
name = recordsdf.ix[i,'name'],
|
||||
age = recordsdf.ix[i,'age'],
|
||||
distance = recordsdf.ix[i,'distance'],
|
||||
duration = recordsdf.ix[i,'duration'],
|
||||
power = recordsdf.ix[i,'power'],
|
||||
season = recordsdf.ix[i,'season'],
|
||||
sex = recordsdf.ix[i,'sex'],
|
||||
weightcategory = recordsdf.ix[i,'weightcategory'],
|
||||
name = recordsdf.loc[i,'name'],
|
||||
age = recordsdf.loc[i,'age'],
|
||||
distance = recordsdf.loc[i,'distance'],
|
||||
duration = recordsdf.loc[i,'duration'],
|
||||
power = recordsdf.loc[i,'power'],
|
||||
season = recordsdf.loc[i,'season'],
|
||||
sex = recordsdf.loc[i,'sex'],
|
||||
weightcategory = recordsdf.loc[i,'weightcategory'],
|
||||
)
|
||||
|
||||
record.save()
|
||||
@@ -142,11 +142,11 @@ class CPChartTest(TestCase):
|
||||
|
||||
r = self.u.rower
|
||||
|
||||
for i in range(len(perfsdf)):
|
||||
for i in perfsdf.index:
|
||||
perf = CalcAgePerformance(
|
||||
age = age,
|
||||
duration = perfsdf.ix[i,'duration'],
|
||||
power = perfsdf.ix[i,'power'],
|
||||
duration = perfsdf.loc[i,'duration'],
|
||||
power = perfsdf.loc[i,'power'],
|
||||
sex = r.sex,
|
||||
weightcategory = r.weightcategory
|
||||
)
|
||||
|
||||
@@ -35,7 +35,7 @@ class C2Objects(DjangoTestCase):
|
||||
row = rdata(filename,rower=rr)
|
||||
totaldist = row.df['cum_dist'].max()
|
||||
totaltime = row.df['TimeStamp (sec)'].max()-row.df['TimeStamp (sec)'].min()
|
||||
totaltime = totaltime+row.df.ix[0,' ElapsedTime (sec)']
|
||||
totaltime = totaltime+row.df.loc[:,' ElapsedTime (sec)'].iloc[0]
|
||||
|
||||
|
||||
hours = int(totaltime/3600.)
|
||||
@@ -169,7 +169,7 @@ class C2ObjectsTokenExpired(DjangoTestCase):
|
||||
row = rdata(filename,rower=rr)
|
||||
totaldist = row.df['cum_dist'].max()
|
||||
totaltime = row.df['TimeStamp (sec)'].max()-row.df['TimeStamp (sec)'].min()
|
||||
totaltime = totaltime+row.df.ix[0,' ElapsedTime (sec)']
|
||||
totaltime = totaltime+row.df.loc[:,' ElapsedTime (sec)'].iloc[0]
|
||||
|
||||
|
||||
hours = int(totaltime/3600.)
|
||||
@@ -247,7 +247,7 @@ class StravaObjects(DjangoTestCase):
|
||||
row = rdata(filename,rower=rr)
|
||||
totaldist = row.df['cum_dist'].max()
|
||||
totaltime = row.df['TimeStamp (sec)'].max()-row.df['TimeStamp (sec)'].min()
|
||||
totaltime = totaltime+row.df.ix[0,' ElapsedTime (sec)']
|
||||
totaltime = totaltime+row.df.loc[:,' ElapsedTime (sec)'].iloc[0]
|
||||
|
||||
|
||||
hours = int(totaltime/3600.)
|
||||
@@ -354,7 +354,7 @@ class STObjects(DjangoTestCase):
|
||||
row = rdata(filename,rower=rr)
|
||||
totaldist = row.df['cum_dist'].max()
|
||||
totaltime = row.df['TimeStamp (sec)'].max()-row.df['TimeStamp (sec)'].min()
|
||||
totaltime = totaltime+row.df.ix[0,' ElapsedTime (sec)']
|
||||
totaltime = totaltime+row.df.loc[:,' ElapsedTime (sec)'].iloc[0]
|
||||
|
||||
|
||||
hours = int(totaltime/3600.)
|
||||
@@ -484,7 +484,7 @@ class RunKeeperObjects(DjangoTestCase):
|
||||
row = rdata(filename,rower=rr)
|
||||
totaldist = row.df['cum_dist'].max()
|
||||
totaltime = row.df['TimeStamp (sec)'].max()-row.df['TimeStamp (sec)'].min()
|
||||
totaltime = totaltime+row.df.ix[0,' ElapsedTime (sec)']
|
||||
totaltime = totaltime+row.df.loc[:,' ElapsedTime (sec)'].iloc[0]
|
||||
|
||||
|
||||
hours = int(totaltime/3600.)
|
||||
@@ -577,7 +577,7 @@ class UAObjects(DjangoTestCase):
|
||||
row = rdata(filename,rower=rr)
|
||||
totaldist = row.df['cum_dist'].max()
|
||||
totaltime = row.df['TimeStamp (sec)'].max()-row.df['TimeStamp (sec)'].min()
|
||||
totaltime = totaltime+row.df.ix[0,' ElapsedTime (sec)']
|
||||
totaltime = totaltime+row.df.loc[:,' ElapsedTime (sec)'].iloc[0]
|
||||
|
||||
|
||||
hours = int(totaltime/3600.)
|
||||
@@ -679,7 +679,7 @@ class TPObjects(DjangoTestCase):
|
||||
row = rdata(filename,rower=rr)
|
||||
totaldist = row.df['cum_dist'].max()
|
||||
totaltime = row.df['TimeStamp (sec)'].max()-row.df['TimeStamp (sec)'].min()
|
||||
totaltime = totaltime+row.df.ix[0,' ElapsedTime (sec)']
|
||||
totaltime = totaltime+row.df.loc[:,' ElapsedTime (sec)'].iloc[0]
|
||||
|
||||
|
||||
hours = int(totaltime/3600.)
|
||||
|
||||
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
Binary file not shown.
Reference in New Issue
Block a user