-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🔪 reps-per-round #83
🔪 reps-per-round #83
Conversation
theianjones
commented
Nov 7, 2023
[{:keys [rounds] :as params}] | ||
(+ (/ (float (reps->score params)) REPS_MULTIPLIER) (n/parse-int rounds))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of referencing the reps per round to normalize score, we divide by 1000 and add that remainder to the rounds integer.
(is (= [{:reps "116" :index 0 :notes "" :id nil} | ||
{:reps "102" :index 1 :notes "fell off my pace" :id nil} | ||
{:reps "96" :index 2 :notes "couldnt think anymore" :id nil}] | ||
(sut/->scores params-with-reps)))) | ||
(testing "defaults rounds to score to 1" | ||
(is (= [{:reps "116" :index 0 :notes ""}] | ||
(is (= [{:reps "116" :index 0 :notes "" :id nil}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont think our tests run in ci... these were failing lol
[reps-per-round score] | ||
(if (int? score) | ||
(if (> 0 score) | ||
"0+0" | ||
(str (quot score reps-per-round) | ||
"+" | ||
(rem score reps-per-round))) | ||
(let [rounds (.intValue score) | ||
reps (.intValue (* REPS_MULTIPLIER (- (bigdec score) rounds)))] | ||
(str rounds "+" reps)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will handle old results that require reps-per-round and new results that we record.
We can merge this and things shouldnt break, migrate the old data to be a float, then delete the if block here