Last active
May 25, 2016 15:12
-
-
Save jvrplmlmn/5744530 to your computer and use it in GitHub Desktop.
Calculator for the "GZCL method for powerlifting"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- encoding: utf-8 -*- | |
| import math | |
| import csv | |
| plate = 2.5 | |
| days = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri'] | |
| exercises = ['Squat', 'Bench', 'Deadlift', 'Bench', 'Squat'] | |
| tier1 = [[85, 1, 3], [87.5, 2, 2], [90, 3, 1]] | |
| tier2 = [[70, 7, 5], [75, 6, 4], [80, 10, 3], [60, 3, 10]] | |
| # This function rounds the weight to the smallest plate | |
| def round_weight(weight): | |
| f = math.floor(weight/plate) * plate | |
| c = math.floor(weight/plate) * plate | |
| if weight - f > c - weight: | |
| rounded_weight = c | |
| else: | |
| rounded_weight = f | |
| return rounded_weight | |
| # Calc Tier1 weights for 1 week | |
| def calc_tier1(increment): | |
| t = [] | |
| for i, s in enumerate(tier1): | |
| tt = [] | |
| for weight in weights: | |
| w = round_weight(s[0]*(weight+increment)/100) | |
| tt.append("%.1f %d x %d" % (w, s[1], s[2])) | |
| t.append(tt) | |
| return t | |
| # Calc Tier 2 weights for 1 week | |
| def calc_tier2(week): | |
| t = [] | |
| s = tier2[week-1] | |
| for weight in weights: | |
| w = round_weight(s[0]*weight/100) | |
| t.append("%.1f %d x %d" % (w, s[1], s[2])) | |
| return t | |
| def write_csv(filename): | |
| try: | |
| f = open(filename, 'wt') | |
| writer = csv.writer(f, delimiter=';', quoting=csv.QUOTE_ALL) | |
| percentage_increment = 0 | |
| for week in range(1, 5): | |
| # Headers | |
| writer.writerow(["Week %d" % week]) | |
| writer.writerow(days) | |
| writer.writerow(exercises) | |
| # Data | |
| t1 = calc_tier1(percentage_increment) | |
| t2 = calc_tier2(week) | |
| writer.writerows(t1) | |
| writer.writerow(t2) | |
| # Empty line as separator | |
| writer.writerow([]) | |
| percentage_increment += 2.5 | |
| # Close the file | |
| f.close() | |
| #print open(filename, 'rt').read() | |
| except Exception: | |
| pass | |
| def print_intro(): | |
| text = """ | |
| The GZCL for powerlifting | |
| http://www.reddit.com/r/weightroom/comments/13n0j5/the_gzcl_method_for_powerlifting/ | |
| http://swoleateveryheight.blogspot.com.es/2012/11/the-gzcl-method-for-powerlifting.html | |
| Enter a weight that you can 3RM on a good day or 1RM on a bad/sick day | |
| """ | |
| print text | |
| if __name__ == '__main__': | |
| print_intro() | |
| squat = float(raw_input("\tSquat? > ")) | |
| bench = float(raw_input("\tBench? > ")) | |
| deadlift = float(raw_input("\tDeadlift? > ")) | |
| weights = [squat, bench, deadlift, bench, squat] | |
| filename = raw_input("\n\tFilename? > ") | |
| if not filename: | |
| filename = 'gzcl_template' | |
| filename += '.csv' | |
| write_csv(filename) | |
| print "Now you have your monthly progression saved in a csv file: %s" % filename |
Do I just drop it into excel, or....?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So how do I open this?