Skip to content

Instantly share code, notes, and snippets.

@Jerdak
Last active December 27, 2021 18:45
Show Gist options
  • Select an option

  • Save Jerdak/0fe3be39bba361be0d74 to your computer and use it in GitHub Desktop.

Select an option

Save Jerdak/0fe3be39bba361be0d74 to your computer and use it in GitHub Desktop.

Revisions

  1. Jerdak revised this gist Dec 4, 2015. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions workout.py
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    tabulated_style = False


    # Replace actual weight maxes here with *your* maxes
    # Replace these maxes with *your* maxes
    actual_max = {
    "benchpress":305,
    "squat":405,
    @@ -16,13 +16,13 @@
    # TM should be 90% of actual max (Following Wendler's Beyond 5/3/1 1.1 workout)
    training_max = {k:v*0.90 for k,v in actual_max.items()}

    # After each 4 week cycle of 531, add 5 lbs to bench and push presses and 10 lbs to squat and deadlift
    # After each 4-5 week cycle of 531, add 5 lbs to bench and push presses and add 10 lbs to squat and deadlift
    # **Reset these values to 0 if starting 531 for the first time.
    training_max_adjustments = {
    "benchpress":10,
    "squat":20,
    "pushpress":10,
    "deadlift":20
    "benchpress":0,
    "squat":0,
    "pushpress":0,
    "deadlift":0
    }
    training_max = {k:v+training_max_adjustments[k] for k,v in training_max.items()}

  2. Jerdak renamed this gist Dec 4, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. Jerdak created this gist Dec 4, 2015.
    77 changes: 77 additions & 0 deletions py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,77 @@
    try:
    from tabulate import tabulate as tb
    tabulated_style = True
    except Exception as ex:
    tabulated_style = False


    # Replace actual weight maxes here with *your* maxes
    actual_max = {
    "benchpress":305,
    "squat":405,
    "pushpress":190,
    "deadlift":440
    }

    # TM should be 90% of actual max (Following Wendler's Beyond 5/3/1 1.1 workout)
    training_max = {k:v*0.90 for k,v in actual_max.items()}

    # After each 4 week cycle of 531, add 5 lbs to bench and push presses and 10 lbs to squat and deadlift
    # **Reset these values to 0 if starting 531 for the first time.
    training_max_adjustments = {
    "benchpress":10,
    "squat":20,
    "pushpress":10,
    "deadlift":20
    }
    training_max = {k:v+training_max_adjustments[k] for k,v in training_max.items()}

    def print_new_style():
    """ Use the `tabulate` module to prettily print weight tables

    Notes:
    To download tabulate: pip install tabulate
    """
    max_table= [["lift","training_max", "actual_max"]] + [[key,value,actual_max[key]] for key,value in training_max.items()]

    # Print training maxes
    print(tb(max_table,headers="firstrow"))
    print("\n")

    # Print weight table by tenths of a percent
    tens = [i/100. for i in range(0,110,10)]
    weights = [[key]+[i*wt for i in tens] for key,wt in training_max.items()]
    print(tb(weights,headers=['lift (10%)'] + tens))

    print("\n")


    # Print weight table by fifths of a percent
    fives = [i/100. for i in range(5,115,10)]
    weights = [[key]+[i*wt for i in fives] for key,wt in training_max.items()]
    print(tb(weights,headers=['lift (5%)'] + fives))

    def print_old_style():
    """ Print weight tables using comma delimited format

    Intended to be read by something like Excel.
    For instance: python workout.py > weights.csv
    """
    fives = [i/100. for i in range(5,115,10)]
    tens = [i/100. for i in range(0,110,10)]

    print("actual maxes: ",actual_max)

    print("By 10%:")
    print("lift," + ",".join([str(i) for i in tens]))
    for key,weight in training_max.items():
    print(key+"(%f)"%(weight)+",",",".join([str(weight * i) for i in tens]))

    print("\nBy 10%(offset by 5):")
    print("lift," + ",".join([str(i) for i in fives]))
    for key,weight in training_max.items():
    print(key+"(%f)"%(weight)+",",",".join([str(weight * i) for i in fives]))


    if __name__=='__main__':
    print_new_style() if tabulated_style else print_old_style()