Private
Public Access
1
0

getting all tests to pass, improved developers page

This commit is contained in:
2024-12-04 21:19:38 +01:00
parent 1daed90104
commit 13effe6cce
4 changed files with 42 additions and 16 deletions

View File

@@ -8,7 +8,7 @@
<ul class="main-content"> <ul class="main-content">
<li class="grid_4"> <li class="grid_4">
<p>On this page, a work in progress, I will collect useful information <p>On this page, I will collect useful information
for developers of rowing data apps and hardware.</p> for developers of rowing data apps and hardware.</p>
<p>I presume you have an app (smartphone app, dedicated hardware, web site) <p>I presume you have an app (smartphone app, dedicated hardware, web site)
@@ -61,11 +61,11 @@
</ul></p> </ul></p>
<h2>Using the REST API</h2> <h2>Using the REST API</h2>
<p>We are building a REST API which will allow you to post and <p>We have a REST API which will allow you to post and
receive stroke receive stroke
data from the site directly.</p> data from the site directly.</p>
<p>The REST API is a work in progress. We are open to improvement <p>We are open to improvement
suggestions (provided they don't break existing apps). Please send suggestions (provided they don't break existing apps). Please send
email to <a href="mailto:info@rowsandall.com">info@rowsandall.com</a> email to <a href="mailto:info@rowsandall.com">info@rowsandall.com</a>
with questions and/or suggestions. We with questions and/or suggestions. We
@@ -84,7 +84,6 @@
<li>Disadvantages <li>Disadvantages
<p><ul class="contentli"> <p><ul class="contentli">
<li>The API is not stable and not fully tested yet.</li>
<li>You need to register your app with us. We can revoke your <li>You need to register your app with us. We can revoke your
permissions if you misuse them.</li> permissions if you misuse them.</li>
<li>The user user must grant permissions to your app.</li> <li>The user user must grant permissions to your app.</li>
@@ -114,7 +113,7 @@
<p>We have disabled the self service app link for security reasons. <p>We have disabled the self service app link for security reasons.
We will replace it with a secure self service app link soon. If you If you
need to register an app, please send email to info@rowsandall.com</p> need to register an app, please send email to info@rowsandall.com</p>
<h3>Authentication</h3> <h3>Authentication</h3>
@@ -728,11 +727,11 @@
<li><b>peakdriveforce</b>: Peak handle force (lbs)</li> <li><b>peakdriveforce</b>: Peak handle force (lbs)</li>
<li><b>lapidx</b>: Lap identifier</li> <li><b>lapidx</b>: Lap identifier</li>
<li><b>hr</b>: Heart rate (beats per minute)</li> <li><b>hr</b>: Heart rate (beats per minute)</li>
<li><b>wash</b>: Wash as defined per Empower oarlock (degrees)</li> <li><b>wash</b>: Wash as defined for your smart power measuring oarlock (degrees)</li>
<li><b>catch</b>: Catch angle per Empower oarlock (degrees)</li> <li><b>catch</b>: Catch angle for your smart power measuring oarlock (degrees)</li>
<li><b>finish</b>: Finish angle per Empower oarlock (degrees)</li> <li><b>finish</b>: Finish angle for your smart power measuring oarlock (degrees)</li>
<li><b>peakforceangle</b>: Peak Force Angle per Empower oarlock (degrees)</li> <li><b>peakforceangle</b>: Peak Force Angle for your smart power measuring oarlock (degrees)</li>
<li><b>slip</b>: Slip as defined per Empower oarlock (degrees)</li> <li><b>slip</b>: Slip as defined for your smart power measuring oarlock (degrees)</li>
</ul> </ul>
</p> </p>

View File

@@ -471,6 +471,14 @@ class OwnApi(TestCase):
gdproptin=True, ftpset=True,surveydone=True, gdproptin=True, ftpset=True,surveydone=True,
gdproptindate=timezone.now(), gdproptindate=timezone.now(),
rowerplan='pro',subscription_id=1) rowerplan='pro',subscription_id=1)
self.c = Client()
self.user_workouts = WorkoutFactory.create_batch(5, user=self.r)
self.factory = RequestFactory()
self.password = faker.word()
self.u.set_password(self.password)
self.u.save()
self.factory = APIRequestFactory()
def test_strokedataform(self): def test_strokedataform(self):

Binary file not shown.

View File

@@ -363,7 +363,10 @@ def trendflexdata(workouts, options, userid=0):
savedata = options.get('savedata',False) savedata = options.get('savedata',False)
try:
workouts = workouts.exclude(workoutsource='strava') workouts = workouts.exclude(workoutsource='strava')
except AttributeError: # pragma: no cover
workouts = [w for w in workouts if w.workoutsource != 'strava']
fieldlist, fielddict = dataprep.getstatsfields() fieldlist, fielddict = dataprep.getstatsfields()
fieldlist = [xparam, yparam, groupby, fieldlist = [xparam, yparam, groupby,
@@ -567,7 +570,10 @@ def flexalldata(workouts, options):
trendline = options['trendline'] trendline = options['trendline']
promember = True promember = True
try:
workouts = workouts.exclude(workoutsource='strava') workouts = workouts.exclude(workoutsource='strava')
except AttributeError: # pragma: no cover
workouts = [w for w in workouts if w.workoutsource != 'strava']
workstrokesonly = not includereststrokes workstrokesonly = not includereststrokes
@@ -615,7 +621,10 @@ def histodata(workouts, options):
workmax = options['workmax'] workmax = options['workmax']
userid = options['userid'] userid = options['userid']
try:
workouts = workouts.exclude(workoutsource='strava') workouts = workouts.exclude(workoutsource='strava')
except AttributeError: # pragma: no cover
workouts = [w for w in workouts if w.workoutsource != 'strava']
if userid == 0: # pragma: no cover if userid == 0: # pragma: no cover
@@ -805,7 +814,10 @@ def cpdata(workouts, options):
def statsdata(workouts, options): def statsdata(workouts, options):
try:
workouts = workouts.exclude(workoutsource='strava') workouts = workouts.exclude(workoutsource='strava')
except AttributeError: # pragma: no cover
workouts = [w for w in workouts if w.workoutsource != 'strava']
includereststrokes = options['includereststrokes'] includereststrokes = options['includereststrokes']
ids = options['ids'] ids = options['ids']
@@ -881,7 +893,11 @@ def statsdata(workouts, options):
def comparisondata(workouts, options): def comparisondata(workouts, options):
try:
workouts = workouts.exclude(workoutsource='strava') workouts = workouts.exclude(workoutsource='strava')
except AttributeError: # pragma: no cover
workouts = [w for w in workouts if w.workoutsource != 'strava']
includereststrokes = options['includereststrokes'] includereststrokes = options['includereststrokes']
xparam = options['xaxis'] xparam = options['xaxis']
yparam1 = options['yaxis1'] yparam1 = options['yaxis1']
@@ -925,7 +941,10 @@ def comparisondata(workouts, options):
def boxplotdata(workouts, options): def boxplotdata(workouts, options):
try:
workouts = workouts.exclude(workoutsource='strava') workouts = workouts.exclude(workoutsource='strava')
except AttributeError:
workouts = [w for w in workouts if w.workoutsource != 'strava']
includereststrokes = options['includereststrokes'] includereststrokes = options['includereststrokes']
spmmin = options['spmmin'] spmmin = options['spmmin']