gazpachoking / trainaspower

Convert TrainAsOne training plans from pace to power, and upload them to FinalSurge for use in Stryd workouts.
21 stars 5 forks source link

Error with converting; dont exactly know whats wrong #16

Closed Ysschh closed 3 years ago

Ysschh commented 3 years ago

Hi,

I am new to this piece of software (and Stryd) and just made a config.yaml file. It runs, but it gives the following error:

2021-09-13 22:51:57.426 | INFO     | trainaspower.trainasone:get_next_workouts:40 - Fetching next TrainAsOne workout.
2021-09-13 22:51:58.165 | INFO     | trainaspower.trainasone:get_workout:72 - Converting TrainAsOne workout to power.
2021-09-13 22:51:58.171 | DEBUG    | trainaspower.stryd:get_power_from_pace:48 - Converting 15.05 minute / kilometer to power via Stryd calculator
2021-09-13 22:51:58.386 | DEBUG    | __main__:main:99 - Error
Traceback (most recent call last):

  File "trainaspower\trainasone.py", line 73, in get_workout

  File "trainaspower\trainasone.py", line 139, in convert_steps

  File "trainaspower\stryd.py", line 55, in convert_pace_range_to_power

  File "pint\registry_helpers.py", line 351, in wrapper

  File "trainaspower\stryd.py", line 50, in get_power_from_pace

  File "requests\models.py", line 900, in json

  File "json\__init__.py", line 346, in loads

  File "json\decoder.py", line 337, in decode

  File "json\decoder.py", line 355, in raw_decode

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "trainaspower\trainasone.py", line 49, in get_next_workouts

  File "trainaspower\trainasone.py", line 76, in get_workout

trainaspower.trainasone.FindWorkoutException: Error finding workout steps: ('Expecting value: line 1 column 1 (char 0)',)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "trainaspower\main.py", line 107, in <module>

> File "trainaspower\main.py", line 87, in main

  File "trainaspower\trainasone.py", line 54, in get_next_workouts

trainaspower.trainasone.FindWorkoutException: Error finding next TaO workout: Error finding workout steps: ('Expecting value: line 1 column 1 (char 0)',)
2021-09-13 22:51:58.392 | ERROR    | __main__:main:100 - Could not load next Train as One workout. Created taocalendar.html for debugging.

I dont really know what triggers this error and what i can do to get the thing going. All help is appreciated.

gazpachoking commented 3 years ago

Hmm. I'm wondering if this is to do with the Stryd premium plans. This tool uses the stryd race calculator to convert from a pace to a power range, and I believe Stryd has now locked that behind their premium membership for any new Stryd users. Can you access the race calculator at https://www.stryd.com/powercenter/tools from your account?

I'd like to keep this working on free Stryd accounts, but I'm not sure a good way to convert from pace to power without using that tool at the moment.

Ysschh commented 3 years ago

Yea, I thought about that too today. I've just received my stryd a few hours ago and they gave a 6 months free trial so I will see if it's working when I get home. I will update you on this. 

Sep 14, 2021, 16:33 by @.***:

Hmm. I'm wondering if this is to do with the Stryd premium plans. This tool uses the stryd race calculator to convert from a pace to a power range, and I believe Stryd has now locked that behind their premium membership for any new Stryd users. Can you access the race calculator at > https://www.stryd.com/powercenter/tools> from your account?

I'd like to keep this working on free Stryd accounts, but I'm not sure a good way to convert from pace to power without using that tool at the moment.

— You are receiving this because you authored the thread. Reply to this email directly, > view it on GitHub https://github.com/gazpachoking/trainaspower/issues/16#issuecomment-919210411> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/AVTUEN6PLLILM2OFRS4PDL3UB5MLHANCNFSM5D6VVYAQ> . Triage notifications on the go with GitHub Mobile for > iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or > Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub> .

Ysschh commented 3 years ago

Isn't it possible to use the rFTPw option in the Final Surge beta? It calculates the power ones by using your critical power. 

Sep 14, 2021, 16:33 by @.***:

Hmm. I'm wondering if this is to do with the Stryd premium plans. This tool uses the stryd race calculator to convert from a pace to a power range, and I believe Stryd has now locked that behind their premium membership for any new Stryd users. Can you access the race calculator at > https://www.stryd.com/powercenter/tools> from your account?

I'd like to keep this working on free Stryd accounts, but I'm not sure a good way to convert from pace to power without using that tool at the moment.

— You are receiving this because you authored the thread. Reply to this email directly, > view it on GitHub https://github.com/gazpachoking/trainaspower/issues/16#issuecomment-919210411> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/AVTUEN6PLLILM2OFRS4PDL3UB5MLHANCNFSM5D6VVYAQ> . Triage notifications on the go with GitHub Mobile for > iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or > Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub> .

gazpachoking commented 3 years ago

Isn't it possible to use the rFTPw option in the Final Surge beta? It calculates the power ones by using your critical power.

Possibly? I'm not exactly sure what feature you are referring to. Can you link me to more info about it?

Ysschh commented 3 years ago

It is a workout calculator on the Final Surge page, you have to go to the beta website and then on the right side of the screen there is a calculator icon, click on it and then choose Palladino.

BTW, I just tried it with my 6 months premium account and it still did not work. Could it be do to not having used the Stryd yet and as of that don't have a CP.

gazpachoking commented 3 years ago

BTW, I just tried it with my 6 months premium account and it still did not work. Could it be do to not having used the Stryd yet and as of that don't have a CP.

Ahh, this could absolutely be it. The race calculator must depend on having some data before it can do it's work.

gazpachoking commented 3 years ago

It is a workout calculator on the Final Surge page, you have to go to the beta website and then on the right side of the screen there is a calculator icon, click on it and then choose Palladino.

Hmm. I guess this could be used, but it's a different methodology than I am currently using. Right now this tool works by using the Stryd race calculator to estimate what power you should run at in order to hit a certain pace (assuming everything is flat.) It uses this to convert all of the paces given by trainasone.

In order to use something like the final surge calculator, first I'd need to figure out what the heck RWC is, and where to pull that data from, then it would just have to map Palladino's recommended powers for any given interval length and ignore whatever tranasone set as the pace goal.

Ysschh commented 3 years ago

Yea, don't think that's it. Got the same error today and I have a calculated CP now.  Met vriendelijke groet, 

Youri Schneider

Sep 14, 2021, 19:19 by @.***:

BTW, I just tried it with my 6 months premium account and it still did not work. Could it be do to not having used the Stryd yet and as of that don't have a CP.

Ahh, this could absolutely be it. The race calculator must depend on having some data before it can do it's work.

— You are receiving this because you authored the thread. Reply to this email directly, > view it on GitHub https://github.com/gazpachoking/trainaspower/issues/16#issuecomment-919355563> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/AVTUENZLWRUJAQFNMJSKDP3UB57ZJANCNFSM5D6VVYAQ> . Triage notifications on the go with GitHub Mobile for > iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or > Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub> .

gazpachoking commented 3 years ago

Have you tried to use the race calculator directly on the powercenter website?

Ysschh commented 3 years ago

Oh no IDidn't, have to do two more runs it says. So sorry, I have two more runs to do I see. Will update when I've done them. 

Sep 15, 2021, 22:19 by @.***:

Have you tried to use the race calculator directly on the powercenter website?

— You are receiving this because you authored the thread. Reply to this email directly, > view it on GitHub https://github.com/gazpachoking/trainaspower/issues/16#issuecomment-920347161> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/AVTUEN7MBR3M2KWUHCYSCNDUCD5T3ANCNFSM5D6VVYAQ> . Triage notifications on the go with GitHub Mobile for > iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or > Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub> .

gazpachoking commented 3 years ago

I've updated the requirements in the readme to mention this now. I'll add some better error handling and log messages when I get a chance as well.

https://github.com/gazpachoking/trainaspower/commit/df5ca33ce2652b5b254f8b9de813633191dac402

Ysschh commented 3 years ago

I have 5 runs now. I do have to wait a few days for it to work says Stryd. So I will wait and then update you on this.

Ysschh commented 3 years ago

Hey, 

I now can predict races and the program works fully. So that's awesome. Are you gonna take a look at the Final Surge way, so free users can use it to? If not that's okay, but it's nice to know if I can use your software when the 6 months trial is over. 

Sep 15, 2021, 23:52 by @.***:

I've updated the requirements in the readme to mention this now. I'll add some better error handling and log messages when I get a chance as well.

df5ca33

— You are receiving this because you authored the thread. Reply to this email directly, > view it on GitHub https://github.com/gazpachoking/trainaspower/issues/16#issuecomment-920408205> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/AVTUENYTGFS4JOJZFDVBAC3UCEIRLANCNFSM5D6VVYAQ> . Triage notifications on the go with GitHub Mobile for > iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or > Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub> .

gazpachoking commented 3 years ago

Good to hear. I'm probably not going to work on the finalsurge way any time soon at least, as it wouldn't quite be the same thing. If somebody else wants to look at that and send a PR, or come up with some other method of converting the pace to power automatically, I'd be happy to look at that and merge it in though.

On Tue, Sep 21, 2021 at 12:33 PM Ysschh @.***> wrote:

Hey,

I now can predict races and the program works fully. So that's awesome. Are you gonna take a look at the Final Surge way, so free users can use it to? If not that's okay, but it's nice to know if I can use your software when the 6 months trial is over.

Sep 15, 2021, 23:52 by @.***:

I've updated the requirements in the readme to mention this now. I'll add some better error handling and log messages when I get a chance as well.

df5ca33

— You are receiving this because you authored the thread. Reply to this email directly, > view it on GitHub < https://github.com/gazpachoking/trainaspower/issues/16#issuecomment-920408205>> , or > unsubscribe < https://github.com/notifications/unsubscribe-auth/AVTUENYTGFS4JOJZFDVBAC3UCEIRLANCNFSM5D6VVYAQ>> . Triage notifications on the go with GitHub Mobile for > iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>> or > Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gazpachoking/trainaspower/issues/16#issuecomment-924157577, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABNV7JMFMSNAB5VZWGW2ZDUDCXW3ANCNFSM5D6VVYAQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Ysschh commented 3 years ago

Okay, thanks good to know. Thanks for creating this piece of software, its really easy to use. 😄

Sep 21, 2021, 19:00 by @.***:

Good to hear. I'm probably not going to work on the finalsurge way any time soon at least, as it wouldn't quite be the same thing. If somebody else wants to look at that and send a PR, or come up with some other method of converting the pace to power automatically, I'd be happy to look at that and merge it in though.

On Tue, Sep 21, 2021 at 12:33 PM Ysschh @.***> wrote:

Hey,

I now can predict races and the program works fully. So that's awesome. Are you gonna take a look at the Final Surge way, so free users can use it to? If not that's okay, but it's nice to know if I can use your software when the 6 months trial is over.

Sep 15, 2021, 23:52 by @.***:

I've updated the requirements in the readme to mention this now. I'll add some better error handling and log messages when I get a chance as well.

df5ca33

— You are receiving this because you authored the thread. Reply to this email directly, > view it on GitHub < https://github.com/gazpachoking/trainaspower/issues/16#issuecomment-920408205>> , or > unsubscribe < https://github.com/notifications/unsubscribe-auth/AVTUENYTGFS4JOJZFDVBAC3UCEIRLANCNFSM5D6VVYAQ>> . Triage notifications on the go with GitHub Mobile for > iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>> or > Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gazpachoking/trainaspower/issues/16#issuecomment-924157577, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABNV7JMFMSNAB5VZWGW2ZDUDCXW3ANCNFSM5D6VVYAQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

— You are receiving this because you authored the thread. Reply to this email directly, > view it on GitHub https://github.com/gazpachoking/trainaspower/issues/16#issuecomment-924178220> , or > unsubscribe https://github.com/notifications/unsubscribe-auth/AVTUEN6PAC2GIQPJU6R4FATUDC23VANCNFSM5D6VVYAQ> . Triage notifications on the go with GitHub Mobile for > iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or > Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub> .

gazpachoking commented 3 years ago

A workout won't regenerate unless you run the program again. If you do run it again, it will update the workout if the TrainAsOne workout has changed, or if the Stryd calculator gives different values for the recommended paces coming from TaO. I have mine set to run with cron every 12 hours and just generate my next workout.

On Wed, Sep 22, 2021 at 7:07 AM Ysschh @.***> wrote:

Okay, thanks good to know.

I gave one other question, do I need to reuse your program after Stryd adjusts my CP or does the created workout change automatically to the new CP?

Sep 21, 2021, 19:00 by @.***:

Good to hear. I'm probably not going to work on the finalsurge way any time soon at least, as it wouldn't quite be the same thing. If somebody else wants to look at that and send a PR, or come up with some other method of converting the pace to power automatically, I'd be happy to look at that and merge it in though.

On Tue, Sep 21, 2021 at 12:33 PM Ysschh @.***> wrote:

Hey,

I now can predict races and the program works fully. So that's awesome. Are you gonna take a look at the Final Surge way, so free users can use it to? If not that's okay, but it's nice to know if I can use your software when the 6 months trial is over.

Sep 15, 2021, 23:52 by @.***:

I've updated the requirements in the readme to mention this now. I'll add some better error handling and log messages when I get a chance as well.

df5ca33

— You are receiving this because you authored the thread. Reply to this email directly, > view it on GitHub <

https://github.com/gazpachoking/trainaspower/issues/16#issuecomment-920408205

, or > unsubscribe <

https://github.com/notifications/unsubscribe-auth/AVTUENYTGFS4JOJZFDVBAC3UCEIRLANCNFSM5D6VVYAQ

.

Triage notifications on the go with GitHub Mobile for > iOS <

https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or > Android <

https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub

.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub < https://github.com/gazpachoking/trainaspower/issues/16#issuecomment-924157577 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AABNV7JMFMSNAB5VZWGW2ZDUDCXW3ANCNFSM5D6VVYAQ

. Triage notifications on the go with GitHub Mobile for iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675

or Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .

— You are receiving this because you authored the thread. Reply to this email directly, > view it on GitHub < https://github.com/gazpachoking/trainaspower/issues/16#issuecomment-924178220>> , or > unsubscribe < https://github.com/notifications/unsubscribe-auth/AVTUEN6PAC2GIQPJU6R4FATUDC23VANCNFSM5D6VVYAQ>> . Triage notifications on the go with GitHub Mobile for > iOS < https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>> or > Android < https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/gazpachoking/trainaspower/issues/16#issuecomment-924826353, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABNV7OHKP5IL55UQHWOP2TUDG2FNANCNFSM5D6VVYAQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.