rmdmattingly / RowlogAnalysis

MIT License
5 stars 0 forks source link

Calculating Side Split Averages #20

Open Logar18 opened 4 years ago

Logar18 commented 4 years ago

@rmdmattingly Is average split a string?

I also thought of a good way to tie this into the heart rate zone idea. We could have a potential feature where if a user enters a heart rate, an optional checkbox pops up and asks what type of workout (u1/u2/u3 or AT) so we could compare average split to what type of workout/heart rate data.

Thoughts?

rmdmattingly commented 4 years ago

That's a great idea. Average split is a string, but I preemptively made some useful stuff in the Core module for handling splits. If you look at the Core.SplitManager.py file then you should see the functions: convertSplitToSeconds and convertSecondsToSplit This should make working with avg splits a breeze. You should be able to feed in, for example, the string 1:30.6 to convertSplitToSeconds which would then return the float 90.6. This will allow you to average it against other converted splits/rank against other converted splits/etc.. Then, when you want to finalize the data for a user you can use convertSecondsToSplit to convert the seconds back into a readable string.

Logar18 commented 4 years ago

How would I go about calling those functions from another file path? import sys? @taddyb @rmdmattingly

rmdmattingly commented 4 years ago

Consider these core files dependencies. All of your dependencies should be imported in main.py service container functions. If you look at the many function specific imports in main.py then you'll see what I'm talking about.
You'll call from Core import SplitManager and then pass the SplitManager class to your service file as a parameter in YourService.run. Then, in your service, use these functions by calling SplitManager.whateverFunction()