From fc40296a98713ec4da19ed17655e8ae408d6ce85 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Wed, 26 May 2021 13:10:46 +0200 Subject: [PATCH 1/4] ruptures 2 --- rowers/templates/summary_edit.html | 11 ++++++++ rowers/tests/testdata/testdata.tcx.gz | Bin 0 -> 4001 bytes rowers/views/workoutviews.py | 38 ++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 rowers/tests/testdata/testdata.tcx.gz diff --git a/rowers/templates/summary_edit.html b/rowers/templates/summary_edit.html index fb021a59..8b303bc4 100644 --- a/rowers/templates/summary_edit.html +++ b/rowers/templates/summary_edit.html @@ -59,6 +59,17 @@ +

Feeling lucky?

+

+

+ + + {{ ruptureform.as_table }} +
+ {% csrf_token %} + +
+

Interval Shorthand

See the how-to at the bottom of this page for details on how to use this form. diff --git a/rowers/tests/testdata/testdata.tcx.gz b/rowers/tests/testdata/testdata.tcx.gz new file mode 100644 index 0000000000000000000000000000000000000000..887f897c7b8beb74ccd409c1e0b300093d3a5815 GIT binary patch literal 4001 zcmV;S4_@#eiwFo@%&cGn|8!+@bYx+4VJ>uIcmVC4NpBoC7J%>m6@m`QVG#CP__!#t z0>{o^4A`C^F*3OgDpE)88L1_x%iF&nvfGhmTZQCFQv|C(9}IPMZCzhI^6fnQ?%ny> z-kassW_7WCxQ_<*_r5!NaQO17Tdh~?)5ptozr1?V_1$mXX1SMkUT+@mzv}zTgT>n~ST{1p(mV*XPfE-k#!{)q2x+>*HlQYO^}no%h+rao2Bu?VWC5Pk+=K zGVeAge}3TKyZ&)^c5$^@ZWeFw&-eem>yLN)FRw3!f9+C(fbM$e?l_ww1sk9+@t?+7s*F0Ma)+~H9YweEEJk7c_1pSphe{pI=g)$HG2reAWs z`RV%mW!GOWukG5~cGLgOBa`Qo+EYkx%BFv9*_xBBoSF6+0bZg80)y2ut z^KSjRJ4+Nl*?M#D?)bl--2HaT<;7~<-`t$PNbkU3co(<3eR||)uY?#o{F-bJxF>;| z6v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1M;Ej8#lv;lwmj$9iPdLmWfm9ud&m9{NQXAr%RVXY6}IcRhJ z4A6@q(yDnLT1M{F3$H?MnTTnd4t>DMG*oG7-T?ZTTP6Zx)YIn*BrT1cj?63G7+?E z+IsINGuKlK+76=6Mb-?e@Qn|?+4VC(AB`mIPAB!zPsXmNrsfTyXEI`~E_@RpG`oHV z=p`3kfet+uMW2@nY6JcV=z{@9T|fMgllLcro|-pr2z_438ZhY4bDRwNwtoFEdNx5w z7r9F>N=XerccN(MM?mk4XB$;6o#3#fOJ`Q-r6Tk(uW1W9srOiP!1t{LV+`~{##s!i zES(UFR@&YReXF?}MlZSgCa5xULo8Zpd#?e%_0kzeAM%>Ey2xFGqKlo)O2e-uOGjY4 zk~N@LIdUV)WL!GX`sNLy->zh>TjwrP*`O`7xqcM%K3Cr;(X*e->XvP;A4H#5vSuWe zH!oUWwEBix-@H-K^L7z)m2np(w$&{s?#;{ST`s&*qIa>V)VD^dKAV^{3VD z`@_dqiQ~o9hkajk>Fv3?c)RJ=C*9fE_GzV$tM%zg*LUf>-R|v5R6ZVe_~>>2>f-9g zYx3yw@@#e7_35WyzZlo&{^DfmyYFAG&Q7j>?l0+mOo!fhI3Kn=@BWi6nVkhUKYzK~ zYMnNF`MBS9!}X*6?EHr>(@h`!v^-mOn`PpVKYe&~H}323S+_oY`sC<`7n#lW&)xPP z(_8%F_4#khbY}qH0POxhT-^9#_vE*a>FB{0^=h4-!{dZ Date: Wed, 26 May 2021 13:10:56 +0200 Subject: [PATCH 2/4] sd --- rowers/templates/summary_edit.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rowers/templates/summary_edit.html b/rowers/templates/summary_edit.html index 8b303bc4..cc68a3df 100644 --- a/rowers/templates/summary_edit.html +++ b/rowers/templates/summary_edit.html @@ -69,7 +69,7 @@ {% csrf_token %} -

+

Interval Shorthand

See the how-to at the bottom of this page for details on how to use this form. From 6fa8030f4cdba237f2160dd44d4897a8ec77538d Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Fri, 28 May 2021 10:17:56 +0200 Subject: [PATCH 3/4] added explanation --- rowers/datautils.py | 1 - rowers/templates/summary_edit.html | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rowers/datautils.py b/rowers/datautils.py index 8c7727c7..8489af1f 100644 --- a/rowers/datautils.py +++ b/rowers/datautils.py @@ -468,7 +468,6 @@ def getfastest(df,thevalue,mode='distance'): starttime = griddata(restime,starttimes,[thevalue*60*1000],method='linear',rescale=True) duration = griddata(restime,restime,[thevalue*60*1000],method='linear',rescale=True) endtime = starttime+duration - print(distance,starttime,endtime ) return distance[0],starttime[0]/1000.,endtime[0]/1000. return 0 # pragma: no cover diff --git a/rowers/templates/summary_edit.html b/rowers/templates/summary_edit.html index cc68a3df..21fb9bc5 100644 --- a/rowers/templates/summary_edit.html +++ b/rowers/templates/summary_edit.html @@ -60,7 +60,9 @@

Feeling lucky?

-

+

This new, experimental feature tries to find intervals by looking for patterns in the data. It does not + autodetect rest and work intervals yet. The resulting "interval string" is copied to the Interval Shorthand + section below, where you can edit it.

From e1e16f9d41bde7fc7624dd0733cd9ef00c02c3f6 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Fri, 28 May 2021 10:23:52 +0200 Subject: [PATCH 4/4] feeling lucky --- rowers/templates/summary_edit.html | 104 +++++++++++++++-------------- 1 file changed, 55 insertions(+), 49 deletions(-) diff --git a/rowers/templates/summary_edit.html b/rowers/templates/summary_edit.html index 21fb9bc5..13e6f8c7 100644 --- a/rowers/templates/summary_edit.html +++ b/rowers/templates/summary_edit.html @@ -41,24 +41,60 @@ title="Jump to following workout">Next {% endif %}

+

+

+ + + + + + + + + +
Name{{ workout.name }}
Distance:{{ workout.distance }}m
Duration:{{ workout.duration |durationprint:"%H:%M:%S.%f" }}
Public link to this workout + https://rowsandall.com/rowers/workout/{{ workout.id|encode }} + +
+

Edit Workout Interval Data

    -
  • - - - - - - - - - - -
    Name{{ workout.name }}
    Distance:{{ workout.distance }}m
    Duration:{{ workout.duration |durationprint:"%H:%M:%S.%f" }}
    Public link to this workout - https://rowsandall.com/rowers/workout/{{ workout.id|encode }} - -
    +
  • +

    Updated Summary

    + + {% csrf_token %} + + + {% for key,value in formvalues.items %} + + {% endfor %} +

    + +

    + + Reset to last saved +   + Restore Original data + +
  • +

    +

    +					{{ intervalstats }}
    +				
    +

    + +
  • + + + + {{ interactiveplot |safe }} + + {{ the_div |safe }} +
  • +
  • Feeling lucky?

    This new, experimental feature tries to find intervals by looking for patterns in the data. It does not autodetect rest and work intervals yet. The resulting "interval string" is copied to the Interval Shorthand @@ -72,6 +108,8 @@

    +
  • +
  • Interval Shorthand

    See the how-to at the bottom of this page for details on how to use this form. @@ -83,6 +121,8 @@ {% csrf_token %} +

  • +
  • Intervals by Power/Pace

    With this form, you can specify a power or pace level. Everything faster/harder than the @@ -105,40 +145,6 @@

  • -
  • - - - - {{ interactiveplot |safe }} - - {{ the_div |safe }} -
  • -
  • -

    Updated Summary

    -
    - {% csrf_token %} - - - {% for key,value in formvalues.items %} - - {% endfor %} -

    - -

    - - Reset to last saved -   - Restore Original data - -
    -

    -

    -        {{ intervalstats }}
    -      
    -

    -
  • Interval Shorthand How-To

    This is a quick way to enter the intervals using a special mini-language.