Breathe in, breath out
println("t00t t00t.")
println("ππΊπ΅")
The package is capable of displaying programmes in the console, writing CSV files and using CSV files for plotting and analysis.
Printing
What gunpowder did for war, the printing press has done for the mind.
- Wendell Phillips on pressing ink to paper
The default printing does a poor job of displaying the programme so we multiple-dispatched our way into making it look pretty like Robert Oberst.
Base.println
β Methodprintln(programme::Programme, idx = 1:length(programme))
Prints the programme in console in a nicely formatted style. Users can optionally provide an index, be it an integer, unit range, tuple or array. The index corresponds to the day. Function write
writes to a csv and has the same indexing functionality.
Examples
println(MyProg) # Prints whole programme.
println(MyProg, 1) # Prints day 1.
ndays = length(MyProg) # Length returns the number of days.
println(MyProg, 1:2:ndays) # Prints every second day starting from the first.
println(MyProg, [1, 5, 20]) # Prints days 1, 5 and 20 (also works with tuples).
May the Programme
be with you, always. This lets you do so, implement the programme in your favourite app, put on google sheets, log your progress, and then use that log to analyse your progress with loadLogFile
and plotData
. Alternatively, be a monster and print everything out, who needs trees anyway?
Base.write
β Methodwrite(
filename::AbstractString,
programme::Programme,
idx = 1:length(programme);
delim::Char = ',',
log::Bool = false,
)
Writes programme to CSV. It defaults to delimiting the file with commas but you can choose your own. If log == true
, generate a log file where users can log their progress. Automatically appends "Log_" to the start of the filename. Indexing works the same way as println
.
The log file will print every exercise in the programme, even those you may not care about. These can be deleted. However if you do so, make sure to change the number in cell [1,1]
(top left) to the number of exercises you're keeping track of. This number is used by the programme to know how many columns to read.
Analysis and Utility
Data is the blood of any organization; coming from everywhere, used everywhere, connecting all the body, transferring messages and when analysed it reflects the whole picture of the body.
- Khalid Abulmajd on anthropomorphic moral persons
If you've been logging your progress like a good lifter you can load it into Julia for some a n a l y t i c s.
Lifting.loadLogFile
β MethodloadLogFile(programme::Programme)
Loads the programme's log file and returns the following values:
keyArr
is array of exercise names which double as the keys for the other outputs,date
is a dictionary containing the dates in which each exercise was performed,day1
is a dictionary containing the first date on which each exercise was performed,Ξdays
is a dictionary containing the number of days elapsed from the betweenday1
and the last registered date,reps
is a dictionary containing the number of reps performed,wght
is a dictionary containing the weight used,rpe
is a dictionary containing the rpe for the set.
The function drops missing values so every exercise will have all its corresponding pieces of data for a given date. It also doesn't matter if you logged only reps and weight for a session, you just won't have the data point for that session's rpe. The only thing you have to worry about is logging your progress properly. For a nice summary of progress I recommend logging only the top sets for each entry, you can have more of course but you will have to filter out data to make valuable analyses. Regardless, logging all your sessions in a notebook or app is recommended.
It assumes the filename was not changed from the one generated by write
.
Logs usually use dates, but we never want to know our progress as a function date do we? We want it as a function of time. This turns dates into number of days between the earliest date and the rest.
Lifting.numDays
β MethodnumDays(dates; format = "dd/mm/yyyy")
Takes an array strings which represent dates in the format provided and calculates the number of days between the first and last entries.
A picture is worth a thousand words, a lifter is worth at least half a human.
Lifting.plotData
β MethodplotData(prog::Programme, names::Vector{Any}, x, y, args...; kwargs...)
Plot your hard earned progress with smooth curves and labels the figures appropriately. Skips missing values so your programme won't crash. Creates a new figure for each call, creating an array of figures. For mutating the same figure see plotData!
.
Lifting.plotData!
β MethodplotData!(fig, prog::Programme, names::Vector{Any}, x, y, args...; kwargs...)
Same as plotData
but mutates the input figure.
Lifting.scatterData
β MethodscatterData(prog::Programme, names::Vector{Any}, x, y, args...; kwargs...)
Makes a scatter plot of the data. For mutating the same figure see scatterData!
.
Lifting.scatterData!
β MethodscatterData!(fig, prog::Programme, names::Vector{Any}, x, y, args...; kwargs...)
Same as scatterData
but mutates the figure.