Gym workout notes & analysis

Following the example demo provided by Michael Becker, I’ve built a Tinderbox file that parses text data from my iOS workout tracking app, then creates notes and attributes that let me analyze and plan my workouts.

Next steps include more functionality AND adding Posters to graphically display the data.

Comments and ideas welcome!
Workout Repcount processing.tbx (551.6 KB)

4 Likes

Small observation, in the Logging functions:

function LogDate(s){var t=date("today");
	Log(t.format("l")+" "+t.format("t")); };

An input ‘s’ is defined but not used, so likely not needed. Bear in mind the app expects an input, even if only an empty string, for each defined input. I suggest (line breaks for clarity of reading):

function LogDate(){
   var t=date("today");
   Log(t.format("l")+" "+t.format("t"));
};

Unless LogDate() is meant to only be used to generate inline text sent to the log, you might consider adding a line break "\n" after formatted data, or at least a space, else the next log input will butt up against the end of the date time string.

Not a big deal, as you don’t appear to actually use this function. :slight_smile:

†. Layout issue like this are entirely a matter of personal choice. As long as you meet Action Code syntax rules the app’s code parser ignores line breaks. This is why, in a multi-line piece of code, line terminators (the semi-colon) are needed else successive lines are (mis-)read as a single exprtession.

1 Like

I suggest adding a definition for your user attributes, especially if sharing with others. Names are not always as indicative—or memorable—as we assume when making them. For instance, the meaning of $Vol isn’t guessable.

Of course, if I had the RepCount app (I don’t) I might know. :slight_smile: . In that vein, why not—in your shared demo—add a note that holds un-parsed data. That way more people can try out and (learn from) your code even if their own task is different.

$bodypart doesn’t appear to be used. Your ‘Future Work’ note hint at this “…e.g., Matrix Lat Raise = Shoulders, …” where i’m guessing "shoulders might be the $bodypart value.

None of the above are errors/bad practice, just odd things noticed when perusing the code. Kudos to you for sharing and for getting as far as you have. the slope seems steepest at the start. The more pre-existing structure you have, things get a bit easier.

A couple more minor observations from stamp “Process Repcount”

//create Startdate from first line of Text

Attribute names are case sensitive. A good habit to acquire—whatever your personal attribute naming strategy is to use the correct casing of the attribute you are describing. Checking further down the code, the comment actually refers to StartDate not Startdate (the latter would be a different attribute). Now, while the code is fresh in mind, that might seem a snippy observation but it draws on experience. Months from now, you might be chasing a glitch which turns out to be a mis-named (mis-cased!) attribute reference. i’ve certainly done that in the past.

Again for future self, it might be useful to comment what your regex are ding. the first seem to look for aline starting with a single letter character (upper OR lower case) followed by zero-or more of any character. The next seems to look for a line containing (should that be starting with?) one or more successive digit characters, zero or more white space, a single ‘x’, zero or more white spaces then one of more digits.

As said these are minor things (but you asked :slight_smile: ). Overall it looks good. Well done!

1 Like

Thanks to the valuable suggestions from @eastgate and @mwra and others, I’ve improved my Gym Workout file and I’m including it here.
Workout Repcount processing.tbx (570.3 KB)

I’m most proud of being able to implement Posters in this file, and that process has taught me a lot.

There are two Posters implemented:

  1. “Agt- Workout data” pulls all of the workout volumes (defined as the aggregate of weight * reps for all exercises in a workout) that are included in the /Workouts container, and displays them as a timeline chart using Plotly.
  2. “Latest Workout” identifies the most recent workout from /Workouts and creates a vertical bar chart of volumes by exercise, again using Plotly.

Posters really are a straightforward feature of a note–once you get the hang of it. For me, that meant studying the demo template provided in this Forum and learning how to use Tinderbox to feed note attributes to a visualization product such as Plotly.

As always, comments and suggestions welcome!

1 Like

Thanks you for sharing this—especially your comments about getting going with posters as I’m sure it will help give others the confidence to try this out.

The posters are on the root level map, but for anyone wondering where they are, you’ll need to scroll down and then you will see:

Thanks again!

1 Like

Pual, think you can join the meetup Saturday and review your new file…share with everyone the insights you’ve gleaned.

1 Like

14 posts were split to a new topic: Viewing posters in Text pane Preview